diff options
author | shamikam | 2017-11-07 15:59:48 +0530 |
---|---|---|
committer | shamikam | 2017-11-07 15:59:48 +0530 |
commit | c0c0582462720ed597b00e116506570577614e89 (patch) | |
tree | 31dedd23698e5357b19c810b7d7a8464100ef44a /macros/movingrms.sci | |
download | FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.tar.gz FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.tar.bz2 FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.zip |
initial commit
Diffstat (limited to 'macros/movingrms.sci')
-rw-r--r-- | macros/movingrms.sci | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/macros/movingrms.sci b/macros/movingrms.sci new file mode 100644 index 0000000..231a9f1 --- /dev/null +++ b/macros/movingrms.sci @@ -0,0 +1,33 @@ +function [rmsx,w]=movingrms(x,w,rc,Fs) + +// Find moving RMS value of signal in x +// Calling Sequence +// [rmsx,w]=movingrms(x,w,rc,Fs=1) +// Parameters +// x: Real or complex valued vector or matrix +// w: Real or complex scalar value +// rc: Real or complex scalar value +// Fs: Real or complex scalar value +// Description +// This is an Octave function. +// The signal is convoluted against a sigmoid window of width w and risetime rc with the units of these parameters relative to the value of the sampling frequency given in Fs (Default value=1). +// Examples +// 1. [a,b]=movingrms ([4.4 94 1;-2 5i 5],1,-2) +// a = 0.91237 17.71929 0.96254 +// 0.91237 17.71929 0.96254 +// b = 0.18877 +// 0.18877 +// 2. [a,b]=movingrms ([4.4 94 1;-2 5i 5],1,-2,2) +// a = 4.8332 93.8669 5.0990 +// 4.8332 93.8669 5.0990 +// b = 1 +// 1 + +funcprot(0); +rhs=argn(2); +if (rhs<3) then + error("Wrong number of input arguments.") +elseif (rhs==3) then Fs=1; +end +[rmsx,w]=callOctave("movingrms",x,w,rc,Fs) +endfunction |