From 2c5902040b960ccca8d0b51c58c00fc114a09518 Mon Sep 17 00:00:00 2001 From: Abhinav Dronamraju Date: Thu, 9 Nov 2017 15:24:34 +0530 Subject: czt, dst1, fwht, hilbert1, ifht, ifwht, invfreq, rceps --- macros/ac2poly.bin | Bin 4080 -> 4088 bytes macros/ac2rc.bin | Bin 4876 -> 4784 bytes macros/arburg.bin | Bin 8888 -> 8912 bytes macros/arcov.bin | Bin 2280 -> 3768 bytes macros/aryule.bin | Bin 4592 -> 4604 bytes macros/czt.bin | Bin 0 -> 2164 bytes macros/czt.sci | 22 ++++++++++++++++++++++ macros/dst1.bin | Bin 0 -> 1360 bytes macros/dst1.sci | 19 +++++++++++++++++++ macros/fwht.bin | Bin 0 -> 1672 bytes macros/fwht.sci | 20 ++++++++++++++++++++ macros/hilbert1.bin | Bin 0 -> 1704 bytes macros/hilbert1.sci | 17 +++++++++++++++++ macros/ifht.bin | Bin 0 -> 1628 bytes macros/ifht.sci | 16 ++++++++++++++++ macros/ifwht.bin | Bin 0 -> 1684 bytes macros/ifwht.sci | 20 ++++++++++++++++++++ macros/invfreq.bin | Bin 0 -> 2520 bytes macros/invfreq.sci | 21 +++++++++++++++++++++ macros/lib | Bin 5032 -> 5280 bytes macros/names | 8 ++++++++ macros/peak2rms.bin | Bin 13896 -> 13896 bytes macros/rceps.bin | Bin 0 -> 1576 bytes macros/rceps.sci | 17 +++++++++++++++++ 24 files changed, 160 insertions(+) create mode 100644 macros/czt.bin create mode 100644 macros/czt.sci create mode 100644 macros/dst1.bin create mode 100644 macros/dst1.sci create mode 100644 macros/fwht.bin create mode 100644 macros/fwht.sci create mode 100644 macros/hilbert1.bin create mode 100644 macros/hilbert1.sci create mode 100644 macros/ifht.bin create mode 100644 macros/ifht.sci create mode 100644 macros/ifwht.bin create mode 100644 macros/ifwht.sci create mode 100644 macros/invfreq.bin create mode 100644 macros/invfreq.sci create mode 100644 macros/rceps.bin create mode 100644 macros/rceps.sci (limited to 'macros') diff --git a/macros/ac2poly.bin b/macros/ac2poly.bin index 5df28ee..5a1a177 100644 Binary files a/macros/ac2poly.bin and b/macros/ac2poly.bin differ diff --git a/macros/ac2rc.bin b/macros/ac2rc.bin index fbfb4f1..5bb60cf 100644 Binary files a/macros/ac2rc.bin and b/macros/ac2rc.bin differ diff --git a/macros/arburg.bin b/macros/arburg.bin index 3d5ebe9..d0865cb 100644 Binary files a/macros/arburg.bin and b/macros/arburg.bin differ diff --git a/macros/arcov.bin b/macros/arcov.bin index f0ef408..2c23d8e 100644 Binary files a/macros/arcov.bin and b/macros/arcov.bin differ diff --git a/macros/aryule.bin b/macros/aryule.bin index c902718..336ebf3 100644 Binary files a/macros/aryule.bin and b/macros/aryule.bin differ diff --git a/macros/czt.bin b/macros/czt.bin new file mode 100644 index 0000000..a9cd8c5 Binary files /dev/null and b/macros/czt.bin differ diff --git a/macros/czt.sci b/macros/czt.sci new file mode 100644 index 0000000..b027489 --- /dev/null +++ b/macros/czt.sci @@ -0,0 +1,22 @@ +function y = czt(x, varargin) + +funcprot(0); +lhs= argn(1); +rhs= argn(2); + +if(rhs<1 | rhs > 4) +error("Wrong number of input arguments") +end + +select (rhs) + case 1 then + y= callOctave("czt", x); + case 2 then + y= callOctave("czt", x, varargin(1)); + case 3 then + y= callOctave("czt", x, varargin(1), varargin(2)); + case 4 then + y= callOctave("czt", x, varargin(1), varargin(2), varargin(3)); +end +endfunction + diff --git a/macros/dst1.bin b/macros/dst1.bin new file mode 100644 index 0000000..91b23ca Binary files /dev/null and b/macros/dst1.bin differ diff --git a/macros/dst1.sci b/macros/dst1.sci new file mode 100644 index 0000000..3b3b4b6 --- /dev/null +++ b/macros/dst1.sci @@ -0,0 +1,19 @@ +function y = dst1(x, varargin) + +funcprot(0); + +lhs= argn(1); +rhs= argn(2); + +if(rhs>2) +error("Wrong number of input arguments"); +end + +select(rhs) + case 1 then + y = callOctave("dst", x); + case 2 then + y = callOctave("dst", x, varargin(1)); +end +endfunction + diff --git a/macros/fwht.bin b/macros/fwht.bin new file mode 100644 index 0000000..e2b1d80 Binary files /dev/null and b/macros/fwht.bin differ diff --git a/macros/fwht.sci b/macros/fwht.sci new file mode 100644 index 0000000..280bbee --- /dev/null +++ b/macros/fwht.sci @@ -0,0 +1,20 @@ +function y = fwht(x, varargin) + +funcprot(0); +rhs= argn(2); + +if(rhs<1 | rhs > 3) +error("Wrong number of input arguments"); +end + +select(rhs) + case 1 then + y= callOctave("fwht", x); + case 2 then + y= callOctave("fwht",x, varagin(1)); + case 3 then + y= callOctave("fwht",x, varargin(1), varargin(2)); +end +endfunction + + diff --git a/macros/hilbert1.bin b/macros/hilbert1.bin new file mode 100644 index 0000000..11ff749 Binary files /dev/null and b/macros/hilbert1.bin differ diff --git a/macros/hilbert1.sci b/macros/hilbert1.sci new file mode 100644 index 0000000..864067f --- /dev/null +++ b/macros/hilbert1.sci @@ -0,0 +1,17 @@ +function h= hilbert1(f, varargin) + +funcprot(0); +rhs= argn(2); +if(rhs<1 | rhs>3) + error("Wrong number of Input Arguments") +end + +select(rhs) + case 1 then + h= callOctave("hilbert", f); + case 2 then + h= callOctave("hilbert", f, varargin(1)); + case 3 then + h= callOctave("hilbert", f, varargin(1), varargin(2)); +end +endfunction diff --git a/macros/ifht.bin b/macros/ifht.bin new file mode 100644 index 0000000..7cab709 Binary files /dev/null and b/macros/ifht.bin differ diff --git a/macros/ifht.sci b/macros/ifht.sci new file mode 100644 index 0000000..aacbd7a --- /dev/null +++ b/macros/ifht.sci @@ -0,0 +1,16 @@ +function m = ifht(d, varargin) +funcprot(0); +rhs= argn(2); +if(rhs<1 | rhs>3) +error("Wrong number of Inputs") +end + +select(rhs) + case 1 then + m= callOctave("ifht", d); + case 2 then + m= callOctave("ifht", d , varargin(1)); + case 3 then + m= callOctave("ifht", d , varargin(1),varargin(2) ); +end +endfunction diff --git a/macros/ifwht.bin b/macros/ifwht.bin new file mode 100644 index 0000000..2acef55 Binary files /dev/null and b/macros/ifwht.bin differ diff --git a/macros/ifwht.sci b/macros/ifwht.sci new file mode 100644 index 0000000..163c032 --- /dev/null +++ b/macros/ifwht.sci @@ -0,0 +1,20 @@ +function y= ifwht(x, varargin) + +funcprot(0); +rhs= argn(2); + +if(rhs<1 | rhs>3) +error("Wrong number of input arguments") +end + +select(rhs) + case 1 then + y= callOctave("ifwht", x); + case 2 then + y= callOctave("ifwht", x, varargin(1)); + case 3 then + y= callOctave("ifwht", x, varargin(1), varargin(2)); +end +endfunction + + diff --git a/macros/invfreq.bin b/macros/invfreq.bin new file mode 100644 index 0000000..a13ae55 Binary files /dev/null and b/macros/invfreq.bin differ diff --git a/macros/invfreq.sci b/macros/invfreq.sci new file mode 100644 index 0000000..dde23ef --- /dev/null +++ b/macros/invfreq.sci @@ -0,0 +1,21 @@ +function [B,A] = invfreq(H,F,nB,nA,W,iter,tol, plane) + + +funcprot(0); +lhs= argn(1); +rhs= argn(2); +if(rhs < 4 | rhs > 8 | rhs == 6 | rhs == 7 ) +error("Wrong number of input arguments"); +end + +select(rhs) + case 4 then + [B,A]= callOctave("invfreq", H,F,nB,nA); + case 5 then + [B,A]= callOctave("invfreq", H,F,nB,nA, W); + case 8 then + [B,A]= callOctave("invfreq", H,F,nB, nA,iter, tol, plane); +end +endfunction + + diff --git a/macros/lib b/macros/lib index 196ee56..fd7ba7c 100644 Binary files a/macros/lib and b/macros/lib differ diff --git a/macros/names b/macros/names index 76fc13d..3e3fa6e 100644 --- a/macros/names +++ b/macros/names @@ -32,6 +32,7 @@ convmtx corrmtx cummax cummin +czt db db2pow dctmtx @@ -39,6 +40,7 @@ decimate dftmtx diric downsample +dst1 dutycycle ellip ellipord @@ -56,6 +58,7 @@ flattopwin fracshift fwhm fwhmjlt +fwht gauspuls gaussdesign gaussian @@ -65,13 +68,17 @@ goertzel grpdelay hann helperHarmonicDistortionAmplifier +hilbert1 icceps +ifht +ifwht iirlp2mb impinvar impz impzlength interp intfilt +invfreq invimpinvar is2rc isallpass @@ -131,6 +138,7 @@ rc2ac rc2is rc2lar rc2poly +rceps rcosdesign rectpuls rectwin diff --git a/macros/peak2rms.bin b/macros/peak2rms.bin index 75d11fa..12d6e85 100644 Binary files a/macros/peak2rms.bin and b/macros/peak2rms.bin differ diff --git a/macros/rceps.bin b/macros/rceps.bin new file mode 100644 index 0000000..ff10b98 Binary files /dev/null and b/macros/rceps.bin differ diff --git a/macros/rceps.sci b/macros/rceps.sci new file mode 100644 index 0000000..065e482 --- /dev/null +++ b/macros/rceps.sci @@ -0,0 +1,17 @@ +function [y, xm]= rceps(x) + +funcprot(0) +lhs= argn(1) +rhs= argn(2) + +if(rhs <1 | rhs> 1 ) +error("Wrong number of Input Arguments"); +end + +if(lhs<2 | lhs>2) +error("Wrong number of Output Arguments") +end + + [y,xm]= callOctave("rceps",x); + +endfunction -- cgit From 47535ab08afeb48fbb00f03e68d6ff973cf62cbd Mon Sep 17 00:00:00 2001 From: Abhinav Dronamraju Date: Fri, 10 Nov 2017 14:59:26 +0530 Subject: Functions added --- macros/hurst.bin | Bin 0 -> 1060 bytes macros/hurst.sci | 13 ++++++++++++ macros/lib | Bin 5280 -> 5688 bytes macros/names | 17 ++++++++++----- macros/remez1.bin | Bin 0 -> 2424 bytes macros/remez1.sci | 21 +++++++++++++++++++ macros/sinetone.bin | Bin 0 -> 2132 bytes macros/sinetone.sci | 20 ++++++++++++++++++ macros/sinewave.bin | Bin 0 -> 1720 bytes macros/sinewave.sci | 18 ++++++++++++++++ macros/spectral_adf.bin | Bin 0 -> 1768 bytes macros/spectral_adf.sci | 18 ++++++++++++++++ macros/spectral_xdf.bin | Bin 0 -> 1768 bytes macros/spectral_xdf.sci | 18 ++++++++++++++++ macros/spencer.bin | Bin 0 -> 1076 bytes macros/spencer.sci | 15 ++++++++++++++ macros/stft.bin | Bin 0 -> 5464 bytes macros/stft.sci | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ macros/synthesis.bin | Bin 0 -> 1256 bytes macros/synthesis.sci | 16 ++++++++++++++ macros/yulewalker.bin | Bin 0 -> 1924 bytes macros/yulewalker.sci | 24 +++++++++++++++++++++ 22 files changed, 229 insertions(+), 5 deletions(-) create mode 100644 macros/hurst.bin create mode 100644 macros/hurst.sci create mode 100644 macros/remez1.bin create mode 100644 macros/remez1.sci create mode 100644 macros/sinetone.bin create mode 100644 macros/sinetone.sci create mode 100644 macros/sinewave.bin create mode 100644 macros/sinewave.sci create mode 100644 macros/spectral_adf.bin create mode 100644 macros/spectral_adf.sci create mode 100644 macros/spectral_xdf.bin create mode 100644 macros/spectral_xdf.sci create mode 100644 macros/spencer.bin create mode 100644 macros/spencer.sci create mode 100644 macros/stft.bin create mode 100644 macros/stft.sci create mode 100644 macros/synthesis.bin create mode 100644 macros/synthesis.sci create mode 100644 macros/yulewalker.bin create mode 100644 macros/yulewalker.sci (limited to 'macros') diff --git a/macros/hurst.bin b/macros/hurst.bin new file mode 100644 index 0000000..f723804 Binary files /dev/null and b/macros/hurst.bin differ diff --git a/macros/hurst.sci b/macros/hurst.sci new file mode 100644 index 0000000..1a99f8c --- /dev/null +++ b/macros/hurst.sci @@ -0,0 +1,13 @@ +function y = hurst(x) + +funcprot(0); +rhs= argn(2); +if(rhs<1 | rhs>1) + error("Wrong number of input arguments"); +end + +select(rhs) + case 1 then + y= callOctave("hurst", x); +end +endfunction diff --git a/macros/lib b/macros/lib index fd7ba7c..483a331 100644 Binary files a/macros/lib and b/macros/lib differ diff --git a/macros/names b/macros/names index 4099cfa..79a4781 100644 --- a/macros/names +++ b/macros/names @@ -71,15 +71,13 @@ grpdelay hann helperHarmonicDistortionAmplifier hilbert1 +hurst icceps -<<<<<<< HEAD -ifht -ifwht -======= idct1 idct2 idst1 ->>>>>>> 3f916032cc0b2efdeafb838dd10e1141ead2cb27 +ifht +ifwht iirlp2mb impinvar impz @@ -150,6 +148,7 @@ rceps rcosdesign rectpuls rectwin +remez1 resample residued residuez @@ -169,6 +168,8 @@ sgolayfilt shanwavf shiftdata sigmoid_train +sinetone +sinewave slewrate sos2cell sos2ss @@ -177,11 +178,16 @@ sos2zp sosbreak sosfilt specgram +spectral_adf +spectral_xdf +spencer ss2sos statelevels +stft stmcb strips subspaceMethodsInputParser +synthesis tf2sos tf2zp tf2zpk @@ -206,6 +212,7 @@ wkeep wrev xcorr2 xcov1 +yulewalker zerocrossing zp2sos zplane diff --git a/macros/remez1.bin b/macros/remez1.bin new file mode 100644 index 0000000..43589d0 Binary files /dev/null and b/macros/remez1.bin differ diff --git a/macros/remez1.sci b/macros/remez1.sci new file mode 100644 index 0000000..aabb25e --- /dev/null +++ b/macros/remez1.sci @@ -0,0 +1,21 @@ +function b = remez1(n,f,a, varargin) + +funcprot(0); +rhs= argn(2); + +if(rhs<3 | rhs>6) +error("Wrong number of input arguments"); +end + +select(rhs) + + case 3 then + b= callOctave("remez", n,f,a); + case 4 then + b= callOctave("remez", n,f,a,varargin(1)); + case 5 then + b= callOctave("remez", n,f,a,varargin(1), varargin(2)); + case 6 then + b= callOctave("remez", n,f,a,varargin(1), varargin(2), varargin(3)); +end +endfunction diff --git a/macros/sinetone.bin b/macros/sinetone.bin new file mode 100644 index 0000000..0c7254b Binary files /dev/null and b/macros/sinetone.bin differ diff --git a/macros/sinetone.sci b/macros/sinetone.sci new file mode 100644 index 0000000..006a2e0 --- /dev/null +++ b/macros/sinetone.sci @@ -0,0 +1,20 @@ +function y= sinetone(x, varargin) + +funcprot(0); +rhs= argn(2); +if(rhs<1 | rhs>4) +error("Wrong number of input arguments") +end + +select(rhs) + case 1 then + y= callOctave("sinetone", x); + case 2 then + y= callOctave("sinetone", x , varargin(1)); + case 3 then + y= callOctave("sinetone", x , varargin(1), varargin(2)); + case 4 then + y= callOctave("sinetone", x , varargin(1), varargin(2), varargin(3)); + +end +endfunction diff --git a/macros/sinewave.bin b/macros/sinewave.bin new file mode 100644 index 0000000..e5535c2 Binary files /dev/null and b/macros/sinewave.bin differ diff --git a/macros/sinewave.sci b/macros/sinewave.sci new file mode 100644 index 0000000..d5bdfa9 --- /dev/null +++ b/macros/sinewave.sci @@ -0,0 +1,18 @@ +function y= sinewave(x, varargin) + +funcprot(0); +rhs= argn(2); +if(rhs<1 | rhs>3) +error("Wrong number of input arguments") +end + +select(rhs) + case 1 then + y= callOctave("sinewave", x); + case 2 then + y= callOctave("sinewave", x , varargin(1)); + case 3 then + y= callOctave("sinewave", x , varargin(1), varargin(2)); + +end +endfunction diff --git a/macros/spectral_adf.bin b/macros/spectral_adf.bin new file mode 100644 index 0000000..f0cdacf Binary files /dev/null and b/macros/spectral_adf.bin differ diff --git a/macros/spectral_adf.sci b/macros/spectral_adf.sci new file mode 100644 index 0000000..ea81f42 --- /dev/null +++ b/macros/spectral_adf.sci @@ -0,0 +1,18 @@ +function y= spectral_adf(x, varargin) + +funcprot(0); +rhs= argn(2); +if(rhs<1 | rhs>3) +error("Wrong number of input arguments") +end + +select(rhs) + case 1 then + y= callOctave("spectral_adf", x); + case 2 then + y= callOctave("spectral_adf", x , varargin(1)); + case 3 then + y= callOctave("spectral_adf", x , varargin(1), varargin(2)); + +end +endfunction diff --git a/macros/spectral_xdf.bin b/macros/spectral_xdf.bin new file mode 100644 index 0000000..78678da Binary files /dev/null and b/macros/spectral_xdf.bin differ diff --git a/macros/spectral_xdf.sci b/macros/spectral_xdf.sci new file mode 100644 index 0000000..fe93327 --- /dev/null +++ b/macros/spectral_xdf.sci @@ -0,0 +1,18 @@ +function y= spectral_xdf(x, varargin) + +funcprot(0); +rhs= argn(2); +if(rhs<1 | rhs>3) +error("Wrong number of input arguments") +end + +select(rhs) + case 1 then + y= callOctave("spectral_xdf", x); + case 2 then + y= callOctave("spectral_xdf", x , varargin(1)); + case 3 then + y= callOctave("spectral_xdf", x , varargin(1), varargin(2)); + +end +endfunction diff --git a/macros/spencer.bin b/macros/spencer.bin new file mode 100644 index 0000000..4808d26 Binary files /dev/null and b/macros/spencer.bin differ diff --git a/macros/spencer.sci b/macros/spencer.sci new file mode 100644 index 0000000..537ca8a --- /dev/null +++ b/macros/spencer.sci @@ -0,0 +1,15 @@ +function y= spencer(x) + +funcprot(0); + +rhs= argn(2); + +if(rhs <1 | rhs >1) +error("Wrong number of input arguments"); +end + +select(rhs) + case 1 then + y = callOctave("spencer",x); +end +endfunction diff --git a/macros/stft.bin b/macros/stft.bin new file mode 100644 index 0000000..6766353 Binary files /dev/null and b/macros/stft.bin differ diff --git a/macros/stft.sci b/macros/stft.sci new file mode 100644 index 0000000..01d8f9b --- /dev/null +++ b/macros/stft.sci @@ -0,0 +1,54 @@ +function [y,c]= stft(x, varargin) + +funcprot(0); +lhs= argn(1); +rhs= argn(2); + +if(rhs <1 | rhs>5) + error("Wrong number of input arguments"); +end + +if(lhs<1 | lhs>2) + error("Wrong number of output arguments"); +end + +select(rhs) + case 1 then + select(lhs) + case 1 then + y= callOctave("stft", x); + case 2 then + [y,c]= callOctave("stft", x); + end + case 2 then + select(lhs) + case 1 then + y= callOctave("stft", x,varargin(1)); + case 2 then + [y,c]= callOctave("stft", x, varargin(1)); + end + case 3 then + select(lhs) + case 1 then + y= callOctave("stft", x,varargin(1), varargin(2)); + case 2 then + [y,c]= callOctave("stft", x,varargin(1), varargin(2)); + end + case 4 then + select(lhs) + case 1 then + y= callOctave("stft", x,varargin(1), varargin(2), varargin(3)); + case 2 then + [y,c]= callOctave("stft", x,varargin(1), varargin(2), varargin(3)); + end + case 5 then + select(lhs) + case 1 then + y= callOctave("stft", x,varargin(1), varargin(2), varargin(3), varargin(4)); + case 2 then + [y,c]= callOctave("stft", x,varargin(1), varargin(2), varargin(3), varargin(4)); + end +end +endfunction + + diff --git a/macros/synthesis.bin b/macros/synthesis.bin new file mode 100644 index 0000000..e9730e4 Binary files /dev/null and b/macros/synthesis.bin differ diff --git a/macros/synthesis.sci b/macros/synthesis.sci new file mode 100644 index 0000000..e787c86 --- /dev/null +++ b/macros/synthesis.sci @@ -0,0 +1,16 @@ +function x= synthesis(Y,C) + +funcprot(0); +lhs= argn(1); +rhs= argn(2); + +if(rhs<2 | rhs >2) + error("Wrong number of input arguments"); +end + +select(rhs) + case 2 then + x= callOctave("synthesis", Y,C); + +end +endfunction diff --git a/macros/yulewalker.bin b/macros/yulewalker.bin new file mode 100644 index 0000000..388c88b Binary files /dev/null and b/macros/yulewalker.bin differ diff --git a/macros/yulewalker.sci b/macros/yulewalker.sci new file mode 100644 index 0000000..ebcb8aa --- /dev/null +++ b/macros/yulewalker.sci @@ -0,0 +1,24 @@ +function [A,V]= yulewalker(C) + +funcprot(0); +lhs=argn(1); +rhs= argn(2); + +if(rhs<1 | rhs>1) + error("Wrong number of input arguments"); +end + +if(lhs<1 | lhs>2) + error("Wrong number of output arguments"); +end + +select(lhs) + + case 1 then + A= callOctave("yulewalker", C); + case 2 then + [A,V]= callOctave("yulewalker", C); +end +endfunction + + -- cgit From 6e1e4362783f68a8e8be1d199337c1ca831a2994 Mon Sep 17 00:00:00 2001 From: Brijeshcr Date: Fri, 10 Nov 2017 15:08:11 +0530 Subject: Brijesh functions --- macros/ac2poly.bin | Bin 4080 -> 4088 bytes macros/ac2rc.bin | Bin 4876 -> 4784 bytes macros/arburg.bin | Bin 8888 -> 8912 bytes macros/arcov.bin | Bin 2280 -> 3768 bytes macros/aryule.bin | Bin 4592 -> 4604 bytes macros/besselap.bin | Bin 0 -> 4340 bytes macros/besselap.sci | 48 +++++++++++++++++++++++++++++++++ macros/buttap.bin | Bin 0 -> 4104 bytes macros/buttap.sci | 45 +++++++++++++++++++++++++++++++ macros/cheb.bin | Bin 0 -> 3404 bytes macros/cheb.sci | 34 ++++++++++++++++++++++++ macros/cheb1ap.bin | Bin 0 -> 5508 bytes macros/cheb1ap.sci | 51 +++++++++++++++++++++++++++++++++++ macros/cheb2ap.bin | Bin 0 -> 4056 bytes macros/cheb2ap.sci | 39 +++++++++++++++++++++++++++ macros/cplxreal.bin | Bin 0 -> 5940 bytes macros/cplxreal.sci | 43 ++++++++++++++++++++++++++++++ macros/ellipap.bin | Bin 0 -> 5264 bytes macros/ellipap.sci | 46 ++++++++++++++++++++++++++++++++ macros/fft.bin | Bin 0 -> 6080 bytes macros/fft.sci | 49 ++++++++++++++++++++++++++++++++++ macros/fft2.bin | Bin 0 -> 5292 bytes macros/fft2.sci | 45 +++++++++++++++++++++++++++++++ macros/freqs.bin | Bin 0 -> 3628 bytes macros/freqs.sci | 29 ++++++++++++++++++++ macros/ifft.bin | Bin 0 -> 6476 bytes macros/ifft.sci | 51 +++++++++++++++++++++++++++++++++++ macros/ifft2.bin | Bin 0 -> 6016 bytes macros/ifft2.sci | 45 +++++++++++++++++++++++++++++++ macros/lib | Bin 5032 -> 5528 bytes macros/names | 17 ++++++++++++ macros/ncauer.bin | Bin 0 -> 5372 bytes macros/ncauer.sci | 49 ++++++++++++++++++++++++++++++++++ macros/peak2rms.bin | Bin 13896 -> 13896 bytes macros/pei_tseng_notch.bin | Bin 0 -> 5436 bytes macros/pei_tseng_notch.sci | 44 ++++++++++++++++++++++++++++++ macros/wconv.bin | Bin 0 -> 3416 bytes macros/wconv.sci | 33 +++++++++++++++++++++++ macros/zp2ss.bin | Bin 0 -> 5916 bytes macros/zp2ss.sci | 65 +++++++++++++++++++++++++++++++++++++++++++++ macros/zp2tf.bin | Bin 0 -> 4116 bytes macros/zp2tf.sci | 46 ++++++++++++++++++++++++++++++++ 42 files changed, 779 insertions(+) create mode 100644 macros/besselap.bin create mode 100644 macros/besselap.sci create mode 100644 macros/buttap.bin create mode 100644 macros/buttap.sci create mode 100644 macros/cheb.bin create mode 100644 macros/cheb.sci create mode 100644 macros/cheb1ap.bin create mode 100644 macros/cheb1ap.sci create mode 100644 macros/cheb2ap.bin create mode 100644 macros/cheb2ap.sci create mode 100644 macros/cplxreal.bin create mode 100644 macros/cplxreal.sci create mode 100644 macros/ellipap.bin create mode 100644 macros/ellipap.sci create mode 100644 macros/fft.bin create mode 100644 macros/fft.sci create mode 100644 macros/fft2.bin create mode 100644 macros/fft2.sci create mode 100644 macros/freqs.bin create mode 100644 macros/freqs.sci create mode 100644 macros/ifft.bin create mode 100644 macros/ifft.sci create mode 100644 macros/ifft2.bin create mode 100644 macros/ifft2.sci create mode 100644 macros/ncauer.bin create mode 100644 macros/ncauer.sci create mode 100644 macros/pei_tseng_notch.bin create mode 100644 macros/pei_tseng_notch.sci create mode 100644 macros/wconv.bin create mode 100644 macros/wconv.sci create mode 100644 macros/zp2ss.bin create mode 100644 macros/zp2ss.sci create mode 100644 macros/zp2tf.bin create mode 100644 macros/zp2tf.sci (limited to 'macros') diff --git a/macros/ac2poly.bin b/macros/ac2poly.bin index 5df28ee..5a1a177 100644 Binary files a/macros/ac2poly.bin and b/macros/ac2poly.bin differ diff --git a/macros/ac2rc.bin b/macros/ac2rc.bin index fbfb4f1..5bb60cf 100644 Binary files a/macros/ac2rc.bin and b/macros/ac2rc.bin differ diff --git a/macros/arburg.bin b/macros/arburg.bin index 3d5ebe9..d0865cb 100644 Binary files a/macros/arburg.bin and b/macros/arburg.bin differ diff --git a/macros/arcov.bin b/macros/arcov.bin index f0ef408..2c23d8e 100644 Binary files a/macros/arcov.bin and b/macros/arcov.bin differ diff --git a/macros/aryule.bin b/macros/aryule.bin index c902718..336ebf3 100644 Binary files a/macros/aryule.bin and b/macros/aryule.bin differ diff --git a/macros/besselap.bin b/macros/besselap.bin new file mode 100644 index 0000000..9794042 Binary files /dev/null and b/macros/besselap.bin differ diff --git a/macros/besselap.sci b/macros/besselap.sci new file mode 100644 index 0000000..6fe4f47 --- /dev/null +++ b/macros/besselap.sci @@ -0,0 +1,48 @@ +function [zero, pole, gain] = besselap (n) +//Return bessel analog filter prototype. +//Calling Sequence +//[zero, pole, gain] = besselap (n) +//[zero, pole] = besselap (n) +//zero = besselap (n) +//Parameters +//n: Filter Order +//zero: Zeros +//pole: Poles +//gain: Gain +//Description +//This is an Octave function. +//It Return bessel analog filter prototype of nth order. +//Examples +//[zero, pole, gain] = besselap (5) +//zero = [](0x0) +//pole = +// +// -0.59058 + 0.90721i +// -0.59058 - 0.90721i +// -0.92644 + 0.00000i +// -0.85155 + 0.44272i +// -0.85155 - 0.44272i +// +//gain = 1 + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 1 | rhs > 1) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 1 then + if(lhs==1) + zero = callOctave("besselap",n) + elseif(lhs==2) + [zero, pole] = callOctave("besselap",n) + elseif(lhs==3) + [zero, pole, gain] = callOctave("besselap",n) + else + error("Wrong number of output argments.") + end + end +endfunction diff --git a/macros/buttap.bin b/macros/buttap.bin new file mode 100644 index 0000000..10ce21e Binary files /dev/null and b/macros/buttap.bin differ diff --git a/macros/buttap.sci b/macros/buttap.sci new file mode 100644 index 0000000..9c2e08d --- /dev/null +++ b/macros/buttap.sci @@ -0,0 +1,45 @@ +function [z, p, g] = buttap (n) +//Design a lowpass analog Butterworth filter. +//Calling Sequence +//z = buttap (n) +//[z, p] = buttap (n) +//[z, p, g] = buttap (n) +//Parameters +//n: Filter Order +//z: Zeros +//p: Poles +//g: Gain +//Description +//This is an Octave function. +//It designs a lowpass analog Butterworth filter of nth order. +//Examples +//[z, p, g] = buttap (5) +//z = [](0x0) +//p = +// +// -0.30902 + 0.95106i -0.80902 + 0.58779i -1.00000 + 0.00000i -0.80902 - 0.58779i -0.30902 - 0.95106i +// +//g = 1 + + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 1 | rhs > 1) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 1 then + if(lhs==1) + z = callOctave("buttap",n) + elseif(lhs==2) + [z, p] = callOctave("buttap",n) + elseif(lhs==3) + [z, p, g] = callOctave("buttap",n) + else + error("Wrong number of output argments.") + end + end +endfunction diff --git a/macros/cheb.bin b/macros/cheb.bin new file mode 100644 index 0000000..28632eb Binary files /dev/null and b/macros/cheb.bin differ diff --git a/macros/cheb.sci b/macros/cheb.sci new file mode 100644 index 0000000..db2df85 --- /dev/null +++ b/macros/cheb.sci @@ -0,0 +1,34 @@ +function res = cheb (n, x) +//Calculates the nth-order Chebyshev polynomial at the point x. +//Calling Sequence +//cheb(n, x) +//Parameters +//n: Filter order +//x: Point at which the Chebyshev polynomial is calculater. +//Description +//This is an Octave function. +//Equation for Chebyshev polynomial is +// / cos(n acos(x), |x| <= 1 +// Tn(x) = | +// \ cosh(n acosh(x), |x| > 1 +// +//x can also be a vector. In that case the output will also be a vector of same size as x. +//Examples +//x = [1 2 3 4] +// cheb(10, x) +//ans = +// +// 1.0000e+00 2.6209e+05 2.2620e+07 4.5747e+08 + +funcprot(0); +rhs = argn(2) +if (rhs < 2 | rhs > 2) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 2 then + res = callOctave("cheb",n,x) + end +endfunction diff --git a/macros/cheb1ap.bin b/macros/cheb1ap.bin new file mode 100644 index 0000000..7414b4a Binary files /dev/null and b/macros/cheb1ap.bin differ diff --git a/macros/cheb1ap.sci b/macros/cheb1ap.sci new file mode 100644 index 0000000..361f272 --- /dev/null +++ b/macros/cheb1ap.sci @@ -0,0 +1,51 @@ +function [z, p, g] = cheb1ap (n, Rp) +//This function designs a lowpass analog Chebyshev type I filter. +//Calling Sequence +//[z, p, g] = cheb1ap (n, Rp) +//[z, p] = cheb1ap (n, Rp) +//p = cheb1ap (n, Rp) +//Parameters +//n: Filter Order +//Rp: Peak-to-peak passband ripple +//z: Zeros +//p: Poles +//g: Gain +//Description +//This is an Octave function. +//It designs a lowpass analog Chebyshev type I filter of nth order and with a Peak-to-peak passband ripple of Rp. +//Examples +//[z, p, g] = cheb1ap (10, 20) +//z = [](0x0) +//p = +// +// Columns 1 through 6: +// +// -0.00157 - 0.98774i -0.00456 - 0.89105i -0.00709 - 0.70714i -0.00894 - 0.45401i -0.00991 - 0.15644i -0.00991 + 0.15644i +// +// Columns 7 through 10: +// +// -0.00894 + 0.45401i -0.00709 + 0.70714i -0.00456 + 0.89105i -0.00157 + 0.98774i +// +//g = 1.9630e-04 - 6.3527e-22i + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 2 | rhs > 2) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 2 then + if(lhs==1) + z = callOctave("cheb1ap", n, Rp) + elseif(lhs==2) + [z, p] = callOctave("cheb1ap", n, Rp) + elseif(lhs==3) + [z, p, g] = callOctave("cheb1ap", n, Rp) + else + error("Wrong number of output argments.") + end + end +endfunction diff --git a/macros/cheb2ap.bin b/macros/cheb2ap.bin new file mode 100644 index 0000000..558a95b Binary files /dev/null and b/macros/cheb2ap.bin differ diff --git a/macros/cheb2ap.sci b/macros/cheb2ap.sci new file mode 100644 index 0000000..007d2d5 --- /dev/null +++ b/macros/cheb2ap.sci @@ -0,0 +1,39 @@ +function [z, p, g] = cheb2ap (n, Rs) +//This function designs a lowpass analog Chebyshev type II filter. +//Calling Sequence +//[z, p, g] = cheb2ap (n, Rs) +//[z, p] = cheb2ap (n, Rs) +//p = cheb2ap (n, Rs) +//Parameters +//n: Filter Order +//Rs: Stopband attenuation +//z: Zeros +//p: Poles +//g: Gain +//Description +//This is an Octave function. +//This function designs a lowpass analog Chebyshev type II filter of nth order and with a stopband attenuation of Rs. +//Examples +// + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 2 | rhs > 2) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 2 then + if(lhs==1) + z = callOctave("cheb2ap", n, Rs) + elseif(lhs==2) + [z, p] = callOctave("cheb2ap", n, Rs) + elseif(lhs==3) + [z, p, g] = callOctave("cheb2ap", n, Rs) + else + error("Wrong number of output argments.") + end + end +endfunction diff --git a/macros/cplxreal.bin b/macros/cplxreal.bin new file mode 100644 index 0000000..c5c522b Binary files /dev/null and b/macros/cplxreal.bin differ diff --git a/macros/cplxreal.sci b/macros/cplxreal.sci new file mode 100644 index 0000000..8443837 --- /dev/null +++ b/macros/cplxreal.sci @@ -0,0 +1,43 @@ +function [zc, zr] = cplxreal (z, thresh) +//Function to divide vector z into complex and real elements, removing the one of each complex conjugate pair. +//Calling Sequence +//[zc, zr] = cplxreal (z, thresh) +//[zc, zr] = cplxreal (z) +//zc = cplxreal (z, thresh) +//zc = cplxreal (z) +//Parameters +//z: vector of complex numbers. +//thresh: tolerance for comparisons. +//zc: vector containing the elements of z that have positive imaginary parts. +//zr: vector containing the elements of z that are real. +//Description +//This is an Octave function. +//Every complex element of z is expected to have a complex-conjugate elsewhere in z. From the pair of complex-conjugates, the one with the negative imaginary part is removed. +//If the magnitude of the imaginary part of an element is less than the thresh, it is declared as real. +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 1 | rhs > 2) +error("Wrong number of input arguments.") +end + +select(rhs) + case 1 then + if(lhs==1) + zc = callOctave("cplxreal",z) + elseif (lhs==2) + [zc, zr] = callOctave("cplxreal",z) + else + error("Wrong number of output argments.") + end + + case 2 then + if(lhs==1) + zc = callOctave("cplxreal",z, thresh) + elseif (lhs==2) + [zc, zr] = callOctave("cplxreal",z, thresh) + else + error("Wrong number of output argments.") + end + end +endfunction diff --git a/macros/ellipap.bin b/macros/ellipap.bin new file mode 100644 index 0000000..da6ce2e Binary files /dev/null and b/macros/ellipap.bin differ diff --git a/macros/ellipap.sci b/macros/ellipap.sci new file mode 100644 index 0000000..7b4c1ae --- /dev/null +++ b/macros/ellipap.sci @@ -0,0 +1,46 @@ +function [z, p, g] = ellipap (n, Rp, Rs) +//Designs a lowpass analog elliptic filter. +//Calling Sequence +//[z, p, g] = ellipap (n, Rp, Rs) +//[z, p] = ellipap (n, Rp, Rs) +//z = ellipap (n, Rp, Rs) +//Parameters +//n: Filter Order +//Rp: Peak-to-peak passband ripple +//Rs: Stopband attenuation +//Description +//This is an Octave function. +//It designs a lowpass analog elliptic filter of nth order, with a Peak-to-peak passband ripple of Rp and a stopband attenuation of Rs. +//Examples +//[z, p, g] = ellipap (5, 10, 10) +//z = +// +// 0.0000 + 2.5546i 0.0000 + 1.6835i -0.0000 - 2.5546i -0.0000 - 1.6835i +// +//p = +// +// -0.05243 + 0.63524i -0.01633 + 0.96289i -0.05243 - 0.63524i -0.01633 - 0.96289i -0.07369 + 0.00000i +// +//g = 0.0015012 + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 3 | rhs > 3) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 3 then + if(lhs==1) + z = callOctave("ellipap", n, Rp, Rs) + elseif(lhs==2) + [z, p] = callOctave("ellipap", n, Rp, Rs) + elseif(lhs==3) + [z, p, g] = callOctave("ellipap", n, Rp, Rs) + else + error("Wrong number of output argments.") + end + end +endfunction diff --git a/macros/fft.bin b/macros/fft.bin new file mode 100644 index 0000000..088707e Binary files /dev/null and b/macros/fft.bin differ diff --git a/macros/fft.sci b/macros/fft.sci new file mode 100644 index 0000000..0ea54ab --- /dev/null +++ b/macros/fft.sci @@ -0,0 +1,49 @@ +function res = fft (x, n, dim) +//Calculates the discrete Fourier transform of a matrix using Fast Fourier Transform algorithm. +//Calling Sequence +//fft (x, n, dim) +//fft (x, n) +//fft (x) +//Parameters +//x: input matrix +//n: Specifies the number of elements of x to be used +//dim: Specifies the dimention of the matrix along which the FFT is performed +//Description +//This is an Octave function. +//The FFT is calculated along the first non-singleton dimension of the array. Thus, FFT is computed for each column of x. +// +//n is an integer specifying the number of elements of x to use. If n is larger than dimention along. which the FFT is calculated, then x is resized and padded with zeros. +//Similarly, if n is smaller, then x is truncated. +// +//dim is an integer specifying the dimension of the matrix along which the FFT is performed. +//Examples +//x = [1 2 3; 4 5 6; 7 8 9] +//n = 3 +//dim = 2 +//fft (x, n, dim) +//ans = +// +// 6.0000 + 0.0000i -1.5000 + 0.8660i -1.5000 - 0.8660i +// 15.0000 + 0.0000i -1.5000 + 0.8660i -1.5000 - 0.8660i +// 24.0000 + 0.0000i -1.5000 + 0.8660i -1.5000 - 0.8660i + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 1 | rhs > 3) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 1 then + res = callOctave("fft", x) + + case 2 then + res = callOctave("fft", x, n) + + case 3 then + res = callOctave("fft", x, n, dim) + + end +endfunction diff --git a/macros/fft2.bin b/macros/fft2.bin new file mode 100644 index 0000000..dd6e2cc Binary files /dev/null and b/macros/fft2.bin differ diff --git a/macros/fft2.sci b/macros/fft2.sci new file mode 100644 index 0000000..58cd70d --- /dev/null +++ b/macros/fft2.sci @@ -0,0 +1,45 @@ +function res = fft2 (A, m, n) +//Calculates the two-dimensional discrete Fourier transform of A using a Fast Fourier Transform algorithm. +//Calling Sequence +//fft2 (A, m, n) +//fft2 (A) +//Parameters +//A: input matrix +//m: number of rows of A to be used +//n: number of columns of A to be used +//Description +//This is an Octave function. +//It performs two-dimentional FFT on the matrix A. m and n may be used specify the number of rows and columns of A to use. If either of these is larger than the size of A, A is resized and padded with zeros. +//If A is a multi-dimensional matrix, each two-dimensional sub-matrix of A is treated separately. +//Examples +//x = [1 2 3; 4 5 6; 7 8 9] +//m = 4 +//n = 4 +//fft2 (A, m, n) +//ans = +// +// 45 + 0i -6 - 15i 15 + 0i -6 + 15i +// -18 - 15i -5 + 8i -6 - 5i 5 - 4i +// 15 + 0i -2 - 5i 5 + 0i -2 + 5i +// -18 + 15i 5 + 4i -6 + 5i -5 - 8i + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 1 | rhs > 3) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 1 then + res = callOctave("fft2", A) + + case 2 then + error("Wrong number of input arguments.") + + case 3 then + res = callOctave("fft2", A, m, n) + + end +endfunction diff --git a/macros/freqs.bin b/macros/freqs.bin new file mode 100644 index 0000000..066c156 Binary files /dev/null and b/macros/freqs.bin differ diff --git a/macros/freqs.sci b/macros/freqs.sci new file mode 100644 index 0000000..88773fe --- /dev/null +++ b/macros/freqs.sci @@ -0,0 +1,29 @@ +function h = freqs (b, a, w) +//Compute the s-plane frequency response of the IIR filter. +//Calling Sequence +//h = freqs (b, a, w) +//Parameters +//b: vector containing the coefficients of the numerator of the filter. +//a: vector containing the coefficients of the denominator of the filter. +//w: vector containing frequencies +//Description +//This is an Octave function. +//It computes the s-plane frequency response of the IIR filter B(s)/A(s) as H = polyval(B,j*W)./polyval(A,j*W). +//If called with no output argument, a plot of magnitude and phase are displayed. +//Examples +//B = [1 2]; +//A = [1 1]; +//w = linspace(0,4,128); +//freqs(B,A,w); + +funcprot(0); +rhs = argn(2) +if(rhs<3 | rhs>3) +error("Wrong number of input arguments.") +end + +select (rhs) + case 3 then + y = callOctave("freqs",b, a, w) + end +endfunction diff --git a/macros/ifft.bin b/macros/ifft.bin new file mode 100644 index 0000000..1c95870 Binary files /dev/null and b/macros/ifft.bin differ diff --git a/macros/ifft.sci b/macros/ifft.sci new file mode 100644 index 0000000..70688e4 --- /dev/null +++ b/macros/ifft.sci @@ -0,0 +1,51 @@ +function res = ifft (x, n, dim) +//Calculates the inverse discrete Fourier transform of a matrix using Fast Fourier Transform algorithm. +//Calling Sequence +//ifft (x, n, dim) +//ifft (x, n) +//ifft (x) +//Parameters +//x: input matrix +//n: Specifies the number of elements of x to be used +//dim: Specifies the dimention of the matrix along which the inverse FFT is performed +//Description +//This is an Octave function. +//Description +//This is an Octave function. +//The inverse FFT is calculated along the first non-singleton dimension of the array. Thus, inverse FFT is computed for each column of x. +// +//n is an integer specifying the number of elements of x to use. If n is larger than dimention along. which the inverse FFT is calculated, then x is resized and padded with zeros. +//Similarly, if n is smaller, then x is truncated. +// +//dim is an integer specifying the dimension of the matrix along which the inverse FFT is performed. +//Examples +//x = [1 2 3; 4 5 6; 7 8 9] +//n = 3 +//dim = 2 +//ifft (x, n, dim) +//ans = +// +// 2.00000 + 0.00000i -0.50000 - 0.28868i -0.50000 + 0.28868i +// 5.00000 + 0.00000i -0.50000 - 0.28868i -0.50000 + 0.28868i +// 8.00000 + 0.00000i -0.50000 - 0.28868i -0.50000 + 0.28868i + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 1 | rhs > 3) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 1 then + res = callOctave("ifft", x) + + case 2 then + res = callOctave("ifft", x, n) + + case 3 then + res = callOctave("ifft", x, n, dim) + + end +endfunction diff --git a/macros/ifft2.bin b/macros/ifft2.bin new file mode 100644 index 0000000..bcd3a09 Binary files /dev/null and b/macros/ifft2.bin differ diff --git a/macros/ifft2.sci b/macros/ifft2.sci new file mode 100644 index 0000000..8ecb1a5 --- /dev/null +++ b/macros/ifft2.sci @@ -0,0 +1,45 @@ +function res = ifft2 (A, m, n) +//Calculates the inverse two-dimensional discrete Fourier transform of A using a Fast Fourier Transform algorithm. +//Calling Sequence +//ifft2 (A, m, n) +//ifft2 (A) +//Parameters +//A: input matrix +//m: number of rows of A to be used +//n: number of columns of A to be used +//Description +//This is an Octave function. +//It performs inverse two-dimensional FFT on the matrix A. m and n may be used specify the number of rows and columns of A to use. If either of these is larger than the size of A, A is resized and padded with zeros. +//If A is a multi-dimensional matrix, each two-dimensional sub-matrix of A is treated separately. +//Examples +//x = [1 2 3; 4 5 6; 7 8 9] +//m = 4 +//n = 4 +//ifft2 (A, m, n) +//ans = +// +// 2.81250 + 0.00000i -0.37500 + 0.93750i 0.93750 + 0.00000i -0.37500 - 0.93750i +// -1.12500 + 0.93750i -0.31250 - 0.50000i -0.37500 + 0.31250i 0.31250 + 0.25000i +// 0.93750 + 0.00000i -0.12500 + 0.31250i 0.31250 + 0.00000i -0.12500 - 0.31250i +// -1.12500 - 0.93750i 0.31250 - 0.25000i -0.37500 - 0.31250i -0.31250 + 0.50000i + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 1 | rhs > 3) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 1 then + res = callOctave("ifft2", A) + + case 2 then + error("Wrong number of input arguments.") + + case 3 then + res = callOctave("ifft2", A, m, n) + + end +endfunction diff --git a/macros/lib b/macros/lib index 196ee56..dc954ef 100644 Binary files a/macros/lib and b/macros/lib differ diff --git a/macros/names b/macros/names index 76fc13d..a2452ab 100644 --- a/macros/names +++ b/macros/names @@ -7,6 +7,7 @@ armcov aryule barthannwin bartlett +besselap besself bitrevorder blackman @@ -15,11 +16,15 @@ blackmannuttall bohmanwin boxcar buffer +buttap butter buttord cconv cell2sos +cheb +cheb1ap cheb1ord +cheb2ap cheb2ord chebwin cheby1 @@ -30,6 +35,7 @@ clustersegment cmorwavf convmtx corrmtx +cplxreal cummax cummin db @@ -41,10 +47,13 @@ diric downsample dutycycle ellip +ellipap ellipord enbw eqtflength falltime +fft +fft2 fftfilt filternorm filtfilt @@ -54,6 +63,7 @@ firpmord firtype flattopwin fracshift +freqs fwhm fwhmjlt gauspuls @@ -66,6 +76,8 @@ grpdelay hann helperHarmonicDistortionAmplifier icceps +ifft +ifft2 iirlp2mb impinvar impz @@ -100,6 +112,7 @@ modulate morlet movingrms musicBase +ncauer nnls nuttallwin parzenwin @@ -107,6 +120,7 @@ pchip pchips peak2peak peak2rms +pei_tseng_notch peig periodogram phaseInputParseAs_ab @@ -183,6 +197,7 @@ upsample upsamplefill var vco +wconv welchwin window wkeep @@ -190,4 +205,6 @@ wrev xcorr2 zerocrossing zp2sos +zp2ss +zp2tf zplane diff --git a/macros/ncauer.bin b/macros/ncauer.bin new file mode 100644 index 0000000..0886fbd Binary files /dev/null and b/macros/ncauer.bin differ diff --git a/macros/ncauer.sci b/macros/ncauer.sci new file mode 100644 index 0000000..c76eb65 --- /dev/null +++ b/macros/ncauer.sci @@ -0,0 +1,49 @@ +function [Zz, Zp, Zg] = ncauer(Rp, Rs, n) +//Analog prototype for Cauer filter. +//Calling Sequence +//[Zz, Zp, Zg] = ncauer(Rp, Rs, n) +//[Zz, Zp] = ncauer(Rp, Rs, n) +//Zz = ncauer(Rp, Rs, n) +//Parameters +//n: Filter Order +//Rp: Peak-to-peak passband ripple +//Rs: Stopband attenuation +//Description +//This is an Octave function. +//It designs an analog prototype for Cauer filter of nth order, with a Peak-to-peak passband ripple of Rp and a stopband attenuation of Rs. +//Examples +//n = 5; +//Rp = 5; +//Rs = 5; +//[Zz, Zp, Zg] = ncauer(Rp, Rs, n) +//Zz = +// +// 0.0000 + 2.5546i 0.0000 + 1.6835i -0.0000 - 2.5546i -0.0000 - 1.6835i +// +//Zp = +// +// -0.10199 + 0.64039i -0.03168 + 0.96777i -0.10199 - 0.64039i -0.03168 - 0.96777i -0.14368 + 0.00000i +// +//Zg = 0.0030628 + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 3 | rhs > 3) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 3 then + if(lhs==1) + Zz = callOctave("ncauer", Rp, Rs, n) + elseif(lhs==2) + [Zz, Zp] = callOctave("ncauer", Rp, Rs, n) + elseif(lhs==3) + [Zz, Zp, Zg] = callOctave("ncauer", Rp, Rs, n) + else + error("Wrong number of output argments.") + end + end +endfunction diff --git a/macros/peak2rms.bin b/macros/peak2rms.bin index 75d11fa..8f6cf06 100644 Binary files a/macros/peak2rms.bin and b/macros/peak2rms.bin differ diff --git a/macros/pei_tseng_notch.bin b/macros/pei_tseng_notch.bin new file mode 100644 index 0000000..40cd414 Binary files /dev/null and b/macros/pei_tseng_notch.bin differ diff --git a/macros/pei_tseng_notch.sci b/macros/pei_tseng_notch.sci new file mode 100644 index 0000000..1de0fcd --- /dev/null +++ b/macros/pei_tseng_notch.sci @@ -0,0 +1,44 @@ +function [b, a] = pei_tseng_notch (frequencies, bandwidths) + +//Return coefficients for an IIR notch-filter. +//Calling Sequence +//[b, a] = pei_tseng_notch (frequencies, bandwidths) +//b = pei_tseng_notch (frequencies, bandwidths) +//Parameters +//frequencies: filter frequencies +//bandwidths: bandwidths to be used with filter +//Description +//This is an Octave function. +//It return coefficients for an IIR notch-filter with one or more filter frequencies and according bandwidths. The filter is based on a all pass filter that performs phasereversal at filter frequencies. +//This leads to removal of those frequencies of the original and phase-distorted signal. +//Examples +//sf = 800; sf2 = sf/2; +//data=[[1;zeros(sf-1,1)],sinetone(49,sf,1,1),sinetone(50,sf,1,1),sinetone(51,sf,1,1)]; +//[b,a]=pei_tseng_notch ( 50 / sf2, 2/sf2 ) +//b = +// +// 0.99213 -1.83322 0.99213 +// +//a = +// +// 1.00000 -1.83322 0.98426 + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 2 | rhs > 2) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 2 then + if(lhs==1) + b = callOctave("pei_tseng_notch", frequencies, bandwidths) + elseif(lhs==2) + [b, a] = callOctave("pei_tseng_notch", frequencies, bandwidths) + else + error("Wrong number of output argments.") + end + end +endfunction diff --git a/macros/wconv.bin b/macros/wconv.bin new file mode 100644 index 0000000..f174e54 Binary files /dev/null and b/macros/wconv.bin differ diff --git a/macros/wconv.sci b/macros/wconv.sci new file mode 100644 index 0000000..a0682a6 --- /dev/null +++ b/macros/wconv.sci @@ -0,0 +1,33 @@ +function y = wconv (type, x, f, shape) +//Performs 1D or 2D convolution. +//Calling Sequence +//y = wconv (type, x, f) +// y = wconv (type, x, f, shape) +//Parameters +//type: convolution type. +//x: Signal vector or matrix. +//f: FIR filter coefficients. +//shape: Shape. +//Description +//This is an Octave function. +//It performs 1D or 2D convolution between the signal x and the filter coefficients f. +//Examples +//a = [1 2 3 4 5] +//b = [7 8 9 10] +//wconv(1,a,b) +//ans = +// 7 22 46 80 114 106 85 50 + +funcprot(0); +rhs = argn(2) +if(rhs<3 | rhs>4) +error("Wrong number of input arguments.") +end + +select (rhs) + case 3 then + y = callOctave("wconv",type, x, f) + case 4 then + y = callOctave("wconv",type, x, f, shape) + end +endfunction diff --git a/macros/zp2ss.bin b/macros/zp2ss.bin new file mode 100644 index 0000000..b8ab377 Binary files /dev/null and b/macros/zp2ss.bin differ diff --git a/macros/zp2ss.sci b/macros/zp2ss.sci new file mode 100644 index 0000000..ab14bfd --- /dev/null +++ b/macros/zp2ss.sci @@ -0,0 +1,65 @@ +function [a, b, c, d] = zp2ss (z, p, k) +//Converts zeros / poles to state space. +//Calling Sequence +//[a, b, c, d] = zp2ss (z, p, k) +//[a, b, c] = zp2ss (z, p, k) +//[a, b] = zp2ss (z, p, k) +//a = zp2ss (z, p, k) +//Parameters +//z: Zeros +//p: Poles +//k: Leading coefficient +//a: State space parameter +//a: State space parameter +//b: State space parameter +//c: State space parameter +//d: State space parameter +//Description +//This is an Octave function. +//It converts zeros / poles to state space. +//Examples +//z = [1 2 3] +// p = [4 5 6] +//k = 5 +//[a, b, c, d] = zp2ss (z, p, k) +//a = +// +// -0.00000 0.00000 -1.20000 +// -10.00000 0.00000 -7.40000 +// 0.00000 10.00000 15.00000 +// +//b = +// +// -5.7000 +// -31.5000 +// 45.0000 +// +//c = +// +// 0.00000 0.00000 1.00000 +// +//d = 5 + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 3 | rhs > 3) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 3 then + if(lhs==1) + a = callOctave("zp2ss", z, p, k) + elseif(lhs==2) + [a, b] = callOctave("zp2ss", z, p, k) + elseif(lhs==3) + [a, b, c] = callOctave("zp2ss", z, p, k) + elseif(lhs==4) + [a, b, c, d] = callOctave("zp2ss", z, p, k) + else + error("Wrong number of output argments.") + end + end +endfunction diff --git a/macros/zp2tf.bin b/macros/zp2tf.bin new file mode 100644 index 0000000..2597b7d Binary files /dev/null and b/macros/zp2tf.bin differ diff --git a/macros/zp2tf.sci b/macros/zp2tf.sci new file mode 100644 index 0000000..c830e3d --- /dev/null +++ b/macros/zp2tf.sci @@ -0,0 +1,46 @@ +function [num, den] = zp2tf (z, p, k) +//Converts zeros / poles to a transfer function. +//Calling Sequence +//[num, den] = zp2tf (z, p, k) +//num = zp2tf (z, p, k) +//Parameters +//z: Zeros +//p: Poles +//k: Leading coefficient +//Num: Numerator of the transfer function +//den: Denomenator of the transfer function +//Description +//This is an Octave function. +//It converts zeros / poles to a transfer function. +//Examples +//z = [1 2 3] +// p = [4 5 6] +//k = 5 +//[num, den] = zp2tf (z, p, k) +//num = +// +// 5 -30 55 -30 +// +//den = +// +// 1 -15 74 -120 + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if (rhs < 3 | rhs > 3) +error("Wrong number of input arguments.") +end + +select(rhs) + + case 3 then + if(lhs==1) + num = callOctave("zp2tf", z, p, k) + elseif(lhs==2) + [num, den] = callOctave("zp2tf", z, p, k) + else + error("Wrong number of output argments.") + end + end +endfunction -- cgit From 4bee11a7fe3cf8ead2e57e5d269d581d51bf72e6 Mon Sep 17 00:00:00 2001 From: Abhinav Dronamraju Date: Fri, 10 Nov 2017 16:47:58 +0530 Subject: Hanning added --- macros/hanning.bin | Bin 0 -> 1368 bytes macros/hanning.sci | 15 +++++++++++++++ macros/lib | Bin 5688 -> 5712 bytes macros/names | 1 + 4 files changed, 16 insertions(+) create mode 100644 macros/hanning.bin create mode 100644 macros/hanning.sci (limited to 'macros') diff --git a/macros/hanning.bin b/macros/hanning.bin new file mode 100644 index 0000000..fc3aa94 Binary files /dev/null and b/macros/hanning.bin differ diff --git a/macros/hanning.sci b/macros/hanning.sci new file mode 100644 index 0000000..85860c8 --- /dev/null +++ b/macros/hanning.sci @@ -0,0 +1,15 @@ +function y = hanning(m, varargin) + +funcprot(0); +rhs= argn(2); +if(rhs <1 | rhs>2) +error("Wrong number of Input parameters"); +end + +select(rhs) + case 1 then + y= callOctave("hanning", m); + case 2 then + y= callOctave("hanning", m , varargin(1)); +end +endfunction diff --git a/macros/lib b/macros/lib index 483a331..0d1f5d9 100644 Binary files a/macros/lib and b/macros/lib differ diff --git a/macros/names b/macros/names index 79a4781..a546c1b 100644 --- a/macros/names +++ b/macros/names @@ -69,6 +69,7 @@ gmonopuls goertzel grpdelay hann +hanning helperHarmonicDistortionAmplifier hilbert1 hurst -- cgit