I hope that someday Octave will include more signal processing functions. If you would like to help improve Octave in this area, please contact bug-octave@bevo.che.wisc.edu.
@anchor{doc-detrend}
detrend (x, p)
removes the
best fit of a polynomial of order p from the data x.
If x is a matrix, detrend (x, p)
does the same
for each column in x.
The second argument is optional. If it is not specified, a value of 1 is assumed. This corresponds to removing a linear trend.
@anchor{doc-fft}
fft
computes the FFT for each column of a.
If called with two arguments, n is expected to be an integer specifying the number of elements of a to use. If a is a matrix, n specifies the number of rows of a to use. If n is larger than the size of a, a is resized and padded with zeros.
@anchor{doc-ifft}
fft
computes the inverse FFT for each column
of a.
If called with two arguments, n is expected to be an integer specifying the number of elements of a to use. If a is a matrix, n specifies the number of rows of a to use. If n is larger than the size of a, a is resized and padded with zeros.
@anchor{doc-fft2}
The optional arguments n and m 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.
@anchor{doc-ifft2}
The optional arguments n and m 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.
@anchor{doc-fftconv}
length (a) + length (b) - 1
. If a
and b are the coefficient vectors of two polynomials, the returned
value is the coefficient vector of the product polynomial.
The computation uses the FFT by calling the function fftfilt
. If
the optional argument n is specified, an N-point FFT is used.
@anchor{doc-fftfilt}
With two arguments, fftfilt
filters x with the FIR filter
b using the FFT.
Given the optional third argument, n, fftfilt
uses the
overlap-add method to filter x with b using an N-point FFT.
If x is a matrix, filter each column of the matrix.
@anchor{doc-filter}
N M SUM a(k+1) y(n-k) = SUM b(k+1) x(n-k) for 1<=n<=length(x) k=0 k=0
where N=length(a)-1 and M=length(b)-1. An equivalent form of this equation is:
N M y(n) = - SUM c(k+1) y(n-k) + SUM d(k+1) x(n-k) for 1<=n<=length(x) k=1 k=0
where c = a/a(1) and d = b/a(1).
If the fourth argument si is provided, it is taken as the initial state of the system and the final state is returned as sf. The state vector is a column vector whose length is equal to the length of the longest coefficient vector minus one. If si is not supplied, the initial state vector is set to all zeros.
In terms of the z-transform, y is the result of passing the discrete- time signal x through a system characterized by the following rational system function:
M SUM d(k+1) z^(-k) k=0 H(z) = ---------------------- N 1 + SUM c(k+1) z(-k) k=1
@anchor{doc-freqz}
The output value w is a vector of the frequencies.
If the fourth argument is omitted, the response is evaluated at frequencies between 0 and pi.
If n is omitted, a value of 512 is assumed.
If a is omitted, the denominator is assumed to be 1 (this corresponds to a simple FIR filter).
For fastest computation, n should factor into a small number of small primes.
@anchor{doc-freqz_plot}
@anchor{doc-sinc}
@anchor{doc-unwrap}
Unwrap radian phases by adding multiples of 2*pi as appropriate to remove jumps greater than tol. tol defaults to pi.
Unwrap will unwrap along the columns of a unless the row dimension of a is 1 or dim is given with a value of 1, when it will unwrap along the row(s).
@anchor{doc-arch_fit}
y(t) = b(1) * x(t,1) + ... + b(k) * x(t,k) + e(t), h(t) = a(1) + a(2) * e(t-1)^2 + ... + a(p+1) * e(t-p)^2
in which @math{e(t)} is @math{N(0, h(t))}, given a time-series vector y up to time @math{t-1} and a matrix of (ordinary) regressors x up to @math{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 @math{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 @math{a0} and @math{b0} for the scoring algorithm.
@anchor{doc-arch_rnd}
y(t) = b(1) + b(2) * y(t-1) + ... + b(lb) * y(t-lb+1) + e(t),
where @math{e(t)}, given y up to time @math{t-1}, is @math{N(0, h(t))}, with
h(t) = a(1) + a(2) * e(t-1)^2 + ... + a(la) * e(t-la+1)^2
@anchor{doc-arch_test}
y = x * b + e
perform a Lagrange Multiplier (LM) test of the null hypothesis of no conditional heteroscedascity against the alternative of CH(p).
I.e., the model is
y(t) = b(1) * x(t,1) + ... + b(k) * x(t,k) + e(t),
given y up to @math{t-1} and x up to @math{t}, @math{e}(t) is @math{N(0, h(t))} with
h(t) = v + a(1) * e(t-1)^2 + ... + a(p) * e(t-p)^2,
and the null is @math{a(1)} == ... == @math{a(p)} == 0.
If the second argument is a scalar integer, @math{k}, perform the same test in a linear autoregression model of order @math{k}, i.e., with
[1, y(t-1), ..., y(t-k)]
as the @math{t}-th row of x.
Under the null, LM approximately has a chisquare distribution with p degrees of freedom and pval is the @math{p}-value (1 minus the CDF of this distribution at LM) of the test.
If no output argument is given, the @math{p}-value is displayed.
@anchor{doc-arma_rnd}
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.
@anchor{doc-autocor}
@anchor{doc-autocov}
@anchor{doc-autoreg_matrix}
[1,
y(t-1), ..., y(t-k)]
is the t-th row
of the result. The resulting matrix may be used as a regressor matrix
in autoregressions.
@anchor{doc-bartlett}
For a definition of the Bartlett window, see e.g. A. V. Oppenheim & R. W. Schafer, "Discrete-Time Signal Processing".
@anchor{doc-blackman}
For a definition of the Blackman window, see e.g. A. V. Oppenheim & R. W. Schafer, "Discrete-Time Signal Processing".
@anchor{doc-diffpara}
The frequencies from @math{[2*pi*a/t, 2*pi*b/T]} are used for the estimation. If b is omitted, the interval @math{[2*pi/T, 2*pi*a/T]} is used. If both b and a are omitted then @math{a = 0.5 * sqrt (T)} and @math{b = 1.5 * sqrt (T)} is used, where @math{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. The value of d is simply the mean of dd.
Reference: Brockwell, Peter J. & Davis, Richard A. Time Series: Theory and Methods Springer 1987.
@anchor{doc-durbinlevinson}
The vector c specifies the autocovariances [gamma_0, ...,
gamma_t]
from lag 0 to t, oldphi specifies the
coefficients based on c(t-1) and oldv specifies the
corresponding error.
If oldphi and oldv are omitted, all steps from 1 to t of the algorithm are performed.
@anchor{doc-fftshift}
fft
and ifft
functions, in order the move the frequency 0 to the
center of the vector or matrix.
If v is a vector of @math{N} elements corresponding to @math{N} time samples spaced of @math{Dt} each, then @code{fftshift (fft (v))} corresponds to frequencies
f = ((1:N) - ceil(N/2)) / N / Dt
If v is a matrix, the same holds for rows and columns.
@anchor{doc-fractdiff}
@anchor{doc-hamming}
For a definition of the Hamming window, see e.g. A. V. Oppenheim & R. W. Schafer, "Discrete-Time Signal Processing".
@anchor{doc-hanning}
For a definition of this window type, see e.g. A. V. Oppenheim & R. W. Schafer, "Discrete-Time Signal Processing".
@anchor{doc-hurst}
@anchor{doc-periodogram}
@anchor{doc-rectangle_lw}
@anchor{doc-rectangle_sw}
@anchor{doc-sinetone}
Defaults are rate = 8000, sec = 1 and ampl = 64.
@anchor{doc-sinewave}
sin (2 * pi * (i+d-1) / n)
.
The default value for d is 0.
@anchor{doc-spectral_adf}
The window name, e.g., "triangle"
or "rectangle"
is
used to search for a function called win_sw
.
If win is omitted, the triangle window is used. If b is
omitted, 1 / sqrt (length (x))
is used.
@anchor{doc-spectral_xdf}
The window name, e.g., "triangle"
or "rectangle"
is
used to search for a function called win_sw
.
If win is omitted, the triangle window is used. If b is
omitted, 1 / sqrt (length (x))
is used.
@anchor{doc-spencer}
@anchor{doc-stft}
Before computing the Fourier transform, one of the following windows is applied:
The window names can be passed as strings or by the w_type number.
If not all arguments are specified, the following defaults are used: win_size = 80, inc = 24, num_coef = 64, and w_type = 1.
y = stft (x, ...)
returns the absolute values
of the Fourier coefficients according to the num_coef positive
frequencies.
[y, c] = stft (
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.
x
, ...)
@anchor{doc-synthesis}
The values y and c can be derived by
[y, c] = stft (x , ...)
@anchor{doc-triangle_lw}
@anchor{doc-triangle_sw}
@anchor{doc-yulewalker}
[gamma_0, ..., gamma_p]
.
Returns the AR coefficients, a, and the variance of white noise, v.
Go to the first, previous, next, last section, table of contents.