signal

Signal processing tools, including filtering, windowing and display functions.

Select category:

Signals

buffer
Buffer a signal into a data frame.
chirp
Evaluate a chirp signal at time T.
cmorwavf
Compute the Complex Morlet wavelet.
diric
Compute the dirichlet function.
gauspuls
Generate a Gaussian modulated sinusoidal pulse sampled at times T.
gmonopuls
Return the gaussian monopulse.
mexihat
Compute the Mexican hat wavelet.
meyeraux
Compute the Meyer wavelet auxiliary function.
morlet
Compute the Morlet wavelet.
pulstran
Generate the signal y=sum(func(t+d,...)) for each d.
rectpuls
Generate a rectangular pulse over the interval [-W/2,W/2), sampled at times T.
sawtooth
Generates a sawtooth wave of period ‘2 * pi’ with limits ‘+1/-1’ for the elements of T.
shanwavf
Compute the Complex Shannon wavelet.
shiftdata
Shift data IN to permute the dimension DIM to the first column.
sigmoid_train
Evaluate a train of sigmoid functions at T.
specgram
Generate a spectrogram for the signal X.
square
Generate a square wave of period 2 pi with limits +1/-1.
tripuls
Generate a triangular pulse over the interval [-W/2,W/2), sampled at times T.
udecode
Invert the operation of uencode.
uencode
Quantize the entries of the array IN using 2^N quantization levels.
unshiftdata
Reverse what is done by shiftdata.
vco
Creates a signal that oscillates at a frequency determined by input X with a sampling frequency FS.

Signal Measurement

findpeaks
Finds peaks on DATA.
peak2peak
Compute the difference between the maximum and minimum values in the vector X.
peak2rms
Compute the ratio of the largest absolute value to the root-mean-square (RMS) value of the vector X.
rms
Compute the root-mean-square (RMS) of the vector X.
rssq
Compute the root-sum-of-squares (RSS) of the vector X.

Correlation and Convolution

cconv
Compute the modulo-N circular convolution.
convmtx
If A is a column vector and X is a column vector of length N, then
wconv
1-D or 2-D convolution.
xcorr
Estimates the cross-correlation.
xcorr2
Compute the 2D cross-correlation of matrices A and B.
xcov
Compute covariance at various lags [=correlation(x-mean(x),y-mean(y))].

Filtering

filtfilt
Forward and reverse filter the signal.
filtic
Set initial condition vector for filter function The vector zf has the same values that would be obtained from function filter given past inputs x and outputs y
medfilt1
Apply a one dimensional median filter with a window size of N to the data X, which must be real, double and full.
movingrms
Calculate moving RMS value of the signal in X.
sgolayfilt
Smooth the data in x with a Savitsky-Golay smoothing filter of polynomial order p and length n, n odd, n > p.
sosfilt
Second order section IIR filtering of X.

Filter Analysis

filternorm
Compute the 2-norm of a digital filter defined by the numerator coefficients, B, and the denominator coefficients, A.
filtord
Returns the filter order N for a filter defined by the numerator coefficients, B, and the denominator coefficients, A.
freqs
Compute the s-plane frequency response of the IIR filter B(s)/A(s) as H = polyval(B,j*W)./polyval(A,j*W).
freqs_plot
Plot the amplitude and phase of the vector H.
fwhm
Compute peak full-width at half maximum (FWHM) or at another level of peak maximum for vector or matrix data Y, optionally sampled as y(x).
grpdelay
Compute the group delay of a filter.
impz
Generate impulse-response characteristics of the filter.
isallpass
Determine whether a digital filter is allpass.
ismaxphase
Determine whether a digital filter is maximum phase (maximum energy-delay).
isminphase
Determine whether a digital filter is minimum phase.
isstable
Returns a logical output equal to TRUE, if the filter is stable.
phasez
Compute the phase response of digital filter defined either by its coefficients (B and A are the numerator and denominator coefficients respectively) or by its second-order sections representation,...
zplane
Plot the poles and zeros on a complex plane.

Filter Conversion

polystab
b = polystab(a)
residued
Compute the partial fraction expansion (PFE) of filter H(z) = B(z)/A(z).
residuez
Compute the partial fraction expansion of filter H(z) = B(z)/A(z).
sos2ss
Convert series second-order sections to state-space.
sos2tf
Convert series second-order sections to transfer function.
sos2zp
Convert series second-order sections to zeros, poles, and gains (pole residues).
ss2tf
Conversion from state-space to transfer function representation.
ss2zp
Converts a state space representation to a set of poles and zeros; K is a gain associated with the zeros.
tf2sos
Convert direct-form filter coefficients to series second-order sections.
tf2ss
Conversion from transfer function to state-space.
tf2zp
Convert transfer functions to poles-and-zero representations.
zp2sos
Convert filter poles and zeros to second-order sections.
zp2ss
Conversion from zero / pole to state space.
zp2tf
Converts zeros / poles to a transfer function.

IIR Filter Design

besselap
Return bessel analog filter prototype.
besself
Generate a Bessel filter.
bilinear
Transform a s-plane filter specification into a z-plane specification.
buttap
Design lowpass analog Butterworth filter.
butter
Generate a Butterworth filter.
buttord
Compute the minimum filter order of a Butterworth filter with the desired response characteristics.
cheb
Returns the value of the nth-order Chebyshev polynomial calculated at the point x.
cheb1ap
Design lowpass analog Chebyshev type I filter.
cheb1ord
Compute the minimum filter order of a Chebyshev type I filter with the desired response characteristics.
cheb2ap
Design lowpass analog Chebyshev type II filter.
cheb2ord
Compute the minimum filter order of a Chebyshev type II filter with the desired response characteristics.
cheby1
Generate a Chebyshev type I filter with RP dB of passband ripple.
cheby2
Generate a Chebyshev type II filter with RS dB of stopband attenuation.
ellip
Generate an elliptic or Cauer filter with RP dB of passband ripple and RS dB of stopband attenuation.
ellipap
Design lowpass analog elliptic filter.
ellipord
Compute the minimum filter order of an elliptic filter with the desired response characteristics.
iirlp2mb
IIR Low Pass Filter to Multiband Filter Transformation
impinvar
Converts analog filter with coefficients B and A to digital, conserving impulse response.
invimpinvar
Converts digital filter with coefficients B and A to analog, conserving impulse response.
firpm
Designs a linear-phase FIR filter according to given specifications and the ‘minimax’ criterion.
firpmord
Estimate the filter-order needed for ‘firpm’ to design a type-I or type-II linear-phase FIR filter according to the given specifications.
ncauer
Analog prototype for Cauer filter.
pei_tseng_notch
Return coefficients for an IIR notch-filter with one or more filter frequencies and according (very narrow) bandwidths to be used with ‘filter’ or ‘filtfilt’.
sftrans
Transform band edges of a generic lowpass filter (cutoff at W=1) represented in splane zero-pole-gain form.

FIR Filter Design

cl2bp
Constrained L2 bandpass FIR filter design.
fir1
Produce an order N FIR filter with the given frequency cutoff W, returning the N+1 filter coefficients in B.
fir2
Produce an order N FIR filter with arbitrary frequency response M over frequency bands F, returning the N+1 filter coefficients in B.
firls
FIR filter design using least squares method.
kaiserord
Return the parameters needed to produce a filter of the desired specification from a Kaiser window.
qp_kaiser
Computes a finite impulse response (FIR) filter for use with a quasi-perfect reconstruction polyphase-network filter bank.
remez
Parks-McClellan optimal FIR filter design.
sgolay
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.

Transforms

bitrevorder
Reorder the elements of the vector X in bit-reversed order.
cceps
Return the complex cepstrum of the vector X.
cplxreal
Sort the numbers Z into complex-conjugate-valued and real-valued elements.
czt
Chirp z-transform.
dct
Compute the discrete cosine transform of X.
dct2
Compute the 2-D discrete cosine transform of matrix X.
dctmtx
Return the DCT transformation matrix of size N-by-N.
dftmtx
Compute the N-by-N Fourier transformation matrix.
digitrevorder
Reorder the elements of the vector X in digit-reversed order.
dst
Computes the type I discrete sine transform of X.
dwt
Discrete wavelet transform (1D).
fht
Calculate the Fast Hartley Transform of real input D.
fwht
Compute the Walsh-Hadamard transform of X using the Fast Walsh-Hadamard Transform (FWHT) algorithm.
hilbert
Analytic extension of real valued signal.
idct
Compute the inverse discrete cosine transform of X.
idct2
Compute the inverse 2-D discrete cosine transform of matrix X.
idst
Computes the inverse type I discrete sine transform of Y.
ifht
Calculate the inverse Fast Hartley Transform of real input D.
ifwht
Compute the inverse Walsh-Hadamard transform of X using the Fast Walsh-Hadamard Transform (FWHT) algorithm.
rceps
Return the cepstrum of the signal X.

Power Spectrum Analysis

ar_psd
Calculate the power spectrum of the autoregressive model
cohere
Estimate (mean square) coherence of signals "x" and "y".
cpsd
Estimate cross power spectrum of data X and Y by the Welch (1967) periodogram/FFT method.
csd
Estimate cross power spectrum of data "x" and "y" by the Welch (1967) periodogram/FFT method.
db2pow
Convert decibels (dB) to power.
mscohere
Estimate (mean square) coherence of signals X and Y.
pburg
Calculate Burg maximum-entropy power spectral density.
pow2db
Convert power to decibels (dB).
pwelch
Estimate power spectral density of data "x" by the Welch (1967) periodogram/FFT method.
pyulear
Calculates a Yule-Walker autoregressive (all-pole) model of the data "x" and computes the power spectrum of the model.
tfe
Estimate transfer function of system with input "x" and output "y".
tfestimate
Estimate transfer function of system with input X and output Y.
__power
Plot the power spectrum of the given ARMA model.

Window Functions

barthannwin
Return the filter coefficients of a modified Bartlett-Hann window of length M.
blackmanharris
Return the filter coefficients of a Blackman-Harris window of length M.
blackmannuttall
Return the filter coefficients of a Blackman-Nuttall window of length M.
bohmanwin
Return the filter coefficients of a Bohman window of length M.
boxcar
Return the filter coefficients of a rectangular window of length M.
chebwin
Return the filter coefficients of a Dolph-Chebyshev window of length M.
flattopwin
Return the filter coefficients of a Flat Top window of length M.
gaussian
Return a Gaussian convolution window of length M.
gausswin
Return the filter coefficients of a Gaussian window of length M.
hann
Return the filter coefficients of a Hanning window of length M.
kaiser
Return the filter coefficients of a Kaiser window of length M.
nuttallwin
Return the filter coefficients of a Blackman-Harris window defined by Nuttall of length M.
parzenwin
Return the filter coefficients of a Parzen window of length M.
rectwin
Return the filter coefficients of a rectangular window of length M.
triang
Return the filter coefficients of a triangular window of length M.
tukeywin
Return the filter coefficients of a Tukey window (also known as the cosine-tapered window) of length M.
ultrwin
Return the coefficients of an Ultraspherical window of length M.
welchwin
Return the filter coefficients of a Welch window of length M.
window
Create an M-point window from the function F.

System Identification

arburg
Calculate coefficients of an autoregressive (AR) model of complex data X using the whitening lattice-filter method of Burg (1968).
aryule
Fit an AR (P)-model with Yule-Walker estimates.
invfreq
Fit filter B(z)/A(z) or B(s)/A(s) to complex frequency response at frequency points F.
invfreqs
Fit filter B(s)/A(s)to the complex frequency response H at frequency points F.
invfreqz
Fit filter B(z)/A(z)to the complex frequency response H at frequency points F.
levinson
Use the Durbin-Levinson algorithm to solve: toeplitz(acf(1:p)) * x = -acf(2:p+1).
lpc
Determines the forward linear predictor by minimizing the prediction error in the least squares sense.

Sample Rate Change

data2fun
Create a vectorized function based on data samples using interpolation.
decimate
Downsample the signal X by a reduction factor of Q.
downsample
Downsample the signal, selecting every Nth element.
interp
Upsample the signal x by a factor of q, using an order 2*q*n+1 FIR filter.
resample
Change the sample rate of X by a factor of P/Q.
upfirdn
Upsample, FIR filtering, and downsample.
upsample
Upsample the signal, inserting N-1 zeros between every element.

Pulse Metrics

statelevels
Estimate state-level for bilevel waveform A using histogram method

Utility

buffer
Buffer a signal into a data frame.
clustersegment
Calculate boundary indexes of clusters of 1’s.
fracshift
Shift the series X by a (possibly fractional) number of samples D.
marcumq
Compute the generalized Marcum Q function of order M with noncentrality parameter A and argument B.
primitive
Calculate the primitive of a function.
sampled2continuous
Calculate the x(t) reconstructed from samples x[n] sampled at a rate 1/T samples per unit time.
schtrig
Implements a multisignal Schmitt trigger with levels LVL.
upsamplefill
Upsamples a vector interleaving given values or copies of the vector elements.
wkeep
Extract the elements of X of size L from the center, the right or the left.
wrev
Reverse the order of the element of the vector X.
zerocrossing
Estimates the points at which a given waveform y=y(x) crosses the x-axis using linear interpolation.

Package: signal