Signal Toolkit - Functions


The following functions are available:

Signals

bufferBuffer a signal into a data frame.
chirpEvaluate a chirp signal at time T.
cmorwavfCompute the Complex Morlet wavelet.
diricCompute the dirichlet function.
gauspulsGenerate a Gaussian modulated sinusoidal pulse sampled at times T.
gmonopulsReturn the gaussian monopulse.
mexihatCompute the Mexican hat wavelet.
meyerauxCompute the Meyer wavelet auxiliary function.
morletCompute the Morlet wavelet.
pulstranGenerate the signal y=sum(func(t+d,...)) for each d.
rectpulsGenerate a rectangular pulse over the interval [-W/2,W/2), sampled at times T.
sawtoothGenerates a sawtooth wave of period ‘2 * pi’ with limits ‘+1/-1’ for ...
shanwavfCompute the Complex Shannon wavelet.
shiftdataShift data IN to permute the dimension DIM to the first column.
sigmoid_trainEvaluate a train of sigmoid functions at T.
specgramGenerate a spectrogram for the signal X.
squareGenerate a square wave of period 2 pi with limits +1/-1.
tripulsGenerate a triangular pulse over the interval [-W/2,W/2), sampled at times T.
udecodeInvert the operation of uencode.
uencodeQuantize the entries of the array IN using 2^N quantization levels.
unshiftdataReverse what is done by shiftdata.
vcoCreates a signal that oscillates at a frequency determined by input X with a ...

Signal Measurement

findpeaksFinds peaks on DATA.
peak2peakCompute the difference between the maximum and minimum values in the vector X.
peak2rmsCompute the ratio of the largest absolute value to the root-mean-square (RMS)...
rmsCompute the root-mean-square (RMS) of the vector X.
rssqCompute the root-sum-of-squares (RSS) of the vector X.

Correlation and Convolution

cconvCompute the modulo-N circular convolution.
convmtxIf A is a column vector and X is a column vector of length N, then
wconv1-D or 2-D convolution.
xcorrEstimates the cross-correlation.
xcorr2Compute the 2D cross-correlation of matrices A and B.
xcovCompute covariance at various lags [=correlation(x-mean(x),y-mean(y))].

Filtering

filtfiltForward and reverse filter the signal.
filticSet initial condition vector for filter function The vector zf has the same v...
medfilt1Apply a one dimensional median filter with a window size of N to the data X, ...
movingrmsCalculate moving RMS value of the signal in X.
sgolayfiltSmooth the data in x with a Savitsky-Golay smoothing filter of polynomial ord...
sosfiltSecond order section IIR filtering of X.

Filter Analysis

filternormCompute the 2-norm of a digital filter defined by the numerator coefficients,...
filtordReturns the filter order N for a filter defined by the numerator coefficients...
freqsCompute the s-plane frequency response of the IIR filter B(s)/A(s) as H = pol...
freqs_plotPlot the amplitude and phase of the vector H.
fwhmCompute peak full-width at half maximum (FWHM) or at another level of peak ma...
grpdelayCompute the group delay of a filter.
impzGenerate impulse-response characteristics of the filter.
isallpassDetermine whether a digital filter is allpass.
ismaxphaseDetermine whether a digital filter is maximum phase (maximum energy-delay).
isminphaseDetermine whether a digital filter is minimum phase.
isstableReturns a logical output equal to TRUE, if the filter is stable.
phasezCompute the phase response of digital filter defined either by its coefficien...
zplanePlot the poles and zeros on a complex plane.

Filter Conversion

polystab b = polystab(a)
residuedCompute the partial fraction expansion (PFE) of filter H(z) = B(z)/A(z).
residuezCompute the partial fraction expansion of filter H(z) = B(z)/A(z).
sos2ssConvert series second-order sections to state-space.
sos2tfConvert series second-order sections to transfer function.
sos2zpConvert series second-order sections to zeros, poles, and gains (pole residue...
ss2tfConversion from state-space to transfer function representation.
ss2zpConverts a state space representation to a set of poles and zeros; K is a gai...
tf2sosConvert direct-form filter coefficients to series second-order sections.
tf2ssConversion from transfer function to state-space.
tf2zpConvert transfer functions to poles-and-zero representations.
zp2sosConvert filter poles and zeros to second-order sections.
zp2ssConversion from zero / pole to state space.
zp2tfConverts zeros / poles to a transfer function.

IIR Filter Design

besselapReturn bessel analog filter prototype.
besselfGenerate a Bessel filter.
bilinearTransform a s-plane filter specification into a z-plane specification.
buttapDesign lowpass analog Butterworth filter.
butterGenerate a Butterworth filter.
buttordCompute the minimum filter order of a Butterworth filter with the desired res...
chebReturns the value of the nth-order Chebyshev polynomial calculated at the poi...
cheb1apDesign lowpass analog Chebyshev type I filter.
cheb1ordCompute the minimum filter order of a Chebyshev type I filter with the desire...
cheb2apDesign lowpass analog Chebyshev type II filter.
cheb2ordCompute the minimum filter order of a Chebyshev type II filter with the desir...
cheby1Generate a Chebyshev type I filter with RP dB of passband ripple.
cheby2Generate a Chebyshev type II filter with RS dB of stopband attenuation.
ellipGenerate an elliptic or Cauer filter with RP dB of passband ripple and RS dB ...
ellipapDesign lowpass analog elliptic filter.
ellipordCompute the minimum filter order of an elliptic filter with the desired respo...
iirlp2mb IIR Low Pass Filter to Multiband Filter Transformation
impinvarConverts analog filter with coefficients B and A to digital, conserving impul...
invimpinvarConverts digital filter with coefficients B and A to analog, conserving impul...
firpmDesigns a linear-phase FIR filter according to given specifications and the '...
firpmordEstimate the filter-order needed for ‘firpm’ to design a type-I or type-I...
ncauerAnalog prototype for Cauer filter.
pei_tseng_notchReturn coefficients for an IIR notch-filter with one or more filter frequenci...
sftransTransform band edges of a generic lowpass filter (cutoff at W=1) represented ...

FIR Filter Design

cl2bpConstrained L2 bandpass FIR filter design.
fir1Produce an order N FIR filter with the given frequency cutoff W, returning th...
fir2Produce an order N FIR filter with arbitrary frequency response M over freque...
firlsFIR filter design using least squares method.
kaiserordReturn the parameters needed to produce a filter of the desired specification...
qp_kaiserComputes a finite impulse response (FIR) filter for use with a quasi-perfect ...
remezParks-McClellan optimal FIR filter design.
sgolayComputes the filter coefficients for all Savitzsky-Golay smoothing filters of...

Transforms

bitrevorderReorder the elements of the vector X in bit-reversed order.
ccepsReturn the complex cepstrum of the vector X.
cplxrealSort the numbers Z into complex-conjugate-valued and real-valued elements.
cztChirp z-transform.
dctCompute the discrete cosine transform of X.
dct2Compute the 2-D discrete cosine transform of matrix X.
dctmtxReturn the DCT transformation matrix of size N-by-N.
dftmtxCompute the N-by-N Fourier transformation matrix.
digitrevorderReorder the elements of the vector X in digit-reversed order.
dstComputes the type I discrete sine transform of X.
dwtDiscrete wavelet transform (1D).
fhtCalculate the Fast Hartley Transform of real input D.
fwhtCompute the Walsh-Hadamard transform of X using the Fast Walsh-Hadamard Trans...
hilbertAnalytic extension of real valued signal.
idctCompute the inverse discrete cosine transform of X.
idct2Compute the inverse 2-D discrete cosine transform of matrix X.
idstComputes the inverse type I discrete sine transform of Y.
ifhtCalculate the inverse Fast Hartley Transform of real input D.
ifwhtCompute the inverse Walsh-Hadamard transform of X using the Fast Walsh-Hadama...
rcepsReturn the cepstrum of the signal X.

Power Spectrum Analysis

ar_psdCalculate the power spectrum of the autoregressive model
cohereEstimate (mean square) coherence of signals x and y.
cpsdEstimate cross power spectrum of data X and Y by the Welch (1967) periodogram...
csdEstimate cross power spectrum of data x and y by the Welch (1967) periodo...
db2powConvert decibels (dB) to power.
mscohereEstimate (mean square) coherence of signals X and Y.
pburgCalculate Burg maximum-entropy power spectral density.
pow2dbConvert power to decibels (dB).
pwelchEstimate power spectral density of data x by the Welch (1967) periodogram/F...
pyulearCalculates a Yule-Walker autoregressive (all-pole) model of the data x and ...
tfeEstimate transfer function of system with input x and output y.
tfestimateEstimate transfer function of system with input X and output Y.
__powerPlot the power spectrum of the given ARMA model.

Window Functions

barthannwinReturn the filter coefficients of a modified Bartlett-Hann window of length M.
blackmanharrisReturn the filter coefficients of a Blackman-Harris window of length M.
blackmannuttallReturn the filter coefficients of a Blackman-Nuttall window of length M.
bohmanwinReturn the filter coefficients of a Bohman window of length M.
boxcarReturn the filter coefficients of a rectangular window of length M.
chebwinReturn the filter coefficients of a Dolph-Chebyshev window of length M.
expwinReturn the coefficients of an exponential window(1) of length M.
flattopwinReturn the filter coefficients of a Flat Top window of length M.
gaussianReturn a Gaussian convolution window of length M.
gausswinReturn the filter coefficients of a Gaussian window of length M.
hannReturn the filter coefficients of a Hanning window of length M.
kaiserReturn the filter coefficients of a Kaiser window of length M.
nuttallwinReturn the filter coefficients of a Blackman-Harris window defined by Nuttall...
parzenwinReturn the filter coefficients of a Parzen window of length M.
poisswinReturn the coefficients of a Poisson (a.k.a. exponential) window(1) of lengt...
rectwinReturn the filter coefficients of a rectangular window of length M.
taylorwinReturn the coefficients of a Taylor window of length M, whose Fourier transfo...
triangReturn the filter coefficients of a triangular window of length M.
tukeywinReturn the filter coefficients of a Tukey window (also known as the cosine-ta...
ultrwinReturn the coefficients of an Ultraspherical window of length M.
welchwinReturn the filter coefficients of a Welch window of length M.
windowCreate an M-point window from the function F.

System Identification

arburgCalculate coefficients of an autoregressive (AR) model of complex data X usin...
aryuleFit an AR (P)-model with Yule-Walker estimates.
invfreqFit filter B(z)/A(z) or B(s)/A(s) to complex frequency response at frequency ...
invfreqsFit filter B(s)/A(s)to the complex frequency response H at frequency points F.
invfreqzFit filter B(z)/A(z)to the complex frequency response H at frequency points F.
levinsonUse the Durbin-Levinson algorithm to solve: toeplitz(acf(1:p)) * x = -acf(2:p...
lpcDetermines the forward linear predictor by minimizing the prediction error in...

Sample Rate Change

data2funCreate a vectorized function based on data samples using interpolation.
decimateDownsample the signal X by a reduction factor of Q.
downsampleDownsample the signal, selecting every Nth element.
interpUpsample the signal x by a factor of q, using an order 2*q*n+1 FIR filter.
resampleChange the sample rate of X by a factor of P/Q.
upfirdnUpsample, FIR filtering, and downsample.
upsampleUpsample the signal, inserting N-1 zeros between every element.

Pulse Metrics

statelevelsEstimate state-level for bilevel waveform A using histogram method

Utility

bufferBuffer a signal into a data frame.
clustersegmentCalculate boundary indexes of clusters of 1's.
fracshiftShift the series X by a (possibly fractional) number of samples D.
marcumqCompute the generalized Marcum Q function of order M with noncentrality param...
primitiveCalculate the primitive of a function.
sampled2continuousCalculate the x(t) reconstructed from samples x[n] sampled at a rate 1/T samp...
schtrigImplements a multisignal Schmitt trigger with levels LVL.
upsamplefillUpsamples a vector interleaving given values or copies of the vector elements.
wkeepExtract the elements of X of size L from the center, the right or the left.
wrevReverse the order of the element of the vector X.
zerocrossingEstimates the points at which a given waveform y=y(x) crosses the x-axis usin...