summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
Diffstat (limited to 'macros')
-rw-r--r--macros/ac2poly.binbin4080 -> 4088 bytes
-rw-r--r--macros/ac2rc.binbin4876 -> 4784 bytes
-rw-r--r--macros/arburg.binbin8888 -> 8912 bytes
-rw-r--r--macros/arcov.binbin2280 -> 3768 bytes
-rw-r--r--macros/aryule.binbin4592 -> 4604 bytes
-rw-r--r--macros/besselap.binbin0 -> 4340 bytes
-rw-r--r--macros/besselap.sci48
-rw-r--r--macros/buttap.binbin0 -> 4104 bytes
-rw-r--r--macros/buttap.sci45
-rw-r--r--macros/cheb.binbin0 -> 3404 bytes
-rw-r--r--macros/cheb.sci34
-rw-r--r--macros/cheb1ap.binbin0 -> 5508 bytes
-rw-r--r--macros/cheb1ap.sci51
-rw-r--r--macros/cheb2ap.binbin0 -> 4056 bytes
-rw-r--r--macros/cheb2ap.sci39
-rw-r--r--macros/cplxreal.binbin0 -> 5940 bytes
-rw-r--r--macros/cplxreal.sci43
-rw-r--r--macros/ellipap.binbin0 -> 5264 bytes
-rw-r--r--macros/ellipap.sci46
-rw-r--r--macros/fft.binbin0 -> 6080 bytes
-rw-r--r--macros/fft.sci49
-rw-r--r--macros/fft2.binbin0 -> 5292 bytes
-rw-r--r--macros/fft2.sci45
-rw-r--r--macros/freqs.binbin0 -> 3628 bytes
-rw-r--r--macros/freqs.sci29
-rw-r--r--macros/ifft.binbin0 -> 6476 bytes
-rw-r--r--macros/ifft.sci51
-rw-r--r--macros/ifft2.binbin0 -> 6016 bytes
-rw-r--r--macros/ifft2.sci45
-rw-r--r--macros/libbin5032 -> 5528 bytes
-rw-r--r--macros/names17
-rw-r--r--macros/ncauer.binbin0 -> 5372 bytes
-rw-r--r--macros/ncauer.sci49
-rw-r--r--macros/peak2rms.binbin13896 -> 13896 bytes
-rw-r--r--macros/pei_tseng_notch.binbin0 -> 5436 bytes
-rw-r--r--macros/pei_tseng_notch.sci44
-rw-r--r--macros/wconv.binbin0 -> 3416 bytes
-rw-r--r--macros/wconv.sci33
-rw-r--r--macros/zp2ss.binbin0 -> 5916 bytes
-rw-r--r--macros/zp2ss.sci65
-rw-r--r--macros/zp2tf.binbin0 -> 4116 bytes
-rw-r--r--macros/zp2tf.sci46
42 files changed, 779 insertions, 0 deletions
diff --git a/macros/ac2poly.bin b/macros/ac2poly.bin
index 5df28ee..5a1a177 100644
--- a/macros/ac2poly.bin
+++ b/macros/ac2poly.bin
Binary files differ
diff --git a/macros/ac2rc.bin b/macros/ac2rc.bin
index fbfb4f1..5bb60cf 100644
--- a/macros/ac2rc.bin
+++ b/macros/ac2rc.bin
Binary files differ
diff --git a/macros/arburg.bin b/macros/arburg.bin
index 3d5ebe9..d0865cb 100644
--- a/macros/arburg.bin
+++ b/macros/arburg.bin
Binary files differ
diff --git a/macros/arcov.bin b/macros/arcov.bin
index f0ef408..2c23d8e 100644
--- a/macros/arcov.bin
+++ b/macros/arcov.bin
Binary files differ
diff --git a/macros/aryule.bin b/macros/aryule.bin
index c902718..336ebf3 100644
--- a/macros/aryule.bin
+++ b/macros/aryule.bin
Binary files differ
diff --git a/macros/besselap.bin b/macros/besselap.bin
new file mode 100644
index 0000000..9794042
--- /dev/null
+++ b/macros/besselap.bin
Binary files 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
--- /dev/null
+++ b/macros/buttap.bin
Binary files 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
--- /dev/null
+++ b/macros/cheb.bin
Binary files 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
--- /dev/null
+++ b/macros/cheb1ap.bin
Binary files 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
--- /dev/null
+++ b/macros/cheb2ap.bin
Binary files 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
--- /dev/null
+++ b/macros/cplxreal.bin
Binary files 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
--- /dev/null
+++ b/macros/ellipap.bin
Binary files 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
--- /dev/null
+++ b/macros/fft.bin
Binary files 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
--- /dev/null
+++ b/macros/fft2.bin
Binary files 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
--- /dev/null
+++ b/macros/freqs.bin
Binary files 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
--- /dev/null
+++ b/macros/ifft.bin
Binary files 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
--- /dev/null
+++ b/macros/ifft2.bin
Binary files 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
--- a/macros/lib
+++ b/macros/lib
Binary files 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
--- /dev/null
+++ b/macros/ncauer.bin
Binary files 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
--- a/macros/peak2rms.bin
+++ b/macros/peak2rms.bin
Binary files differ
diff --git a/macros/pei_tseng_notch.bin b/macros/pei_tseng_notch.bin
new file mode 100644
index 0000000..40cd414
--- /dev/null
+++ b/macros/pei_tseng_notch.bin
Binary files 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
--- /dev/null
+++ b/macros/wconv.bin
Binary files 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
--- /dev/null
+++ b/macros/zp2ss.bin
Binary files 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
--- /dev/null
+++ b/macros/zp2tf.bin
Binary files 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