Convert autocorrelation sequence to polynomial of prediction filter
-
-
-
Calling Sequence
-
a = ac2poly(r)
-[a,e] = ac2poly(r)
-
-
Parameters
-
r:
-
Autocorrelation sequence to be represented with an FIR linear prediction filter
-
a:
-
Output polynomial representing the linear prediction filter e/(a(1) + a(2)z + a(3)z^2 .. a(N)z^N-1)
-
e:
-
Output scaling for the lienar prediction filter
-
-
Description
-
Function ac2poly() finds the best fit polynomial for FIR linear prediction filter a, corresponding to the autocorrelation sequence r. a is the same length as r, and is normalized with the first element. So a(1) = 1.
-
Author
-Parthe Pandit
-
-
-
Bibliography
-
Kay, Steven M. Modern Spectral Estimation. Englewood Cliffs, NJ: Prentice-Hall, 1988.
List of M=(order+1) autoregressive model coefficients. The first element of "ar_coeffs" is the zero-lag coefficient, which always has a value of 1.
-
V:
-
Square of the moving-average coefficient of the AR model.
-
FREQ:
-
Frequencies at which power spectral density is calculated, or a scalar indicating the number of uniformly distributed frequency values at which spectral density is calculated. (default = 256)
-
FS:
-
Sampling frequency (Hertz) (default=1)
-
Range:
-
'half', 'onesided' : frequency range of the spectrum is from zero up to but not including sample_f/2. Power from negative frequencies is added to the positive side of the spectrum.'whole', 'twosided' : frequency range of the spectrum is-sample_f/2 to sample_f/2, with negative frequencies stored in "wrap around" order after the positive frequencies; e.g. frequencies for a 10-point 'twosided' spectrum are 0 0.1 0.2 0.3 0.4 0.5 -0.4 -0.3 -0.2 -0.1 'shift', 'centerdc' : same as 'whole' but with the first half of the spectrum swapped with second half to put the zero-frequency value in the middle. (See "help fftshift". If "freq" is vector, 'shift' is ignored. If model coefficients "ar_coeffs" are real, the default range is 'half', otherwise default range is 'whole'.
-
Method:
-
'fft': use FFT to calculate power spectrum. 'poly': calculate power spectrum as a polynomial of 1/z N.B. this argument is ignored if the "freq" argument is a vector. The default is 'poly' unless the "freq" argument is an integer power of 2.
-
Plot type:
-
'plot', 'semilogx', 'semilogy', 'loglog', 'squared' or 'db':specifies the type of plot. The default is 'plot', which means linear-linear axes. 'squared' is the same as 'plot'. 'dB' plots "10*log10(psd)". This argument is ignored and a spectrum is not plotted if the caller requires a returned value.
-
PSD:
-
estimate of power-spectral density
-
F_OUT:
-
frequency values
-
-
Description
-
If the FREQ argument is a vector (of frequencies) the spectrum is calculated using the polynomial method and the METHOD argument is ignored. For scalar FREQ, an integer power of 2, or METHOD = "FFT", causes the spectrum to be calculated by FFT. Otherwise, the spectrum is calculated as a polynomial. It may be computationally more efficient to use the FFT method if length of the model is not much smaller than the number of frequency values. The spectrum is scaled so that spectral energy (area under spectrum) is the same as the time-domain energy (mean square of the signal).
This function calculates coefficients of an autoregressive (AR) model of complex data.
-
-
-
Calling Sequence
-
a = arburg(x, poles)
-a = arburg(x, poles, criterion)
-[a, v] = arburg(...)
-[a, v, k] = arburg(...)
-
-
Parameters
-
x:
-
vector of real or complex numbers, of length > 2
-
poles:
-
positive integer value < length(x) - 2
-
criterion:
-
string value, takes in "AKICc", "KIC", "AICc", "AIC" and "FPE", default it not using a model-selection criterion
-
a, v, k:
-
Output variables
-
-
Description
-
This is an Octave function.
-
This function calculates coefficients of an autoregressive (AR) model of complex data x using the whitening lattice-filter method of Burg.
-
The first argument is the data sampled. The second argument is the number of poles in the model (or limit in case a criterion is supplied).
-The third parameter takes in the criterion to limit the number of poles. The acceptable values are "AIC", "AKICc", "KIC", "AICc" which are based on information theory.
-Output variable a is a list of P+1 autoregression coefficients.
-Output variable v is the mean square of residual noise from the whitening operation of the Burg lattice filter.
-Output variable k corresponds to the reflection coefficients defining the lattice-filter embodiment of the model.
in which e(t) is N(0, h(t)), given a time-series vector Y up to time t-1 and a matrix of (ordinary) regressors X up to t. The order of the regression of the residual variance is specified by P.
-
If invoked as 'arch_fit (Y, K, P)' with a positive integer K, fit an ARCH(K, P) process, i.e., do the above with the t-th row of X given by
-
[1, y(t-1), ..., y(t-k)]
-
Optionally, one can specify the number of iterations ITER, the updating factor GAMMA, and initial values a0 and b0 for the scoring algorithm.
Simulate an ARCH sequence of length t with AR coefficients b and CH coefficients a.
-
-
-
Calling Sequence
-
arch_rnd (a, b, t)
-
-
Parameters
-
a:
-
CH coefficients
-
b:
-
AR coefficients
-
t:
-
Length of ARCH sequence
-
-
Description
-
This is an Octave function.
-It Simulates an ARCH sequence of length t with AR coefficients b and CH coefficients a.
-The result y(t) follows the model
-
y(t) = b(1) + b(2) * y(t-1) + … + b(lb) * y(t-lb+1) + e(t),
-where e(t), given y up to time t-1, is N(0, h(t)), with
given Y up to t-1 and X up to t, e(t) is N(0, h(t)) with
-
h(t) = v + a(1) * e(t-1)^2 + ... + a(p) *e(t-p)^2, and the null is a(1) == ... == a(p) == 0.
-
If the second argument is a scalar integer, k,perform the sametest in a linear autoregression model of orderk, i.e., with
-
[1, y(t-1), ..., y(t-K)] as the t-th row of X.
-
Under the null, LM approximatel has a chisquare distribution with P degrees of freedom and PVAL is the p-value (1 minus the CDF of this distribution at LM) of the test.
-
If no output argument is given, the p-value is displayed.
This is an Octave function.
-The ARMA model is defined by
-
x(n) = a(1) * x(n-1) + … + a(k) * x(n-k)
-+ e(n) + b(1) * e(n-1) + … + b(l) * e(n-l)
-in which k is the length of vector a, l is the length of vector b and e is Gaussian white noise with variance v. The function returns a vector of length t.
-
The optional parameter n gives the number of dummy x(i) used for initialization, i.e., a sequence of length t+n is generated and x(n+1:t+n) is returned. If n is omitted, n = 100 is used.
This function fits an AR (p)-model with Yule-Walker estimates.
-The first argument is the data vector which is to be estimated.
-Output variable a gives the AR coefficients, v gives the variance of the white noise and k gives the reflection coefficients to be used in the lattice filter.
This function returns the filter coefficients of a modified Bartlett-Hann window.
-
-
-
Calling Sequence
-
y = barthannwin(m)
-
-
Parameters
-
m:
-
positive integer value
-
y:
-
output variable, vector of real numbers
-
-
Description
-
This is an Octave function.
-This function returns the filter coefficients of a modified Bartlett Hann window of length m supplied as input, to the output vector y.
w=bartlett(L) returns an L-point Bartlett window in a column vector w
-Example
-w=bartlett(4)
-w =
-
0.
-0.6666667
-0.6666667
-0.
-Author
-Ankur Mallick
-References
-[1] Oppenheim, Alan V., Ronald W. Schafer, and John R. Buck. Discrete-Time Signal Processing. Upper Saddle River, NJ: Prentice Hall, 1999.
This is an Octave function.
-This function generates a Bessel filter. The default is a Laplace space (s) filter.
-The third parameter takes in high or low, the default value being low. The cutoff is pi*Wc radians.
-[z,p,g] = besself(...) returns filter as zero-pole-gain rather than coefficients of the numerator and denominator polynomials.
-[...] = besself(...,’z’) returns a discrete space (Z) filter. w must be less than 1.
-[a,b,c,d] = besself(...) returns state-space matrices.
Transform a s-plane filter specification into a z-plane specification. Filters can be specified in either zero-pole-gain or transfer function form. The input form does not have to match the output form. 1/T is the sampling frequency represented in the z plane.
-
Note: this differs from the bilinear function in the signal processing toolbox, which uses 1/T rather than T.
-
Theory: Given a piecewise flat filter design, you can transform it from the s-plane to the z-plane while maintaining the band edges by means of the bilinear transform. This maps the left hand side of the s-plane into the interior of the unit circle. The mapping is highly non-linear, so you must design your filter with band edges in the s-plane positioned at 2/T tan(w*T/2) so that they will be positioned at w after the bilinear transform is complete.
This is an Octave function.
-This function returns the input data after reversing the bits of the indices and reordering the elements of the input array.
w=blackman(N) returns an N-point symmetric Blackman window in a column vector w
-w=blackman(N,sflag)
-Returns an N point Blackman window using the type of sampling specified by sflag
-sflag can be either 'symmetric' (default) or 'periodic' (used in spectral analysis)
-Example
-w=blackman(4)
-w =
-
- 1.388D-17
-0.63
-0.63
-- 1.388D-17
-Author
-Ankur Mallick
-References
-[1] Oppenheim, Alan V., Ronald W. Schafer, and John R. Buck. Discrete-Time Signal Processing. Upper Saddle River, NJ: Prentice Hall, 1999.
This function returns the filter coefficients of a Blackman-Harris window.
-
-
-
Calling Sequence
-
w = blackmanharris (m)
-w = blackmanharris (m, opt)
-
-
Parameters
-
m:
-
positive integer value
-
opt:
-
string value, takes "periodic" or "symmetric"
-
w:
-
output variable, vector of real numbers
-
-
Description
-
This is an Octave function.
-This function returns the filter coefficients of a Blackman-Harris window of length m supplied as input, to the output vector w.
-The second parameter can take the values "periodic" or "symmetric", depending on which the corresponding form of window is returned. The default is symmetric.
This function returns the filter coefficients of a rectangular window.
-
-
-
Calling Sequence
-
y = boxcar (m)
-
-
Parameters
-
m:
-
positive integer value
-
y:
-
output variable, vector of real numbers
-
-
Description
-
This is an Octave function.
-This function returns the filter coefficients of a rectangular window of length m supplied as input, to the output vector y.
This is an Octave function.
-This function generates a Butterworth filter. Default is a discrete space (Z) filter.
-The third parameter takes in low or high, default value is low. The cutoff is pi*Wc radians.
-[b,a] = butter(n, [Wl, Wh]) indicates a band pass filter with edges pi*Wl and pi*Wh radians.
-[b,a] = butter(n, [Wl, Wh], ’stop’) indicates a band reject filter with edges pi*Wl and pi*Wh radians.
-[z,p,g] = butter(...) returns filter as zero-pole-gain rather than coefficients of the numerator and denominator polynomials.
-[...] = butter(...,’s’) returns a Laplace space filter, w can be larger than 1.
-[a,b,c,d] = butter(...) returns state-space matrices.
scalar or vector of length 2, elements must be in the range [0,1]
-
Rp:
-
real or complex value
-
Rs:
-
real or complex value
-
-
Description
-
This is an Octave function.
-This function computes the minimum filter order of a Butterworth filter with the desired response characteristics.
-The filter frequency band edges are specified by the passband frequency wp and stopband frequency ws.
-Frequencies are normalized to the Nyquist frequency in the range [0,1].
-Rp is measured in decibels and is the allowable passband ripple, and Rs is also in decibels and is the minimum attenuation in the stop band.
-If ws>wp, the filter is a low pass filter. If wp>ws, the filter is a high pass filter.
-If wp and ws are vectors of length 2, then the passband interval is defined by wp the stopband interval is defined by ws.
-If wp is contained within the lower and upper limits of ws, the filter is a band-pass filter. If ws is contained within the lower and upper limits of wp the filter is a band-stop or band-reject filter.
This function return the complex cepstrum of the vector x. If the optional argument correct has the value 1, a correction method is applied. The default is not to do this.
Converts a cell array to a second order section matrix
-
-
-
Parameters
-
-
-
Description
-
s=cell2sos(c) converts a a cell array c = { {B1},{A1}, {B2},{A2}, ... {BL},{AL}}
-to an L-by-6 second-order-section matrix s given by:
-s = [B1 A1
-B2 A2
-...
-BL AL]
-numerator vector Bi and denominator vector Ai contains the coefficients of a
-linear or quadratic polynomial. If the polynomial is linear, the coefficients
-zero-padded on the right.
-[s,g]=cell2sos(c) estimates the gain from the leading term of the cell array
-c={ {[g1,g2]},{B1},{A1}, {B2},{A2}, ... {BL},{AL}} to give g=g1/g2 as the gain
-Example
-c=cell(1,5);
scalar or vector of length 2, all elements must be in the range [0,1]
-
Ws:
-
scalar or vector of length 2, all elements must be in the range [0,1]
-
Rp:
-
real value
-
Rs:
-
real value
-
-
Description
-
This is an Octave function.
-This function computes the minimum filter order of a Chebyshev type I filter with the desired response characteristics.
-Stopband frequency ws and passband frequency wp specify the the filter frequency band edges.
-Frequencies are normalized to the Nyquist frequency in the range [0,1].
-Rp is measured in decibels and is the allowable passband ripple and Rs is also measured in decibels and is the minimum attenuation in the stop band.
-If ws>wp then the filter is a low pass filter. If wp>ws, then the filter is a high pass filter.
-If wp and ws are vectors of length 2, then the passband interval is defined by wp and the stopband interval is defined by ws.
-If wp is contained within the lower and upper limits of ws, the filter is a band-pass filter. If ws is contained within the lower and upper limits of wp, the filter is a band-stop or band-reject filter.
scalar or vector of length 2, all elements must be in the range [0,1]
-
Ws:
-
scalar or vector of length 2, all elements must be in the range [0,1]
-
Rp:
-
real value
-
Rs:
-
real value
-
-
Description
-
This is an Octave function.
-This function computes the minimum filter order of a Chebyshev type II filter with the desired response characteristics.
-Stopband frequency ws and passband frequency wp specify the the filter frequency band edges.
-Frequencies are normalized to the Nyquist frequency in the range [0,1].
-Rp is measured in decibels and is the allowable passband ripple and Rs is also measured in decibels and is the minimum attenuation in the stop band.
-If ws>wp then the filter is a low pass filter. If wp>ws, then the filter is a high pass filter.
-If wp and ws are vectors of length 2, then the passband interval is defined by wp and the stopband interval is defined by ws.
-If wp is contained within the lower and upper limits of ws, the filter is a band-pass filter. If ws is contained within the lower and upper limits of wp, the filter is a band-stop or band-reject filter.
This function returns the filter coefficients of a Dolph-Chebyshev window.
-
-
-
Calling Sequence
-
w = chebwin (m)
-w = chebwin (m, at)
-
-
Parameters
-
m:
-
positive integer value
-
at:
-
real scalar value
-
w:
-
output variable, vector of real numbers
-
-
Description
-
This is an Octave function.
-This function returns the filter coefficients of a Dolph-Chebyshev window of length m supplied as input, to the output vector w.
-The second parameter is the stop band attenuation of the Fourier transform in dB. The default value is 100 dB.
This is an Octave function.
-This function generates a Chebyshev type I filter with rp dB of passband ripple.
-The fourth parameter takes in high or low, default value is low. The cutoff is pi*Wc radians.
-[b, a] = cheby1(n, Rp, [Wl, Wh]) indicates a band pass filter with edges pi*Wl and pi*Wh radians.
-[b, a] = cheby1(n, Rp, [Wl, Wh], ’stop’) indicates a band reject filter with edges pi*Wl and pi*Wh radians.
-[z, p, g] = cheby1(...) returns filter as zero-pole-gain rather than coefficients of the numerator and denominator polynomials.
-[...] = cheby1(...,’s’) returns a Laplace space filter, w can be larger than 1.
-[a,b,c,d] = cheby1(...) returns state-space matrices.
This is an Octave function.
-This function generates a Chebyshev type II filter with rs dB of stopband attenuation.
-The fourth parameter takes in high or low, default value is low. The cutoff is pi*Wc radians.
-[b, a] = cheby2(n, Rp, [Wl, Wh]) indicates a band pass filter with edges pi*Wl and pi*Wh radians.
-[b, a] = cheby2(n, Rp, [Wl, Wh], ’stop’) indicates a band reject filter with edges pi*Wl and pi*Wh radians.
-[z, p, g] = cheby2(...) returns filter as zero-pole-gain rather than coefficients of the numerator and denominator polynomials.
-[...] = cheby2(...,’s’) returns a Laplace space filter, w can be larger than 1.
-[a,b,c,d] = cheby2(...) returns state-space matrices.
string value, takes in "linear", "quadratic", "logarithmic"
-
phse:
-
-
-
Description
-
This is an Octave function.
-This function evaluates a chirp signal at time t. A chirp signal is a frequency swept cosine wave.
-The first argument is a vector of times to evaluate the chirp signal, second argument is the frequency at t=0, third argument is time t1 and fourth argument is frequency at t1.
-The fifth argument is the form which takes in values "linear", "quadratic" and "logarithmic", the sixth argument gives the phase shift at t=0.
degree of cosine polynomial, i.e. the number of output coefficients will be m*2+1
-
w1 and w2:
-
bandpass filter cutoffs in the range 0 <= w1 < w2 <= pi, where pi is the Nyquist frequency
-
up:
-
vector of 3 upper bounds for [stopband1, passband, stopband2]
-
lo:
-
vector of 3 lower bounds for [stopband1, passband, stopband2]
-
gridsize:
-
search grid size; larger values may improve accuracy, but greatly increase calculation time.
-
-
Description
-
This is an Octave function.
-Constrained L2 bandpass FIR filter design. Compared to remez, it offers implicit specification of transition bands, a higher likelihood of convergence, and an error criterion combining features of both L2 and Chebyshev approaches.
This function calculates boundary indexes of clusters of 1’s.
-
-
-
Calling Sequence
-
c = clustersegment(s)
-
-
Parameters
-
s:
-
scalar, vector or matrix of real numbers (clusters of 1s)
-
c:
-
output variable, cell array of size 1 by N, where N is the number of rows in s
-
-
Description
-
This is an Octave function.
-This function calculates boundary indexes of clusters of 1’s.
-This function calculates the initial and end indices of the sequences of 1's present in the input argument.
-The output variable c is a cell array of size 1 by N, where N is the number of rows in s and each element has two rows indicating the initial index and end index of the cluster of 1's respectively. The indexing starts from 1.
[real vector] of window-function values between 0 and 1; the data segment has the same length as the window. Default window shape is Hamming. [integer scalar] length of each data segment. The default value is window=sqrt(length(x)) rounded up to the nearest integer power of 2; see 'sloppy' argument.
-
overlap:
-
[real scalar] segment overlap expressed as a multiple of window or segment length. 0 <= overlap < 1, The default is overlap=0.5 .
-
Nfft:
-
[integer scalar] Length of FFT. The default is the length of the "window" vector or has the same value as the scalar "window" argument. If Nfft is larger than the segment length, "seg_len", the data segment is padded with "Nfft-seg_len" zeros. The default is no padding. Nfft values smaller than the length of the data segment (or window) are ignored silently.
-
Fs:
-
[real scalar] sampling frequency (Hertz); default=1.0
-
range:
-
'half', 'onesided' : frequency range of the spectrum is zero up to but not including Fs/2. Power from negative frequencies is added to the positive side of the spectrum, but not at zero or Nyquist (Fs/2) frequencies. This keeps power equal in time and spectral domains. See reference [2]. 'whole', 'twosided' : frequency range of the spectrum is-Fs/2 to Fs/2, with negative frequenciesstored in "wrap around" order after the positivefrequencies; e.g. frequencies for a 10-point 'twosided'spectrum are 0 0.1 0.2 0.3 0.4 0.5 -0.4 -0.3 -0.2 -0.1 'shift', 'centerdc' : same as 'whole' but with the first half of the spectrum swapped with second half to put the zero-frequency value in the middle. (See "help fftshift". If data (x and y) are real, the default range is 'half', otherwise default range is 'whole'.
-
plot_type:
-
'plot', 'semilogx', 'semilogy', 'loglog', 'squared' or 'db': specifies the type of plot. The default is 'plot', which means linear-linear axes. 'squared' is the same as 'plot'. 'dB' plots "10*log10(psd)". This argument is ignored and a spectrum is not plotted if the caller requires a returned value.
-
detrends:
-
'no-strip', 'none' -- do NOT remove mean value from the data'short', 'mean' -- remove the mean value of each segment from each segment of the data. 'linear',-- remove linear trend from each segment of the data.'long-mean'-- remove the mean value from the data before splitting it into segments. This is the default.
-
-
Description
-
Estimate (mean square) coherence of signals "x" and "y".
input vector of size N for which correlation matrix of size m is to be calculated
-
m:
-
size of correlation matrix to be computed. Positive integer strictly smaller than the length of the input x
-
X:
-
data matrix as specified according to the input 'method'
-
s:
-
method for type of output matrix X
-
'autocorrelation':
-
(default) X is the (n + m)-by-(m + 1) rectangular Toeplitz matrix that generates an autocorrelation estimate for the leng th-n data vector x, derived using prewindowed and postwindowed data, based on an mth-order prediction error model.
-
'prewindowed':
-
X is the n-by-(m + 1) rectangular Toeplitz matrix that generates an autocorrelation estimate for the length-n data vector x, derived using prewindowed data, based on an mth-order prediction error model.
-
'postwindowed':
-
X is the n-by-(m + 1) rectangular Toeplitz matrix that generates an autocorrelation estimate for the length-n data vector x , derived using postwindowed data, based on an mth-order prediction error model.
-
'covariance':
-
X is the (n – m)-by-(m + 1) rectangular Toeplitz matrix that generates an autocorrelation estimate for the length-n data vect or x, derived using nonwindowed data, based on an mth-order prediction error model.
-
'modified':
-
X is the 2(n – m)-by-(m + 1) modified rectangular Toeplitz matrix that generates an autocorrelation estimate for the length-n d ata vector x, derived using forward and backward prediction error estimates, based on an mth-order prediction error model.
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.
czt (x)
-czt (x, m)
-czt (x, m, w)
-czt (x, m, w, a)
-
-
Parameters
-
x:
-
Input scalar or vector
-
m:
-
Total Number of steps
-
w:
-
ratio between points in each step
-
a:
-
point in the complex plane
-
-
Description
-
This is an Octave function.
-Chirp z-transform. Compute the frequency response starting at a and stepping by w for m steps. a is a point in the complex plane, and w is the ratio between points in each step (i.e., radius increases exponentially, and angle increases linearly).
This is an Octave function
-dctmtx(n) returns a Discrete cosine transform matrix of order n-by-n. It is useful for jpeg image compression. D*A is the DCT of the columns of A and D'*A is the inverse DCT of the columns of A (when A is n-by-n).
This function removes the best fit of a polynomial of order P from the data X
-
-
-
Calling Sequence
-
detrend1(X,P)
-
-
Parameters
-
X:
-
Input vecor or matrix.
-
P:
-
The order of polnomial
-
-
Description
-
If X is a vector, 'detrend1(X, P)' removes the best fit of apolynomial of order P from the data X.If X is a matrix, 'detrend1(X, P)' does the same for each column in X.
-
The second argument P is optional. If it is not specified, a value of 1 is assumed. This corresponds to removing a linear trend.
-The order of the polynomial can also be given as a string, in which case P must be either "constant" (corresponds to 'P=0') or "linear"(corresponds to 'P=1')
This is an Octave function
-This fuction gives a complex matrix of values whose product with a vector produces the discrete Fourier transform. This can also be achieved by directly using the fft function i.e. y=fft(x) is same as y=A*x where A=dftmtx(n).
Return the estimator D for the differencing parameter of an integrated time series
-
-
-
Calling Sequence
-
[D, DD] = diffpara (X)
-[D, DD] = diffpara (X, A)
-[D, DD] = diffpara (X, A, B)
-
-
Parameters
-
X:
-
Input scalar or vector.
-
DD:
-
The estimators for all frequencies in the intervals described above.
-
D:
-
The mean of DD
-
-
Description
-
Return the estimator D for the differencing parameter of an integrated time series.
-
The frequencies from [2*pi*a/t, 2*pi*b/T] are used for the estimation. If B is omitted, the interval [2*pi/T, 2*pi*a/T] is used. If both B and A are omitted then a = 0.5 * sqrt (T) and b = 1.5 * sqrt (T) is used, where T is the sample size. If X is a matrix, the differencing parameter of each column is estimated.
-
The estimators for all frequencies in the intervals described above is returned in DD.
This function downsamples the signal by selecting every nth element.
-
-
-
Calling Sequence
-
y = downsample (x, n)
-y = downsample (x, n, phase)
-
-
Parameters
-
x:
-
scalar, vector or matrix of real or complex numbers
-
n:
-
real number or vector
-
phase:
-
integer value, 0 <= phase <= (n - 1), default value 0, or logical
-
-
Description
-
This is an Octave function.
-This function downsamples the signal by selecting every nth element supplied as parameter 2. If x is a matrix, the function downsamples every column.
-If the phase is specified, every nth element is selected starting from the sample phase. The default phase is 0.
This is an Octave function.
-Computes the type I discrete sine transform of x. If n is given, then x is padded or trimmed to length n before computing the transform. If x is a matrix, compute the transform along the columns of the the matrix.
The vector C specifies the autocovariances '[gamma_0, ..., gamma_t]' from lag 0 to T.
-
OLDPHI:
-
It specifies the coefficients based on C(T-1).
-
OLDV:
-
It specifies the corresponding error.
-
-
Description
-
This is an Octave function.
-Perform one step of the Durbin-Levinson.
-If OLDPHI and OLDV are omitted, all steps from 1 to T of the algorithm are performed.
scalar or vector, all elements should be in the range [0,1]
-
-
Description
-
This is an Octave function.
-This function generates an elliptic or Cauer filter with rp dB of passband ripple and rs dB of stopband attenuation.
-[b, a] = ellip(n, Rp, Rs, Wp) indicates low pass filter with order n, Rp decibels of ripple in the passband and a stopband Rs decibels down and cutoff of pi*Wp radians. If the fifth argument is high, then the filter is a high pass filter.
-[b, a] = ellip(n, Rp, Rs, [Wl, Wh]) indictaes band pass filter with band pass edges pi*Wl and pi*Wh. If the fifth argument is stop, the filter is a band reject filter.
-[z, p, g] = ellip(...) returns filter as zero-pole-gain.
-[...] = ellip(...,’s’) returns a Laplace space filter, w can be larger than 1.
-[a, b, c, d] = ellip(...) returns state-space matrices.
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.
scalar or vector of length 2, all elements must be in the range [0,1]
-
Ws:
-
scalar or vector of length 2, all elements must be in the range [0,1]
-
Rp:
-
real or complex value
-
Rs:
-
real or complex value
-
-
Description
-
This is an Octave function.
-This function computes the minimum filter order of an elliptic filter with the desired response characteristics.
-Stopband frequency ws and passband frequency wp specify the the filter frequency band edges.
-Frequencies are normalized to the Nyquist frequency in the range [0,1].
-Rp is measured in decibels and is the allowable passband ripple and Rs is also measured in decibels and is the minimum attenuation in the stop band.
-If ws>wp then the filter is a low pass filter. If wp>ws, then the filter is a high pass filter.
-If wp and ws are vectors of length 2, then the passband interval is defined by wp and the stopband interval is defined by ws.
-If wp is contained within the lower and upper limits of ws, the filter is a band-pass filter. If ws is contained within the lower and upper limits of wp, the filter is a band-stop or band-reject filter.
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.
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.
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.
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.
Convolve two vectors using the FFT for computation.
-
-
-
Calling Sequence
-
Y = fftconv(X, Y)
-Y = fftconv(X, Y, N)
-
-
Parameters
-
X, Y:
-
Vectors
-
-
Description
-
Convolve two vectors using the FFT for computation. 'c' = fftconv (X, Y)' returns a vector of length equal to 'length(X) + length (Y) - 1'. If X and Y are the coefficient vectors of two polynomials, the returned value is the coefficient vector of the product polynomial.
Performs FFT-based FIR filtering using overlap-add method
-
-
-
Calling Sequence
-
-
-
Parameters
-
x:
-
real|complex numbers - vector|matrix
-
b:
-
real|complex numbers - vector|matrix
-
n:
-
positive integer
-
-
Description
-
y = fftfilt(b,x) filters the data in vector x with the filter described
-by coefficient vector b.
-y = fftfilt(b,x,n) uses n to determine the length of the FFT.
This function computes the N-dimensional discrete Fourier transform of A using a Fast Fourier Transform (FFT) algorithm.
-
-
-
Calling Sequence
-
Y = fftn(A)
-Y = fftn(A, size)
-
-
Parameters
-
A:
-
Matrix
-
-
Description
-
This function computes the N-dimensional discrete Fourier transform of A using a Fast Fourier Transform (FFT) algorithm. The optional vector argument SIZE may be used specify the dimensions of the array to be used. If an element of SIZE is smaller than the corresponding dimension of A, then the dimension of A is truncated prior to performing the FFT. Otherwise, if an element of SIZE is larger than the corresponding dimension then A is resized and padded with zeros.
Perform a shift of the vector X, for use with the 'fft1' and 'ifft1' functions, in order the move the frequency 0 to the center of the vector or matrix.
-
-
-
Calling Sequence
-
fftshift1 (X)
-fftshift1 (X, DIM)
-
-
Parameters
-
X:
-
It is a vector of N elements corresponding to time samples
-
DIM:
-
The optional DIM argument can be used to limit the dimension along which the permutation occurs
-
-
Description
-
This is an Octave function.
-Perform a shift of the vector X, for use with the 'fft1' and 'ifft1' functions, in order the move the frequency 0 to the center of the vector or matrix.
-
If X is a vector of N elements corresponding to N time samples spaced by dt, then 'fftshift1 (fft1 (X))' corresponds to frequencies
-
f = [ -(ceil((N-1)/2):-1:1)*df 0 (1:floor((N-1)/2))*df ]
-
where df = 1 / dt.
-
If X is a matrix, the same holds for rows and columns. If X is an array, then the same holds along each dimension.
-
The optional DIM argument can be used to limit the dimension along
This is an Octave function.
-Wisdom data can be used to significantly accelerate the calculation of the FFTs, but implies an initial cost in its calculation. When the FFTW libraries are initialized, they read a system wide wisdom
-file (typically in /etc/fftw/wisdom), allowing wisdom to be shared between applications other than Octave. Alternatively, the fftw function can be used to import wisdom. For example,
-
wisdom = fftw ("dwisdom")
-will save the existing wisdom used by Octave to the string wisdom. This string can then be saved to a file and restored using the save and load commands respectively. This existing wisdom can be re
-imported as follows
-
fftw ("dwisdom", wisdom)
-If wisdom is an empty string, then the wisdom used is cleared.
-
During the calculation of Fourier transforms further wisdom is generated. The fashion in which this wisdom is generated is also controlled by the fftw function. There are five different manners in which
-the wisdom can be treated:
-
"estimate"
-Specifies that no run-time measurement of the optimal means of calculating a particular is performed, and a simple heuristic is used to pick a (probably sub-optimal) plan. The advantage of this method
-is that there is little or no overhead in the generation of the plan, which is appropriate for a Fourier transform that will be calculated once.
-
"measure"
-In this case a range of algorithms to perform the transform is considered and the best is selected based on their execution time.
-
"patient"
-Similar to "measure", but a wider range of algorithms is considered.
-
"exhaustive"
-Like "measure", but all possible algorithms that may be used to treat the transform are considered.
-
"hybrid"
-As run-time measurement of the algorithm can be expensive, this is a compromise where "measure" is used for transforms up to the size of 8192 and beyond that the "estimate" method is used.
-
The default method is "estimate". The current method can be queried with
The Function calculates the Fast Hartley Transform of real input.
-
-
-
Calling Sequence
-
M = fht (D)
-M = fht (D, N)
-M = fht (D, N, DIM)
-
-
Parameters
-
-
-
Description
-
This function calculates the Fast Hartley transform of real input D. If D is a matrix, the Hartley transform is calculated along the columns by default.
This is an Octave function
-In theory, it forwards and reverse filters the signal and corrects phase distortion upto an extent by a one-pass filter but squares the magnitude response in the process. Practically though, the correction isn't perfect and magnitude response, particularly the stop band is distorted.
This function finds the initial conditions for the delays in the transposed direct-form II filter implementation.
-The vectors b and a represent the numerator and denominator coefficients of the filter's transfer function.
Peaks of a positive array of data are defined as local maxima. For double-sided data, they are maxima of the positive part and minima of the negative part. DATA is expected to be a single column vector.
-
The function returns the value of DATA at the peaks in PKS. The index indicating their position is returned in LOC.
-
The third output argument is a structure with additional information:
-
"parabol":
-A structure containing the parabola fitted to each returned peak. The structure has two fields, "x" and "pp". The field "pp" contains the coefficients of the 2nd degree polynomial and "x" the extrema of the intercal here it was fitted.
-
"height":
-The estimated height of the returned peaks (in units of DATA).
-
"baseline":
-The height at which the roots of the returned peaks were calculated (in units of DATA).
-
"roots":
-The abscissa values (in index units) at which the parabola fitted to each of the returned peaks crosses the "baseline" value. The width of the peak is calculated by 'diff(roots)'.
-
This function accepts property-value pair given in the list below:
-
"MinPeakHeight":
-Minimum peak height (positive scalar). Only peaks that exceed this value will be returned. For data taking positive and negative values use the option "DoubleSided". Default value '2*std (abs (detrend (data,0)))'.
-
"MinPeakDistance":
-Minimum separation between (positive integer). Peaks separated by less than this distance are considered a single peak. This distance is also used to fit a second order polynomial to the peaks to estimate their width, therefore it acts as a smoothing parameter. Default value 4.
-
"MinPeakWidth":
-Minimum width of peaks (positive integer). The width of the peaks is estimated using a parabola fitted to the neighborhood of each peak. The neighborhood size is equal to the value of "MinPeakDistance". The width is evaluated at the half height of the peak with baseline at "MinPeakHeight". Default value 2.
-
"DoubleSided":
-Tells the function that data takes positive and negative values. The base-line for the peaks is taken as the mean value of the function. This is equivalent as passing the absolute value of the data after removing the mean.
Produce an order N FIR filter with the given frequency cutoff W, returning the N+1 filter coefficients in B. If W is a scalar, it specifies the frequency cutoff for a lowpass or highpass filter. If W is a two-element vector, the two values specify the edges of a bandpass or bandstop filter. If W is an N-element vector, each value specifies a band edge of a multiband pass/stop filter.
-
The filter TYPE can be specified with one of the following strings: "low", "high", "stop", "pass", "bandpass", "DC-0", or "DC-1". The default is "low" is W is a scalar, "pass" if W is a pair, or "DC-0" if W is a vector with more than 2 elements.
-
An optional shaping WINDOW can be given as a vector with length N+1. If not specified, a Hamming window of length N+1 is used.
-
With the option "noscale", the filter coefficients are not normalized. The default is to normalize the filter such that the magnitude response of the center of the first passband is 1.
Produce an order N FIR filter with arbitrary frequency response M over frequency bands F, returning the N+1 filter coefficients in B.
-
-
-
Calling Sequence
-
B = fir2(N, F, M)
-B = fir2(N, F, M, GRID_N)
-B = fir1(N, F, M, GRID_N, RAMP_N)
-B = fir1(N, F, M, GRID_N, RAMP_N, WINDOW)
-
-
Parameters
-
N:
-
Integer
-
F, M:
-
Vector
-
-
Description
-
Produce an order N FIR filter with arbitrary frequency response M over frequency bands F, returning the N+1 filter coefficients in B. The vector F specifies the frequency band edges of the filter response and M specifies the magnitude response at each frequency.
-
The vector F must be nondecreasing over the range [0,1], and the first and last elements must be 0 and 1, respectively. A discontinuous jump in the frequency response can be specified by duplicating a band edge in F with different values in M.
-
The resolution over which the frequency response is evaluated can be controlled with the GRID_N argument. The default is 512 or the next larger power of 2 greater than the filter length.
-
The band transition width for discontinuities can be controlled with the RAMP_N argument. The default is GRID_N/25. Larger values will result in wider band transitions but better stopband rejection.
-
An optional shaping WINDOW can be given as a vector with length N+1. If not specified, a Hamming window of length N+1 is used.
Parks-McClennan optimal FIR filter order estimation
-
-
-
Calling Sequence
-
-
-
Parameters
-
f:
-
double - positive - vector
-
a:
-
double - positive - vector
-
dev:
-
double - positive - vector
-
n:
-
int - scalar
-
fo:
-
double - positive - vector
-
ao:
-
double - positive - vector
-
w:
-
double - vector
-
-
Examples
-
[1]Alow-passfilter
-f=[15002000];// frequency edges for bands
-a=[10];// desired amplitude for each band
-dev=[0.010.1];// Acceptable deviation for each band
-fs=8000;// Sampling frequency
-[n,fo,ao,w]=firpmord(f,a,dev,fs);
-
-[2]Abandstopfilter
-f=[1000180024003000];
-a=[100.5];
-dev=[0.010.10.03];
-fs=8000;
-[n,fo,ao,w]=firpmord(f,a,dev,fs);
-
-References
-[1]Rabiner,LawrenceR.,andBernardGold."Theoryandapplicationof
-digitalsignalprocessing." Englewood Cliffs, NJ, Prentice-Hall, Inc.,
-1975.777p.156-7(1975).
-[2]Rabiner,LawrenceR.,andOttoHerrmann."Thepredictabilityofcertain
-optimumfinite-impulse-responsedigitalfilters." Circuit Theory,
-IEEETransactionson20.4(1973):401-408.
This function returns the filter coefficients of a Flat Top window.
-
-
-
Calling Sequence
-
w = flattopwin (m)
-w = flattopwin (m, opt)
-
-
Parameters
-
m:
-
positive integer value
-
opt:
-
string value, takes in "periodic" or "symmetric"
-
w:
-
output variable, vector of real numbers
-
-
Description
-
This is an Octave function.
-This function returns the filter coefficients of a Flat Top window of length m supplied as input, to the output vector w.
-The second parameter can take the values "periodic" or "symmetric", depending on which the corresponding form of window is returned. The default is symmetric.
-This window has low pass-band ripple but a high bandwidth.
This is an Octave function.
-This function shifts the series x supplied as input argument by a number of samples d.
-The third parameter is the interpolator, which is designed with a Kaiser-windowed sinecard by default, if not supplied.
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.
This function returns the complex frequency response H of the rational IIR filter whose numerator and denominator coefficients are B and A, respectively.
-
-
-
Calling Sequence
-
[H, W] = freqz(B, A, N, "whole")
-[H, W] = freqz(B)
-[H, W] = freqz(B, A)
-[H, W] = freqz(B, A, N)
-H = freqz(B, A, W)
-[H, W] = freqz(..., FS)
-freqz(...)
-
-
Parameters
-
B, A, N:
-
Integer or Vector
-
-
Description
-
Return the complex frequency response H of the rational IIR filter whose numerator and denominator coefficients are B and A, respectively.
-
The response is evaluated at N angular frequencies between 0 and 2*pi.
-
The output value W is a vector of the frequencies.
-
If A is omitted, the denominator is assumed to be 1 (this corresponds to a simple FIR filter).
-
If N is omitted, a value of 512 is assumed. For fastest computation, N should factor into a small number of small primes.
-
If the fourth argument, "whole", is omitted the response is evaluated at frequencies between 0 and pi.
-
'freqz (B, A, W)'
-
Evaluate the response at the specific frequencies in the vector W. The values for W are measured in radians.
-
'[...] = freqz (..., FS)'
-
Return frequencies in Hz instead of radians assuming a sampling rate FS. If you are evaluating the response at specific frequencies W, those frequencies should be requested in Hz rather than radians.
-
'freqz (...)'
-
Plot the magnitude and phase response of H rather than returning them.
Compute the Walsh-Hadamard transform of x using the Fast Walsh-Hadamard Transform (FWHT) algorithm
-
-
-
Calling Sequence
-
fwht (x)
-fwht (x, n)
-fwht (x, n, order)
-
-
Parameters
-
x:
-
real or complex valued scalar or vector
-
n:
-
x is truncated or extended to have length n
-
order:
-
Specification of order in which coefficients should be arranged
-
-
Description
-
Compute the Walsh-Hadamard transform of x using the Fast Walsh-Hadamard Transform (FWHT) algorithm. If the input is a matrix, the FWHT is calculated along the columns of x.
-
The number of elements of x must be a power of 2; if not, the input will be extended and filled with zeros. If a second argument is given, the input is truncated or extended to have length n.
-
The third argument specifies the order in which the returned Walsh-Hadamard transform coefficients should be arranged. The order may be any of the following strings:
-
"sequency"
-The coefficients are returned in sequency order. This is the default if order is not given.
-
"hadamard"
-The coefficients are returned in Hadamard order.
-
"dyadic"
-The coefficients are returned in Gray code order.
This function returns a Gaussian convolution window.
-
-
-
Calling Sequence
-
w = gaussian (m)
-w = gaussian (m, a)
-
-
Parameters
-
m:
-
positive integer value
-
a:
-
-
w:
-
output variable, vector of real numbers
-
-
Description
-
This is an Octave function.
-This function returns a Gaussian convolution window of length m supplied as input, to the output vector w.
-The second parameter is the width measured in sample rate/number of samples and should be f for time domain and 1/f for frequency domain. The width is inversely proportional to a.
This function returns the filter coefficients of a Gaussian window.
-
-
-
Calling Sequence
-
w = gausswin (m)
-w = gausswin (m, a)
-
-
Parameters
-
m:
-
positive integer value
-
a:
-
-
w:
-
output variable, vector of real numbers
-
-
Description
-
This is an Octave function.
-This function returns the filter coefficients of a Gaussian window of length m supplied as input, to the output vector w.
-The second parameter is the width measured in sample rate/number of samples and should be f for time domain and 1/f for frequency domain. The width is inversely proportional to a.
Computes DFT using the second order Goertzel Algorithm
-
-
-
Calling Sequence
-
Y = goertzel(X,INDVEC,DIM)
-
-
Parameters
-
-
-
Description
-
goertzel(X,INDVEC)
-Computes the DFT of X at indices INDVEC using the second order algorithm along
-the first non-singleton dimension. Elements of INDVEC must be positive integers
-less than the length of the first non-singleton dimension. If INDVEC is empty
-the DFT is computed at all indices along the first non-singleton dimension
-goertzel(X,INDVEC,DIM)
-Implements the algorithm along dimension DIM
-In general goertzel is slower than fft when computing the DFT for all indices
-along a particular dimension. However it is computationally more efficient when
-the DFT at only a subset of indices is desired
-Example
-x=rand(1,5)
-x =
real scalar, which will be the length of hamming window
-
-
Description
-
Return the filter coefficients of a Hamming window of length M.
-If the optional argument "periodic" is given, the periodic form of the window is returned. This is equivalent to the window of length M+1 with the last coefficient removed. The optional argument "symmetric" is equivalent to not specifying a second argument.
This is an Octave function.
-This function returns the filter coefficients of a Hanning window of length m supplied as input, to the output vector w.
-The second parameter can take the values "periodic" or "symmetric", depending on which the corresponding form of window is returned. The default is symmetric.
real scalar, which will be the length of hanning window
-
-
Description
-
Return the filter coefficients of a Hanning window of length M.
-If the optional argument "periodic" is given, the periodic form of the window is returned. This is equivalent to the window of length M+1 with the last coefficient removed. The optional argument "symmetric" is equivalent to not specifying a second argument.
h = hilbert1 (f) computes the extension of the real valued signal f to an analytic signal. If f is a matrix, the transformation is applied to each column. For N-D arrays, the transformation is applied to the first non-singleton dimension.
-
real (h) contains the original signal f. imag (h) contains the Hilbert transform of f.
-
hilbert1 (f, N) does the same using a length N Hilbert transform. The result will also have length N.
-
hilbert1 (f, [], dim) or hilbert1 (f, N, dim) does the same along dimension dim.
Compute the inverse discrete cosine transform of input.
-
-
-
Calling Sequence
-
Y = idct1(X)
-Y = idct1(X, N)
-
-
Parameters
-
X:
-
Matrix or integer
-
N:
-
If N is given, then X is padded or trimmed to length N before computing the transform.
-
-
Description
-
This function computes the inverse discrete cosine transform of input X. If N is given, then X is padded or trimmed to length N before computing the transform. If X is a matrix, compute the transform along the columns of the the matrix. The transform is faster if X is real-valued and even length.
This function computes the inverse 2-D discrete cosine transform of input matrix.
-
-
-
Calling Sequence
-
Y = idct2(X)
-Y = idct2(X, M, N)
-Y = idct2(X, [M, N])
-
-
Parameters
-
X:
-
Matrix or integer
-
M, N:
-
If specified Matrix X is padded with M rows and N columns.
-
-
Description
-
This function computes the inverse 2-D discrete cosine transform of matrix X. If M and N are specified, the input is either padded or truncated to have M rows and N columns.
This function computes the inverse type I discrete sine transform.
-
-
-
Calling Sequence
-
Y = idst(X)
-Y = idst(X, N)
-
-
Parameters
-
X:
-
Matrix or integer
-
N:
-
If N is given, then X is padded or trimmed to length N before computing the transform.
-
-
Description
-
This function computes the inverse type I discrete sine transform of Y. If N is given, then Y is padded or trimmed to length N before computing the transform. If Y is a matrix, compute the transform along the columns of the the matrix.
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.
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.
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.
Compute the inverse N-dimensional discrete Fourier transform of A using a Fast Fourier Transform (FFT) algorithm.
-
-
-
Calling Sequence
-
Y = ifftn(A)
-Y = ifftn(A, size)
-
-
Parameters
-
A:
-
Matrix
-
-
Description
-
Compute the inverse N-dimensional discrete Fourier transform of A using a Fast Fourier Transform (FFT) algorithm. The optional vector argument SIZE may be used specify the dimensions of the array to be used. If an element of SIZE is smaller than the corresponding dimension of A, then the dimension of A is truncated prior to performing the inverse FFT. Otherwise, if an element of SIZE is larger than the corresponding dimension then A is resized and padded with zeros.
Calculate the inverse Fast Hartley Transform of real input D
-
-
-
Calling Sequence
-
m= ifht (d)
-m= ifht (d,n)
-m= ifht (d,n,dim)
-
-
Parameters
-
d:
-
real or complex valued scalar or vector
-
n:
-
Similar to the options of FFT function
-
dim:
-
Similar to the options of FFT function
-
-
Description
-
Calculate the inverse Fast Hartley Transform of real input d. If d is a matrix, the inverse Hartley transform is calculated along the columns by default. The options n and dim are similar to the options of FFT function.
-
The forward and inverse Hartley transforms are the same (except for a scale factor of 1/N for the inverse hartley transform), but implemented using different functions.
-
The definition of the forward hartley transform for vector d, m[K] = 1/N \sum_{i=0}^{N-1} d[i]*(cos[K*2*pi*i/N] + sin[K*2*pi*i/N]), for 0 <= K < N. m[K] = 1/N \sum_{i=0}^{N-1} d[i]*CAS[K*i], for 0 <= K < N.
Compute the inverse Walsh-Hadamard transform of x using the Fast Walsh-Hadamard Transform (FWHT) algorithm
-
-
-
Calling Sequence
-
ifwht (x)
-ifwht (x, n)
-ifwht (x, n, order)
-
-
Parameters
-
x:
-
real or complex valued scalar or vector
-
n:
-
Input is truncated or extended to have a length of n
-
order:
-
Specifies the order in which the returned inverse Walsh-Hadamard transform
-
-
Description
-
Compute the inverse Walsh-Hadamard transform of x using the Fast Walsh-Hadamard Transform (FWHT) algorithm. If the input is a matrix, the inverse FWHT is calculated along the columns of x.
-The number of elements of x must be a power of 2; if not, the input will be extended and filled with zeros. If a second argument is given, the input is truncated or extended to have length n.
-The third argument specifies the order in which the returned inverse Walsh-Hadamard transform coefficients should be arranged. The order may be any of the following strings:
-
"sequency"
-The coefficients are returned in sequency order. This is the default if order is not given.
-
"hadamard"
-The coefficients are returned in Hadamard order.
-
"dyadic"
-The coefficients are returned in Gray code order.
This function does IIR Low Pass Filter to Multiband Filter Transformation.
-
-
-
Calling Sequence
-
[Num, Den, AllpassNum, AllpassDen] = iirlp2mb(B, A, Wo, Wt)
-[Num, Den, AllpassNum, AllpassDen] = iirlp2mb(B, A, Wo, Wt, Pass)
-
-
Parameters
-
B:
-
real or complex value
-
A:
-
real or complex value
-
Wo:
-
scalar or vector
-
Wt:
-
scalar or vector, elements must be monotonically increasing and >= 0 and <= 1.
-
-
Description
-
This is an Octave function.
-This function does IIR Low Pass Filter to Multiband Filter Transformation.
-The first two parameters give the numerator and denominator of the prototype low pass filter.
-The third parameter is the normalized angular frequency/pi to be transformed.
-The fourth parameter is the normalized angular frequency/pi target vector.
-The first two output variables are the numerator and denominator of the transformed filter.
-The third and fourth output variables are the numerator and denominator of the allpass transform.
-The fifth parameter can have values pass or stop, default value is pass.
This function converts analog filter with coefficients b and a to digital, conserving impulse response.
-
-
-
Calling Sequence
-
[b, a] = impinvar (b, a)
-[b, a] = impinvar (b, a, fs)
-[b, a] = impinvar (b, a, fs, tol)
-
-
Parameters
-
b:
-
real or complex valued scalar or vector
-
a:
-
real or complex valued scalar or vector, order should be greater than b
-
fs:
-
real or complex value, default value 1Hz
-
tol:
-
real or complex value, default value 0.0001
-
-
Description
-
This is an Octave function.
-This function converts analog filter with coefficients b and a to digital, conserving impulse response.
-This function does the inverse of impinvar.
aryule — This function fits an AR (p)-model with Yule-Walker estimates.
-
-
-
-
-
-
autoreg_matrix — Given a time series (vector) Y, return a matrix with ones in the first column and the first K lagged values of Y in the other columns.
-
-
-
-
-
-
barthannwin — This function returns the filter coefficients of a modified Bartlett-Hann window.
fft — Calculates the discrete Fourier transform of a matrix using Fast Fourier Transform algorithm.
-
-
-
-
-
-
fft1 — Calculates the discrete Fourier transform of a matrix using Fast Fourier Transform algorithm.
-
-
-
-
-
-
fft2 — Calculates the two-dimensional discrete Fourier transform of A using a Fast Fourier Transform algorithm.
-
-
-
-
-
-
fft21 — Calculates the two-dimensional discrete Fourier transform of A using a Fast Fourier Transform algorithm.
-
-
-
-
-
-
fftconv — Convolve two vectors using the FFT for computation.
-
-
-
-
-
-
fftfilt — Performs FFT-based FIR filtering using overlap-add method
-
-
-
-
-
-
fftn — This function computes the N-dimensional discrete Fourier transform of A using a Fast Fourier Transform (FFT) algorithm.
-
-
-
-
-
-
fftshift1 — Perform a shift of the vector X, for use with the 'fft1' and 'ifft1' functions, in order the move the frequency 0 to the center of the vector or matrix.
flattopwin — This function returns the filter coefficients of a Flat Top window.
-
-
-
-
-
-
fracshift — This function shifts the series x supplied as input argument by a number of samples d.
-
-
-
-
-
-
fractdiff — Compute the fractional differences (1-L)^d x where L denotes the lag-operator and d is greater than -1.
-
-
-
-
-
-
freqs — Compute the s-plane frequency response of the IIR filter.
-
-
-
-
-
-
freqz — This function returns the complex frequency response H of the rational IIR filter whose numerator and denominator coefficients are B and A, respectively.
-
-
-
-
-
-
fwhm — This function computes peak full width at half minimum or at another level of peak minimum for vector or matrix data y supplied as input.
y = interp(x, q)
-y = interp(x, q, n)
-y = interp(x, q, n, Wc)
-
-
Parameters
-
x:
-
scalar or vector of complex or real numbers
-
q:
-
positive integer value, or logical
-
n:
-
positive integer, default value 4
-
Wc:
-
non decreasing vector or scalar, starting from 0 uptill 1, default value 0.5
-
-
Description
-
This is an Octave function.
-This function upsamples the signal x by a factor of q, using an order 2*q*n+1 FIR filter.
-The second argument q must be an integer. The default values of the third and fourth arguments (n, Wc) are 4 and 0.5 respectively.
desired complex frequency response,It is assumed that A and B are real polynomials, hence H is one-sided.
-
F:
-
vector of frequency samples in radians
-
nA:
-
order of denominator polynomial A
-
nB:
-
order of numerator polynomial B
-
-
Description
-
Fit filter B(z)/A(z) or B(s)/A(s) to complex frequency response at frequency points F. A and B are real polynomial coefficients of order nA and nB respectively. Optionally, the fit-errors can be weighted vs frequency according to the weights W. Also, the transform plane can be specified as either 's' for continuous time or 'z' for discrete time. 'z' is chosen by default. Eventually, Steiglitz-McBride iterations will be specified by iter and tol.
This is an Octave function.
-Fit filter B(s)/A(s)to the complex frequency response H at frequency points F. A and B are real polynomial coefficients of order nA and nB.
-Optionally, the fit-errors can be weighted vs frequency according to the weights W.
-Note: all the guts are in invfreq.m
This is an Octave function.
-Fit filter B(z)/A(z)to the complex frequency response H at frequency points F. A and B are real polynomial coefficients of order nA and nB.
-Optionally, the fit-errors can be weighted vs frequency according to the weights W.
-Note: all the guts are in invfreq.m
This function converts digital filter with coefficients b and a to analog, conserving impulse response.
-
-
-
Calling Sequence
-
[b, a] = impinvar (b, a)
-[b, a] = impinvar (b, a, fs)
-[b, a] = impinvar (b, a, fs, tol)
-
-
Parameters
-
b:
-
real or complex valued scalar or vector
-
a:
-
real or complex valued scalar or vector, order should be greater than b
-
fs:
-
real or complex value, default value 1Hz
-
tol:
-
real or complex value, default value 0.0001
-
-
Description
-
This is an Octave function.
-This function converts digital filter with coefficients b and a to analog, conserving impulse response.
-This function does the inverse of impinvar.
This function returns the filter coefficients of a Kaiser window.
-
-
-
Calling Sequence
-
w = kaiser (m)
-w = kaiser (m, beta)
-
-
Parameters
-
m:
-
positive integer value
-
beta:
-
real scalar value
-
w:
-
output variable, vector of real numbers
-
-
Description
-
This is an Octave function.
-This function returns the filter coefficients of a Kaiser window of length m supplied as input, to the output vector w.
-The second parameter gives the stop band attenuation of the Fourier transform of the window on derivation.
Return the parameters needed to produce a filter of the desired specification from a Kaiser window.
-
-
-
Calling Sequence
-
[n, Wn, beta, ftype] = kaiserord (f, m, dev, fs)
-[…] = kaiserord (f, m, dev, fs)
-[…] = kaiserord (f, m, dev)
-
-
Parameters
-
f:
-
Pairs of frequency band edges.
-
m:
-
Magnitude response for each band.
-
dev:
-
Deviation of the filter.
-
fs:
-
Sampling rate.
-
-
Description
-
This is an Octave function.
-The vector f contains pairs of frequency band edges in the range [0,1]. The vector m specifies the magnitude response for each band. The values of m must be zero for all stop bands and must have the
-same magnitude for all pass bands. The deviation of the filter dev can be specified as a scalar or a vector of the same length as m. The optional sampling rate fs can be used to indicate that f is in
-Hz in the range [0,fs/2].
-
The returned value n is the required order of the filter (the length of the filter minus 1). The vector Wn contains the band edges of the filter suitable for passing to fir1. The value beta is the
-parameter of the Kaiser window of length n+1 to shape the filter. The string ftype contains the type of filter to specify to fir1.
-
The Kaiser window parameters n and beta are computed from the relation between ripple (A=-20*log10(dev)) and transition width (dw in radians) discovered empirically by Kaiser:
-
-
/ 0.1102(A-8.7) A > 50
-beta = | 0.5842(A-21)^0.4 + 0.07886(A-21) 21 <= A <= 50
-\ 0.0 A < 21
Convert lattice filter parameters to transfer function coefficients
-
-
-
Calling Sequence
-
-
-
Description
-
[num,den] = latc2tf(k,v)
-Finds the transfer function of the IIR filter from the lattice
-coefficients k and ladder coefficients v.
-[num,den] = latc2tf(k,'iiroption')
-Finds the transfer function of the allpass or allpole (specified by
-the iiroption flag) IIR filter.
-num = latc2tf(k,'firoption')
-Finds the transfer function of the FIR filter from the lattice
-coefficients k. The firoption flag specifies the type of the FIR
-filter (can be 'min, 'max', or 'FIR')
-
Parameters:
-k - double - vector
-Lattice coefficients
-Lattice coefficients for FIR/IIR filter. Can be real or complex.
-v - double - vector
-Ladder coefficients
-Ladder coefficients for IIR filters. Can be real or complex.
-iiroption - string flag - 'allpole', or 'allpass'
-Specification of the type if IIR filter
-firoption - string flag - 'min', 'max', or 'FIR' (default)
-Speficication of the type of FIR filter
[a,g] = lpc(x,p)
-Determines the coefficients of a pth order forward linear predictor
-filter by minimizing the squared error. If p is unspecified, a
-default value of length(x)-1 is used.
This function computes the generalized Marcum Q function of order m with noncentrality parameter a and argument b.
-
-
-
Calling Sequence
-
q = marcumq (a, b)
-q = marcumq (a, b, m)
-q = marcumq (a, b, m, tol)
-
-
Parameters
-
a:
-
-
b:
-
-
m:
-
default value 1
-
tol:
-
default value eps
-
-
Description
-
This is an Octave function.
-This function computes the generalized Marcum Q function of order m with noncentrality parameter a and argument b.
-The third argument m is the order, which by default is 1.
-The fourth argument tol is the tolerance, which by default is eps.
-If input arguments are vectors which correspond in size and degree, the output is a table of values.
-This function calculates Marcum’s Q function using the infinite Bessel series, which is truncated when the relative error is less than the specified tolerance.
y = medfilt1(x)
-Applies a 3rd order 1-dimensional median filter to input x along the
-first non-zero dimension. The function appropriately pads the signal
-with zeros at the endings. For a segment, a median is calculated as
-the middle value (average of two middle values) for odd number
-number (even number) of data points.
-y = medfilt1(x,n)
-Applies a nth order 1-dimensional median filter.
-y = medfilt1(x,n,dim)
-Applies the median filter along the n-th dimension
-y = medfilt1(__, nanflag, padding)
-nanflag specifies how NaN values are treated. padding specifies the
-type of filtering to be performed at the signal edges.
-
-
-
Parameters
-
x:
-
int | double
-
n:
-
positive integer scalar
-
dim:
-
positive integer scalar
-
nanflag:
-
'includenan' (default) | 'omitnan'
-
* includenan:
-
Filtering such that the median of any segment
-
* omitnan:
-
Filtering with NaNs omitted in each segment. If a segment
[y,t]=modulate(x,fc,fs,method,opt)
-Returns the modulated vector y and the time vector 't'
-Modulation is performed according to the following table
-METHOD MODULATION SCHEME
-'am', Amplitude modulation, double side-band, suppressed carrier
-'amdsb-sc' opt not used. This is the default method.
-'amdsb-tc' Amplitude modulation, double side-band, transmitted carrier
-opt is a scalar subtracted from x before multiplying x
-with the carrier wave. It defaults to min(min(x)) so that
-the input signal after offset is always non-negative
-'amssb' Amplitude modulation, single side-band
-OPT not used.
-'fm' Frequency modulation
-opt is the constant of frequency modulation.
-opt = (fc/fs)*2*pi/max(max(abs(x))) by default
-'pm' Phase modulation
-OPT is the constant of phase modulation.
-opt = pi/max(max(abs(x))) by default
-Phase lies between -pi and +pi
-'pwm' Pulse width modulation
-opt='left' corresponds to left justified pulses.
-opt='centered' correspondes to centered pulses.
-The default value of opt is 'left'.
-'ppm' Pulse position modulation
-opt is a scalar between 0 and 1 which specifies the pulse
-width in fractions of the carrier period with default value 0.1.
-'qam' Quadrature amplitude modulation
-opt is a matrix of the same size as X which is modulated in
-quadrature with x.
-
If x is a matrix, its columns are modulated.
-Example
-y =
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).
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.
This function returns the filter coefficients of a Blackman-Harris window.
-
-
-
Calling Sequence
-
w = nuttallwin (m)
-w = nuttallwin (m, opt)
-
-
Parameters
-
m:
-
positive integer value
-
opt:
-
string value, takes in "periodic" or "symmetric"
-
w:
-
output variable, vector of real numbers
-
-
Description
-
This is an Octave function.
-This function returns the filter coefficients of a Blackman-Harris window defined by Nuttall of length m supplied as input, to the output vector w.
-The second parameter can take the values "periodic" or "symmetric", depending on which the corresponding form of window is returned. The default is symmetric.
[integer scalar] required number of poles of the AR model
-
freq:
-
[real vector] frequencies at which power spectral density is calculated [integer scalar] number of uniformly distributed frequency values at which spectral density is calculated. [default=256]
-
Fs:
-
[real scalar] sampling frequency (Hertz) [default=1]
-
range:
-
'half', 'onesided' : frequency range of the spectrum is from zero up to but not including sample_f/2. Power from negative frequencies is added to the positive side of the spectrum. 'whole', 'twosided' : frequency range of the spectrum is -sample_f/2 to sample_f/2, with negative frequencies stored in "wrap around" order after the positive frequencies; e.g. frequencies for a 10-point 'twosided' spectrum are 0 0.1 0.2 0.3 0.4 0.5 -0.4 -0.3 -0.2 -0.1 'shift', 'centerdc' : same as 'whole' but with the first half of the spectrum swapped with second half to put the zero-frequency value in the middle. (See "help fftshift". If "freq" is vector, 'shift' is ignored. If model coefficients "ar_coeffs" are real, the default range is 'half', otherwise default range is 'whole'.
-
method:
-
'fft': use FFT to calculate power spectral density. 'poly': calculate spectral density as a polynomial of 1/z N.B. this argument is ignored if the "freq" argument is a vector. The default is 'poly' unless the "freq" argument is an integer power of 2.
-
plot_type:
-
'plot', 'semilogx', 'semilogy', 'loglog', 'squared' or 'db' specifies the type of plot. The default is 'plot', which means linear-linear axes. 'squared' is the same as 'plot'. 'dB' plots "10*log10(psd)". This argument is ignored and a spectrum is not plotted if the caller requires a returned value.
-
criterion:
-
[optional string arg] model-selection criterion. Limits the number of poles so that spurious poles are not added when the whitened data has no more information in it (see Kay & Marple, 1981). Recognized values are 'AKICc' -- approximate corrected Kullback information criterion (recommended), 'KIC' -- Kullback information criterion 'AICc' -- corrected Akaike information criterion 'AIC' -- Akaike information criterion 'FPE' -- final prediction error" criterion The default is to NOT use a model-selection criterion.
-
-
Description
-
This function is being called from Octave
-This function is a wrapper for arburg and ar_psd.
-The functions "arburg" and "ar_psd" do all the work.
-See "help arburg" and "help ar_psd" for further details.
This function calculates the ratio of peak magnitude to the Root Mean Square(RMS) value.
-
-
-
Calling Sequence
-
OUT=peak2rms(IN)
-OUT=peak2rms(IN,orientation)
-
-
Parameters
-
in:
-
Vector or Matrix of real or complex elements.
-
orientation:
-
A string with possible values "r", "c" or "m" giving the dimension along which the peak2rms value is to be calculated.
-
out:
-
A scalar with real value when input is a vector.When input is a matrix, out is the peak magnitude to RMS value along the orientation specified or the default one when not specified.
-
-
Description
-
For vector as input, the output is the ratio of peak value to the RMS value. The RMS value can be calculated by taking the square root of mean value of the squared sum of the elements.
-
When a matrix is given as input the output is peak to RMS ratio in the orientation specified.
-The orientation can be given as string with values "r","c" or "m".
-
peak2rms(in, 1) calculates the values of ratio of peak to RMS of columns of matrix. The output in this case is a row vector with peak2rms value of each column of in.
-
peak2rms(in, 2) calculates the values of ratio of peak to RMS of rows of matrix, where the output would be a column vector having peak2rms value of each row of in.
-
The default orientation is chosen to be the index of first dimension of input greater than 1.Hence peak2rms(in) is equivalent to peak2rms(in, "m").
-
For an N dimensional array the orientation is the index of first non singleton dimension of the array.
-
If the elements of matrix are complex the absolute values are considered in the calculation of RMS value.
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.
data vector. If X is real-valued a one-sided spectrum is estimated. If X is complex-valued, or "RANGE" specifies "twosided", the full spectrum is estimated.
-
WIN:
-
window weight data. If window is empty or unspecified a default rectangular window is used. Otherwise, the window is applied to the signal ('X .* WIN') before computing th periodogram. The window data must be a vector of the same length as X.
-
NFFT:
-
number of frequency bins. The default is 256 or the next higher power of 2 greater than the length of X ('max (256,2.^nextpow2 (length (x)))'). If NFFT is greater than the length of the input then X will be zero-padded to the length of NFFT.
-
FS:
-
sampling rate. The default is 1.
-
RANGE:
-
range of spectrum. "onesided" computes spectrum from [0..nfft/2+1]."twosided" computes spectrum from [0..nfft-1].
-
-
Description
-
The optional second output W are the normalized angular frequencies. For a one-sided calculation W is in the range [0, pi]. If NFFT is even and [0, pi) if NFFT is odd. Similarly, for a two-sided calculation W is in the range [0, 2*pi] or [0, 2*pi)depending on NFFT.
-
If a sampling frequency is specified, FS, then the output frequencies F will be in the range [0, FS/2] or [0, FS/2) for one-sided calculations. For two-sided calculations the range will be [0, FS).
-
When called with no outputs the periodogram is immediately plotted in the current figure window.
Convert prediction polynomial to autocorrelation sequence.
-
-
-
Calling Sequence
-
R = poly2ac(a,efinal)
-
-
Parameters
-
a:
-
input prediction polynomial with 1st element 1 (if not, poly2ac normalizes it to 1 before proceeding).
-
efinal:
-
input prediction error
-
r:
-
output autocorrelation sequence
-
-
Description
-
This function obtains the underlying autocorrelation sequence that would best fit a linear prediction filter described by the
-denominator polynomial and the numerator scaling. The filter is H(z) = efinal/(a(1) + a(2) x z a(3) x z^2 ... a(n) x z^n-1)
This function stabilizes the polynomial transfer function.
-
-
-
Calling Sequence
-
b = polystab(a)
-
-
Parameters
-
a:
-
-
-
Description
-
This is an Octave function.
-This function stabilizes the polynomial transfer function by replacing all roots outside the unit circle with their reflection inside the unit circle.
This function calculates the primitive of a given function supplied as input.
-
-
-
Calling Sequence
-
y = primitive(f, t)
-y = primitive(f, t, x)
-
-
Parameters
-
f:
-
-
t:
-
-
-
Description
-
This is an Octave function.
-This function calculates the primitive of a given function supplied as input.
-The second parameter t is a vector at which the output is evaluated (at the points t). This vector should be ascending and ordered.
-The function approximates the primitive (indefinite integral) of the univariate function handle f with constant of integration x.
This is an Octave function.
-This function generates the signal y = sum(func(t+d,...)) for each d. If d is a matrix of two columns, the first column is the delay d and the second column is the amplitude a, and y = sum(a*func(t+d)) for each d, a. Here, func is a function which accepts a vector of times.
-If a pulse shape sampled at frequency Fs (default 1 Hz) is supplied instead of a function name, an interpolated version of the pulse is added at each delay d.
[real vector] of window-function values between 0 and 1; the data segment has the same length as the window. Default window shape is Hamming. [integer scalar] length of each data segment. The default value is window=sqrt(length(x)) rounded up to the nearest integer power of 2; see 'sloppy' argument.
-
overlap:
-
[real scalar] segment overlap expressed as a multiple of window or segment length. 0 <= overlap < 1, The default is overlap=0.5 .
-
Nfft:
-
[integer scalar] Length of FFT. The default is the length of the "window" vector or has the same value as the scalar "window" argument. If Nfft is larger than the segment length, "seg_len", the data segment is padded with "Nfft-seg_len" zeros. The default is no padding. Nfft values smaller than the length of the data segment (or window) are ignored silently.
-
Fs:
-
[real scalar] sampling frequency (Hertz); default=1.0
-
conf:
-
[real scalar] confidence level between 0 and 1. Confidence intervals of the spectral density are estimated from scatter in the periodograms and are returned as Pxx_ci. Pxx_ci(:,1) is the lower bound of the confidence interval and Pxx_ci(:,2) is the upper bound. If there are three return values, or conf is an empty matrix, confidence intervals are calculated for conf=0.95 . If conf is zero or is not given, confidence intervals are not calculated. Confidence intervals can be obtained only for the power spectral density of x; nothing else.
-
range:
-
-
'half', 'onesided' :
-
frequency range of the spectrum is zero up to but not including Fs/2. Power from negative frequencies is added to the positive side of the spectrum, but not at zero or Nyquist (Fs/2) frequencies. This keeps power equal in time and spectral domains. See reference [2].
-
'whole', 'twosided' :
-
frequency range of the spectrum is -Fs/2 to Fs/2, with negative frequencies stored in "wrap around" order after the positive frequencies; e.g. frequencies for a 10-point 'twosided' spectrum are 0 0.1 0.2 0.3 0.4 0.5 -0.4 -0.3 -0.2 -0.1
-
'shift', 'centerdc' :
-
same as 'whole' but with the first half of the spectrum swapped with second half to put the zero-frequency value in the middle. (See "help fftshift". If data (x and y) are real, the default range is 'half', otherwise default range is 'whole'.
-
plot_type:
-
-
'plot', 'semilogx', 'semilogy', 'loglog', 'squared' or 'db':
-
specifies the type of plot. The default is 'plot', which means linear-linear axes. 'squared' is the same as 'plot'. 'dB' plots "10*log10(psd)". This argument is ignored and a spectrum is not plotted if the caller requires a returned value.
-
detrend:
-
'no-strip', 'none' -- do NOT remove mean value from the data 'short', 'mean' -- remove the mean value of each segment from each segment of the data.
-
sloppy:
-
FFT length is rounded up to the nearest integer power of 2 by zero padding. FFT length is adjusted after addition of padding by explicit Nfft argument. The default is to use exactly the FFT and window.
-
-
Description
-
Estimate power spectral density of data "x" by the Welch (1967) periodogram/FFT method. The data is divided into segments. If "window" is a vector, each segment has the same length as "window" and is multiplied by "window" before (optional) zero-padding and calculation of its periodogram. If "window" is a scalar, each segment has a length of "window" and a Hamming window is used. The spectral density is the mean of the periodograms, scaled so that area under the spectrum is the same as the mean square of the data. This equivalence is supposed to be exact, but in practice there is a mismatch of up to 0.5% when comparing area under a periodogram with the mean square of the data.
[integer scalar] required number of poles of the AR model
-
freq:
-
[real vector] frequencies at which power spectral density is calculated [integer scalar] number of uniformly distributed frequency values at which spectral density is calculated. [default=256]
-
Fs:
-
[real scalar] sampling frequency (Hertz) [default=1]
-
range:
-
'half', 'onesided' : frequency range of the spectrum is from zero up to but not including sample_f/2. Power from negative frequencies is added to the positive side of the spectrum. 'whole', 'twosided' : frequency range of the spectrum is -sample_f/2 to sample_f/2, with negative frequencies stored in "wrap around" order after the positive frequencies; e.g. frequencies for a 10-point 'twosided' spectrum are 0 0.1 0.2 0.3 0.4 0.5 -0.4 -0.3 -0.2 -0.1 'shift', 'centerdc' : same as 'whole' but with the first half of the spectrum swapped with second half to put the zero-frequency value in the middle. (See "help fftshift". If "freq" is vector, 'shift' is ignored. If model coefficients "ar_coeffs" are real, the default range is 'half', otherwise default range is 'whole'.
-
method:
-
'fft': use FFT to calculate power spectral density. 'poly': calculate spectral density as a polynomial of 1/z N.B. this argument is ignored if the "freq" argument is a vector. The default is 'poly' unless the "freq" argument is an integer power of 2.
-
plot_type:
-
'plot', 'semilogx', 'semilogy', 'loglog', 'squared' or 'db' specifies the type of plot. The default is 'plot', which means linear-linear axes. 'squared' is the same as 'plot'. 'dB' plots "10*log10(psd)". This argument is ignored and a spectrum is not plotted if the caller requires a returned value.
Computes a finite impulse response (FIR) filter for use with a quasi-perfect reconstruction polyphase-network filter bank.
-
-
-
Calling Sequence
-
qp_kaiser (nb, at, linear)
-qp_kaiser (nb, at)
-
-
Parameters
-
nb:
-
Number of bands
-
at:
-
Attenuation
-
linear:
-
When not zero, minimum-phase calculation is omitted.
-
-
Description
-
This is an Octave function.
-This version utilizes a Kaiser window to shape the frequency response of the designed filter. Tha number nb of bands and the desired attenuation at in the stop-band are given as parameters.
-
The Kaiser window is multiplied by the ideal impulse response h(n)=a.sinc(a.n) and converted to its minimum-phase version by means of a Hilbert transform.
This is an Octave function
-y = rectpuls(t) returns a continuous, aperiodic, unity-height rectangular pulse depending upon input t, centered about t=0 and having default width of 1.
-y = rectpuls(t,w) generates a rectangle of width w.
This function returns the filter coefficients of a rectangular window.
-
-
-
Calling Sequence
-
y = rectwin (m)
-
-
Parameters
-
m:
-
positive integer value
-
y:
-
output variable, vector of real numbers
-
-
Description
-
This is an Octave function.
-This function returns the filter coefficients of a rectangular window of length m supplied as input, to the output vector y.
This function resamples in the input sequence x supplied by a factor of p/q.
-
-
-
Calling Sequence
-
y = resample(x, p, q)
-y = resample(x, p, q, h)
-[y, h] = resample(...)
-
-
Parameters
-
x:
-
scalar, vector or matrix of real or complex numbers
-
p:
-
positive integer value
-
q:
-
positive integer value
-
h:
-
scalar, vector or matrix of real or complex numbers
-
-
Description
-
This is an Octave function.
-This function resamples in the input sequence x supplied by a factor of p/q. If x is a matrix, then every column is resampled.hange the sample rate of x by a factor of p/q.
-This is performed using a polyphase algorithm. The impulse response h, given as parameter 4, of the antialiasing filter is either specified or designed with a Kaiser-windowed sinecard.
This is an Octave function.
-Similar to the "residuez" function. The difference being in the function "residuez", the IIR part (poles p and residues r) is driven in parallel with the FIR part(f) whereas in the function "residued", the IIR part is driven by the output of the FIR part. In signal modeling applications, this structure can be more accurate.
This function calculates the square root of the sum of values of input vector IN.
-
-
-
Calling Sequence
-
OUT=rssq(IN)
-OUT=rssq(IN,orientation)
-
-
Parameters
-
in:
-
Vector or Matrix of real or complex elements.
-
orientation:
-
A string with possible values "r", "c" or "m" or numericals such as '1' or '2',giving the dimension along which the rssq value is to be calculated.
-
out:
-
A scalar with real value when input is a vector.When input is a matrix, out is the root sum squared value along the orientation specified or the default one when not specified.
-
-
Description
-
For vector as input, the output is real valued scalar containing the rssq value. The rssq value can be calculated by taking the square root of the squared sum of the elements.
-If the input IN is a matrix, the output of function is rssq value of each column stored in a row vector OUT.
-
When the elements of IN are COMPLEX, the absolute value of the element is used to calculate the output.
-When the orientation is not specified for N dimensional array, it is taken as the index of the first dimension of IN that is greater than 1 and calculation is done along that orientation.
-
When the orientation is specified the output is calculated along that dimension.
-The orientation can be specified as 1 for rssq value of columns of matrix IN or as r.
-For rssq value of rows of matrix orientation should be 2 or c.
This function calculates the output reconstructed from the samples n supplied as input, at a rate of 1/s samples per unit time.
-
-
-
Calling Sequence
-
x = sampled2continuous (n, s, t)
-
-
Parameters
-
n:
-
-
s:
-
-
t:
-
-
-
Description
-
This is an Octave function.
-This function calculates the output reconstructed from the samples n supplied as input, at a rate of 1/s samples per unit time.
-The third parameter t is all the instants where output x is needed from intput n and this time is relative to x(0).
This is an Octave function
-This function returns a sawtooth wave with period 2*pi with +1/-1 as the maximum and minimum values for elements of t. If width is specified, it determines where the maximum is in the interval [0,2*pi].
This function implements a multisignal Schmitt triggers with lev levels supplied as input.
-
-
-
Calling Sequence
-
v = schtrig (x, lev)
-v = schtrig (x, lev, rs)
-
-
Parameters
-
x:
-
vector or matrix of real numbers
-
lev:
-
real number
-
rs:
-
default value 1
-
-
Description
-
This is an Octave function.
-This function implements a multisignal Schmitt triggers with lev levels supplied as input.
-The argument 1 is a matrix (or a vector) and this trigger works along its first dimension.
aryule — This function fits an AR (p)-model with Yule-Walker estimates.
-
-
-
-
-
-
autoreg_matrix — Given a time series (vector) Y, return a matrix with ones in the first column and the first K lagged values of Y in the other columns.
-
-
-
-
-
-
barthannwin — This function returns the filter coefficients of a modified Bartlett-Hann window.
fft — Calculates the discrete Fourier transform of a matrix using Fast Fourier Transform algorithm.
-
-
-
-
-
-
fft1 — Calculates the discrete Fourier transform of a matrix using Fast Fourier Transform algorithm.
-
-
-
-
-
-
fft2 — Calculates the two-dimensional discrete Fourier transform of A using a Fast Fourier Transform algorithm.
-
-
-
-
-
-
fft21 — Calculates the two-dimensional discrete Fourier transform of A using a Fast Fourier Transform algorithm.
-
-
-
-
-
-
fftconv — Convolve two vectors using the FFT for computation.
-
-
-
-
-
-
fftfilt — Performs FFT-based FIR filtering using overlap-add method
-
-
-
-
-
-
fftn — This function computes the N-dimensional discrete Fourier transform of A using a Fast Fourier Transform (FFT) algorithm.
-
-
-
-
-
-
fftshift1 — Perform a shift of the vector X, for use with the 'fft1' and 'ifft1' functions, in order the move the frequency 0 to the center of the vector or matrix.
flattopwin — This function returns the filter coefficients of a Flat Top window.
-
-
-
-
-
-
fracshift — This function shifts the series x supplied as input argument by a number of samples d.
-
-
-
-
-
-
fractdiff — Compute the fractional differences (1-L)^d x where L denotes the lag-operator and d is greater than -1.
-
-
-
-
-
-
freqs — Compute the s-plane frequency response of the IIR filter.
-
-
-
-
-
-
freqz — This function returns the complex frequency response H of the rational IIR filter whose numerator and denominator coefficients are B and A, respectively.
-
-
-
-
-
-
fwhm — This function computes peak full width at half minimum or at another level of peak minimum for vector or matrix data y supplied as input.
aryule — This function fits an AR (p)-model with Yule-Walker estimates.
-
-
-
-
-
-
autoreg_matrix — Given a time series (vector) Y, return a matrix with ones in the first column and the first K lagged values of Y in the other columns.
-
-
-
-
-
-
barthannwin — This function returns the filter coefficients of a modified Bartlett-Hann window.
fft — Calculates the discrete Fourier transform of a matrix using Fast Fourier Transform algorithm.
-
-
-
-
-
-
fft1 — Calculates the discrete Fourier transform of a matrix using Fast Fourier Transform algorithm.
-
-
-
-
-
-
fft2 — Calculates the two-dimensional discrete Fourier transform of A using a Fast Fourier Transform algorithm.
-
-
-
-
-
-
fft21 — Calculates the two-dimensional discrete Fourier transform of A using a Fast Fourier Transform algorithm.
-
-
-
-
-
-
fftconv — Convolve two vectors using the FFT for computation.
-
-
-
-
-
-
fftfilt — Performs FFT-based FIR filtering using overlap-add method
-
-
-
-
-
-
fftn — This function computes the N-dimensional discrete Fourier transform of A using a Fast Fourier Transform (FFT) algorithm.
-
-
-
-
-
-
fftshift1 — Perform a shift of the vector X, for use with the 'fft1' and 'ifft1' functions, in order the move the frequency 0 to the center of the vector or matrix.
flattopwin — This function returns the filter coefficients of a Flat Top window.
-
-
-
-
-
-
fracshift — This function shifts the series x supplied as input argument by a number of samples d.
-
-
-
-
-
-
fractdiff — Compute the fractional differences (1-L)^d x where L denotes the lag-operator and d is greater than -1.
-
-
-
-
-
-
freqs — Compute the s-plane frequency response of the IIR filter.
-
-
-
-
-
-
freqz — This function returns the complex frequency response H of the rational IIR filter whose numerator and denominator coefficients are B and A, respectively.
-
-
-
-
-
-
fwhm — This function computes peak full width at half minimum or at another level of peak minimum for vector or matrix data y supplied as input.
[p,num]=seqperiod(x)
-Returns an integer p such that x(1:p) is the smallest subsequence that repeats in x
-The number of times the subsequence repeats is returned in num (may not be an integer)
-Repetitions may be incomplete at the end of the sequence but no breaks are permitted between repetitions
-If there is no subsequence that repeats in x then p=length(x)
-If x is a matrix or n-dimesnional array, the function operates along the first non-singleton dimension of x
True for high pass and band stop filters or false for low pass and band pass filters.
-
-
Description
-
This is an Octave function.
-Theory: Given a low pass filter represented by poles and zeros in the splane, you can convert it to a low pass, high pass, band pass or band stop by transforming each of the poles and zeros
-individually. The following table summarizes the transformation:
-
Transform Zero at x Pole at x
----------------- ------------------------- ------------------------
-Low Pass zero: Fc x/C pole: Fc x/C
-S -> C S/Fc gain: C/Fc gain: Fc/C
----------------- ------------------------- ------------------------
-High Pass zero: Fc C/x pole: Fc C/x
-S -> C Fc/S pole: 0 zero: 0
-gain: -x gain: -1/x
----------------- ------------------------- ------------------------
-Band Pass zero: b +- sqrt(b^2-FhFl) pole: b +- sqrt(b^2-FhFl)
-S^2+FhFl pole: 0 zero: 0
-S -> C -------- gain: C/(Fh-Fl) gain: (Fh-Fl)/C
-S(Fh-Fl) b=x/C (Fh-Fl)/2 b=x/C (Fh-Fl)/2
----------------- ------------------------- ------------------------
-Band Stop zero: b +- sqrt(b^2-FhFl) pole: b +- sqrt(b^2-FhFl)
-S(Fh-Fl) pole: +-sqrt(-FhFl) zero: +-sqrt(-FhFl)
-S -> C -------- gain: -x gain: -1/x
-S^2+FhFl b=C/x (Fh-Fl)/2 b=C/x (Fh-Fl)/2
----------------- ------------------------- ------------------------
-Bilinear zero: (2+xT)/(2-xT) pole: (2+xT)/(2-xT)
-2 z-1 pole: -1 zero: -1
-S -> - --- gain: (2-xT)/T gain: (2-xT)/T
-T z+1
----------------- ------------------------- ------------------------
-
where C is the cutoff frequency of the initial lowpass filter, Fc is the edge of the target low/high pass filter and [Fl,Fh] are the edges of the target band pass/stop filter. With abundant tedious
-algebra, you can derive the above formulae yourself by substituting the transform for S into H(S)=S-x for a zero at x or H(S)=1/(S-x) for a pole at x, and converting the result into the form:
This function computes the filter coefficients for all Savitzsky-Golay smoothing filters.
-
-
-
Calling Sequence
-
F = sgolay (p, n)
-F = sgolay (p, n, m)
-F = sgolay (p, n, m, ts)
-
-
Parameters
-
p:
-
polynomial
-
n:
-
odd integer value, larger than polynomial p
-
m:
-
positive integer less than 2^31 or logical
-
ts:
-
real or complex value
-
-
Description
-
This is an Octave function.
-This function computes the filter coefficients for all Savitzsky-Golay smoothing filters of order p for length n (odd).
-m can be used in order to get directly the mth derivative; ts is a scaling factor.
y = sgolayfilt (x)
-y = sgolayfilt (x, p)
-y = sgolayfilt (x, p, n)
-y = sgolayfilt (x, p, n, m)
-y = sgolayfilt (x, p, n, m, ts)
-
-
Parameters
-
x:
-
vector or matrix of real or complex numbers
-
p:
-
polynomial order, real number less than n, default value 3
-
n:
-
integer, odd number greater than p
-
m:
-
vector of real positive valued numbers, length n
-
ts:
-
real number, default value 1
-
-
Description
-
This function applies a Savitzky-Golay FIR smoothing filter to the data given in the vector x; if x is a matrix, this function operates
-on each column.
-The polynomial order p should be real, less than the size of the frame given by n.
-m is a weighting vector with default value identity matrix.
-ts is the dimenstion along which the filter operates. If not specified, the function operates along the first non singleton dimension.
Real or complex valued vector or matrix, strictly positive value for scalar input
-
fc:
-
Real or complex valued vector or matrix, strictly positive value for scalar input
-
-
Description
-
This is an Octave function
-This function implements the complex Shannon wavelet function and returns the value obtained. The complex Shannon wavelet is defined by a bandwidth parameter FB, a wavelet center frequency FC on an N point regular grid in the interval [LB,UB].
[y,perm,nshifts]=shiftdata(x,dim)
-Shifts the entries along dimension dim in x to the first column and returns the permutation vector in perm
-[y,perm,nshifts]=shiftdata(x)
-Shifts the entries along dimension dim in x to the first column and returns the number of shifts in nshifts
-
-
Examples
-
//When dim is specified:
-x=testmatrix('magi',3)
-x=
-
-8.1.6.
-3.5.7.
-4.9.2.
-[y,perm,nshifts]=shiftdata(x,2)
-nshifts=
-
-[]
-perm=
-
-2.1.
-y=
-
-8.3.4.
-1.5.9.
-6.7.2.
-//When dim is not specified:
-x=1:5
-x=
-
-1.2.3.4.5.
-[y,perm,nshifts]=shiftdata(x)
-nshifts=
-
-1.
-perm=
-
-[]
-y=
-
-1.
-2.
-3.
-4.
-5.
The number and duration of each sigmoid is determined from RANGES. Each row of RANGES represents a real interval, e.g. if sigmoid 'i' starts at 't=0.1' and ends at 't=0.5', then 'RANGES(i,:) = [0.1 0.5]'. The input RC is an array that defines the rising and falling time constants of each sigmoid. Its size must equal the size of RANGES.
Return a sinetone of frequency FREQ with a length of SEC seconds atsampling rate RATE and with amplitude AMPL.The arguments FREQ and AMPL may be vectors of common size.The defaults are RATE = 8000, SEC = 1, and AMPL = 64.
Converts a second order section matrix to a cell array
-
-
-
Parameters
-
-
-
Description
-
c=sos2cell(s) converts an L-by-6 second-order-section matrix s given by:
-s = [B1 A1
-B2 A2
-...
-BL AL]
-to a cell array c = { {B1},{A1}, {B2},{A2}, ... {BL},{AL}} where each
-numerator vector Bi and denominator vector Ai contains the coefficients of a
-linear or quadratic polynomial. If the polynomial is linear, the coefficients
-zero-padded on the right
-c=sos2cell(s,g) adds a leading gain term to the start of the cell array as:
-c={ {[g,1]},{B1},{A1}, {B2},{A2}, ... {BL},{AL}}
-Example
-s=rand(2,6)
-s =
This is an Octave function.
-This function converts series second-order sections to direct H(z) = B(z)/A(z) form.
-The input is the sos matrix and the second parameter is the overall gain, default value of which is 1.
-The output is a vector.
This is an Octave function.
-This function converts series second-order sections to zeros, poles, and gains (pole residues).
-The input is the sos matrix and the second parameter is the overall gain, default value of which is 1.
-The outputs are z, p, k. z and p are column vectors containing zeros and poles respectively, and k is the overall gain.
This is an Octave function
-Second order section digital filter sos is applied to the input vector and the output vector obtained is of the same length.
Return the spectral density estimator given a vector of autocovariances C, window name WIN, and bandwidth, B.
-
-
-
Calling Sequence
-
spectral_adf(C)
-spectral_adf(C, WIN)
-spectral_adf(C, WIN, B)
-
-
Parameters
-
C:
-
Autocovariances
-
WIN:
-
Window names
-
B:
-
Bandwidth
-
-
Description
-
Return the spectral density estimator given a vector ofautocovariances C, window name WIN, and bandwidth, B.
-The window name, e.g., "triangle" or "rectangle" is used to search for a function called 'WIN_lw'.
-If WIN is omitted, the triangle window is used.
-If B is omitted, '1 / sqrt (length (C))' is used.
Return the spectral density estimator given a data vector X, window name WIN, and bandwidth, B.
-
-
-
Calling Sequence
-
spectral_xdf(X)
-spectral_xdf(X, WIN)
-spectral_xdf(X, WIN, B)
-
-
Parameters
-
X:
-
Data Vector
-
WIN:
-
Window names
-
B:
-
Bandwidth
-
-
Description
-
Return the spectral density estimator given a data vector X, window name WIN, and bandwidth, B.
-The window name, e.g., "triangle" or "rectangle" is used to search for a function called 'WIN_lw'.
-If WIN is omitted, the triangle window is used.
-If B is omitted, '1 / sqrt (length (X))' is used.
Compute the short-time Fourier transform of the vector X with NUM_COEF coefficients by applying a window of WIN_SIZE data points and an increment of INC points.
-
Before computing the Fourier transform, one of the following windows is applied:
-
"hanning" -> win_type = 1
-
"hamming" -> win_type = 2
-
"rectangle" -> win_type = 3
-
The window names can be passed as strings or by the WIN_TYPE number.
-
The following defaults are used for unspecified arguments:WIN_SIZE= 80, INC = 24, NUM_COEF = 64, and WIN_TYPE = 1.
-
Y = stft (X, ...)' returns the absolute values of the Fourier coefficients according to the NUM_COEF positive frequencies.
-
'[Y, C] = stft (x, ...)' returns the entire STFT-matrix Y and a 3-element vector C containing the window size, increment, and window type, which is needed by the 'synthesis' function.
strips(x)
-Plots a vector x in horizontal strips of length 250
-If x is a matrix, it plots each column of x on a separate strip with the leftmost
-column as the topmost strip
-strips(x,sd)
-Plots x in strips of length sd samples each
-strips(x,sd,fs)
-Plots x in strips of duration sd seconds with sampling frequency fs (in Hz)
-strips(x,sd,fs,scale)
-Plots x in strips as above, and scales the vertical axis by scale
-If x is a matrix, strips uses a column vector of all the elements of x for the strip plot
-If x has complex entries, only the real part of those entries are considered
-Author
-Ankur Mallick
Compute a signal from its short-time Fourier transform
-
-
-
Calling Sequence
-
X= synthesis(Y,C)
-
-
Parameters
-
Y:
-
Shirt-time fourier transform
-
C:
-
3-element vector C specifying window size, increment, window type.
-
-
Description
-
Compute a signal from its short-time Fourier transform Y and a 3-element vector C specifying window size, increment, and window type.
-The values Y and C can be derived by
-[Y, C] = stft (X , ...)
This function converts direct-form filter coefficients to series second-order sections.
-
-
-
Calling Sequence
-
[sos] = tf2sos (b, a)
-[sos, g] = tf2sos (b, a)
-
-
Parameters
-
b:
-
matrix of real numbers
-
a:
-
matrix of real numbers
-
-
Description
-
This is an Octave function.
-This function converts direct-form filter coefficients to series second-order sections.
-The input parameters b and a are vectors specifying the digital filter H(z) = B(z)/A(z).
-The output is the sos matrix and the overall gain.
-If there is only one output argument, the overall filter gain is applied to the first second-order section in the sos matrix.
[real vector] of window-function values between 0 and 1; the data segment has the same length as the window. Default window shape is Hamming. [integer scalar] length of each data segment. The default value is window=sqrt(length(x)) rounded up to the nearest integer power of 2; see 'sloppy' argument.
-
overlap:
-
[real scalar] segment overlap expressed as a multiple of window or segment length. 0 <= overlap < 1, The default is overlap=0.5 .
-
Nfft:
-
[integer scalar] Length of FFT. The default is the length of the "window" vector or has the same value as the scalar "window" argument. If Nfft is larger than the segment length, "seg_len", the data segment is padded with "Nfft-seg_len" zeros. The default is no padding. Nfft values smaller than the length of the data segment (or window) are ignored silently.
-
Fs:
-
[real scalar] sampling frequency (Hertz); default=1.0
-
range:
-
'half', 'onesided' : frequency range of the spectrum is zero up to but not including Fs/2. Power from negative frequencies is added to the positive side of the spectrum, but not at zero or Nyquist (Fs/2) frequencies. This keeps power equal in time and spectral domains. See reference [2]. 'whole', 'twosided' : frequency range of the spectrum is-Fs/2 to Fs/2, with negative frequenciesstored in "wrap around" order after the positivefrequencies; e.g. frequencies for a 10-point 'twosided'spectrum are 0 0.1 0.2 0.3 0.4 0.5 -0.4 -0.3 -0.2 -0.1 'shift', 'centerdc' : same as 'whole' but with the first half of the spectrum swapped with second half to put the zero-frequency value in the middle. (See "help fftshift". If data (x and y) are real, the default range is 'half', otherwise default range is 'whole'.
-
plot_type:
-
'plot', 'semilogx', 'semilogy', 'loglog', 'squared' or 'db': specifies the type of plot. The default is 'plot', which means linear-linear axes. 'squared' is the same as 'plot'. 'dB' plots "10*log10(psd)". This argument is ignored and a spectrum is not plotted if the caller requires a returned value.
-
detrends:
-
'no-strip', 'none' -- do NOT remove mean value from the data'short', 'mean' -- remove the mean value of each segment from each segment of the data. 'linear',-- remove linear trend from each segment of the data.'long-mean'-- remove the mean value from the data before splitting it into segments. This is the default.
-
-
Description
-
Estimate transfer function of system with input "x" and output "y". Use the Welch (1967) periodogram/FFT method.
[real vector] of window-function values between 0 and 1; the data segment has the same length as the window. Default window shape is Hamming. [integer scalar] length of each data segment. The default value is window=sqrt(length(x)) rounded up to the nearest integer power of 2; see 'sloppy' argument.
-
overlap:
-
[real scalar] segment overlap expressed as a multiple of window or segment length. 0 <= overlap < 1, The default is overlap=0.5 .
-
Nfft:
-
[integer scalar] Length of FFT. The default is the length of the "window" vector or has the same value as the scalar "window" argument. If Nfft is larger than the segment length, "seg_len", the data segment is padded with "Nfft-seg_len" zeros. The default is no padding. Nfft values smaller than the length of the data segment (or window) are ignored silently.
-
Fs:
-
[real scalar] sampling frequency (Hertz); default=1.0
-
range:
-
'half', 'onesided' : frequency range of the spectrum is zero up to but not including Fs/2. Power from negative frequencies is added to the positive side of the spectrum, but not at zero or Nyquist (Fs/2) frequencies. This keeps power equal in time and spectral domains. See reference [2]. 'whole', 'twosided' : frequency range of the spectrum is -Fs/2 to Fs/2, with negative frequencies stored in "wrap around" order after the positive frequencies; e.g. frequencies for a 10-point 'twosided' spectrum are 0 0.1 0.2 0.3 0.4 0.5 -0.4 -0.3 -0.2 -0.1 'shift', 'centerdc' : same as 'whole' but with the first half of the spectrum swapped with second half to put the zero-frequency value in the middle. (See "help fftshift". If data (x and y) are real, the default range is 'half', otherwise default range is 'whole'.
-
-
Description
-
This function is being called from Octave.
-Estimate transfer function of system with input x and output y. Use the Welch (1967) periodogram/FFT method.
This function returns the filter coefficients of a triangular window.
-
-
-
Calling Sequence
-
y = triang (m)
-
-
Parameters
-
m:
-
positive integer value
-
y:
-
output variable, vector of real numbers
-
-
Description
-
This is an Octave function.
-This function returns the filter coefficients of a triangular window of length m supplied as input, to the output vector y.
This function generates a triangular pulse which is sampled at times t over the interval [-w/2,w/2]. The value of skew lies between -1
-and 1.
-The value of skew represents the relative placement of the peak in the given width.
This function returns the filter coefficients of a Tukey window.
-
-
-
Calling Sequence
-
w = tukeywin (m)
-w = tukeywin (m, r)
-
-
Parameters
-
m:
-
positive integer
-
r:
-
positive real number, between 0 and 1
-
-
Description
-
This is an Octave function.
-This function returns the filter coefficients of a Tukey window of length m supplied as input, to the output vector w.
-The second parameter r defines the ratio between the constant and cosine section and its value has to be between 0 and 1, with default value 0.5.
Uniformly decodes the input vector or n-dimensional array of integers u with peak values +/- v
-If u has only positive values, the range of integers is assumed to be [0,2^n-1]
-If u has positive and negative values the range of integers is assumed to be [-2^(n-1),2^(n-1)-1]
-If v is not specified, its default value is 1
-If saturatemode='wrap' the output is wrapped using modulo arithmetic if overflow occurs
-If saturatemode='saturate' the output is saturated if overflow accors
-Example
-u = int8([-1 1 2 -5]);
-ysat = udecode(u,3)
-ysat =
-
- 0.25 0.25 0.5 - 1.
-Author
-Ankur Mallick
-[1] International Telecommunication Union. General Aspects of Digital Transmission Systems: Vocabulary of Digital Transmission and Multiplexing, and Pulse Code Modulation (PCM) Terms. ITU-T Recommendation G.701. March, 1993.
Performs uniform quantization of the input into 2^n levels
-
-
-
Calling Sequence
-
y=uencode(u,n,v,'signflag')
-
-
Parameters
-
-
-
Description
-
Uniformly quantizes the input vector or n-dimensional array u into 2^n levels in the interval [-v,v]
-If v is not specified, its default value is 1
-'signflag' is a string that determines the nature of the quantization
-If signflag='unsigned' then y contains unsigned integers in the range [0,2^n-1] corresponding to the 2^n levels
-If signflag='unsigned' then y contains signed integers in the range [-2^(n-1),2^(n-1)-1] corresponding to the 2^n levels
-The size of the integers in y in bits(8,16, or 32) depends on the value of n
-If the input lies beyond +/- v it is saturated
-Example
-y=uencode(-1:0.5:1,3)
-y =
-
0 2 4 6 7
-Author
-Ankur Mallick
-References
-[1] International Telecommunication Union. General Aspects of Digital Transmission Systems: Vocabulary of Digital Transmission and Multiplexing, and Pulse Code Modulation (PCM) Terms. ITU-T Recommendation G.701. March, 1993.
This is an Octave function.
-This function returns the coefficients of an Ultraspherical window of length m supplied as input, to the output vector w.
-The second parameter controls the ratio between side lobe to side lobe of the window's Fourier transform.
-The third parameter controls the ratio between main lobe width to side lobe. The default value is beta.
-The value of xmu is also returned for given beta, att or latt.
This function upsamples the input data, applies the FIR filter and then downsamples it.
-
-
-
Calling Sequence
-
y = upfirdn (x, h, p, q)
-
-
Parameters
-
x:
-
-
h:
-
-
p:
-
-
q:
-
-
-
Description
-
This is an Octave function.
-This function upsamples the input data in the matrix by a factor of n. Then the upsampled data is FIR filtered. After this, the resultant is downsampled.
This function upsamples the signal, inserting n-1 zeros between every element.
-
-
-
Calling Sequence
-
y = upsample (x, n)
-y = upsample (x, n, phase)
-
-
Parameters
-
x:
-
scalar, vector or matrix of real or complex numbers
-
n:
-
real number or vector
-
phase:
-
integer value, 0 <= phase <= (n - 1 ), default value 0, or logical
-
-
Description
-
This is an Octave function.
-This function upsamples the signal, inserting n-1 zeros between every element. If x is a matrix, every column is upsampled.
-The phase determines the position of the inserted sample in the block of zeros. The default value is 0.
scalar, vector or matrix of real or complex numbers
-
w:
-
scalar or vector of real or complex values
-
cpy:
-
can take in "true" or "false", default is false
-
-
Description
-
This is an Octave function.
-This function upsamples a vector interleaving given values or copies of the vector elements.
-The second argument has the values in the vector w that are placed in between the elements of x.
-The third argument, if true, means that w should be scalar and that each value in x repeated w times.
y=vco(x,fc,fs)
-Creates a frequency modulated cosine wave y whose frequency varies as the magnitude of x
-x lies in [-1,1]. x=-1 corresponds to a frequency of 0, x=0 corresponds to a frequency of fc
-and x=1 corresponds to a frequency of 2fc.
-y=vco(x,[fmin fmax],fs)
-Scales the frequency range so that x=-1 corresponds to a frequency of fmin and
-x=1 corresponds to a frequency of fmax
-If x is a matrix the same operation is performed on the columns on x
-Size of y is the same as the size of x
-Example
-x=rand()
-x =
This function returns the filter coefficients of a Welch window.
-
-
-
Calling Sequence
-
w = welchwin (m)
-w = welchwin (m, opt)
-
-
Parameters
-
m:
-
positive integer value
-
opt:
-
string value, takes "periodic" or "symmetric"
-
w:
-
output variable, vector of real numbers
-
-
Description
-
This is an Octave function.
-This function returns the filter coefficients of a Welch window of length m supplied as input, to the output vector w.
-The second parameter can take the values "periodic" or "symmetric", depending on which the corresponding form of window is returned. The default is symmetric.
-For symmetric, the length should be an integer>2. For periodic, the length should be an integer>1.
This function creates an m-point window from the function f given as input.
-
-
-
Calling Sequence
-
w = window(f, m)
-w = window(f, m, opts)
-
-
Parameters
-
f:
-
string value
-
m:
-
positive integer value
-
opts:
-
string value, takes in "periodic" or "symmetric"
-
w:
-
output variable, vector of real numbers
-
-
Description
-
This is an Octave function.
-This function creates an m-point window from the function f given as input, in the output vector w.
-f can take any valid function as a string, for example "blackmanharris".
Real, complex or string type input vector or matrix
-
l:
-
Length of matrix required
-
opt:
-
Character input to determine which side to extract from
-
-
Description
-
This is an Octave function
-[y]=wkeep(x,l) extracts a vector of length l from the centre of input vector x.
-[y]=wkeep(x,l,opt) extracts vector based on opt which could be 'l','r' or 'c' (left, right or central).
[non-empty; real or complex; vector or matrix] data.
-
Y:
-
[real or complex vector] data.
-
maxlag:
-
[integer scalar] maximum correlation lag If omitted, the default value is N-1, where N is the greater of the lengths of X and Y or, if X is a matrix, the number of rows in X.
-
scale:
-
[character string] specifies the type of scaling applied to the correlation vector (or matrix). is one of:
-
-
Description
-
This is an Octave function.
-Estimate the cross correlation R_xy(k) of vector arguments X and Y or, if Y is omitted, estimate autocorrelation R_xx(k) of vector X, for a range of lags k specified by argument "maxlag". If X is a
-matrix, each column of X is correlated with itself and every other column.
-
The cross-correlation estimate between vectors "x" and "y" (of length N) for lag "k" is given by
-
N
-R_xy(k) = sum x_{i+k} conj(y_i),
-i=1
-
where data not provided (for example x(-1), y(N+1)) is zero. Note the definition of cross-correlation given above. To compute a cross-correlation consistent with the field of statistics, see xcov.
if specified, compute cross-covariance between X and Y, otherwise compute autocovariance of X.
-
maxlag:
-
is specified, use lag range [-maxlag:maxlag], otherwise use range [-n+1:n-1].
-
scale:
-
-
'biased':
-
for covariance=raw/N,
-
'unbiased':
-
for covariance=raw/(N-|lag|),
-
'coeff':
-
for covariance=raw/(covariance at lag 0),
-
'none':
-
for covariance=raw
-
'none':
-
is the default.
-
-
Description
-
Compute covariance at various lags [=correlation(x-mean(x),y-mean(y))]. Returns the covariance for each lag in the range, plus an optional vector of lags.
Fit an AR (p)-model with Yule-Walker estimates given a vector C of autocovariances '[gamma_0, ..., gamma_p]'.
-
-
-
Calling Sequence
-
A = yulewalker(C)
-[A,V]= yulewalker(C)
-
-
Parameters
-
C:
-
Autocovariances
-
-
Description
-
Fit an AR (p)-model with Yule-Walker estimates given a vector C of autocovariances '[gamma_0, ..., gamma_p]'.
-Returns the AR coefficients, A, and the variance of white noise, V.
This is an Octave function.
-This function converts filter poles and zeros to second-order sections.
-The first and second parameters are column vectors containing zeros and poles. The third parameter is the overall filter gain, the default value of which is 1.
-The output is the sos matrix and the overall gain.
-If there is only one output argument, the overall filter gain is applied to the first second-order section in the sos matrix.