Main Content

List ofSignal Processing ToolboxFunctions that Support Code Generation

Code generation from MATLAB®is a restricted subset of the MATLAB language that provides optimizations for:

  • Generating efficient, production-quality C/C++ code and MEX files for deployment in desktop and embedded applications. For embedded targets, the subset restricts MATLAB semantics to meet the memory and data type requirements of the target environments.

Depending on which feature you wish to use, there are additional required products. For a comprehensive list, seeInstalling Prerequisite Products(MATLAB Coder).

Code generation from MATLAB supports Signal Processing Toolbox™ functions listed in the table. To generate C code, you must have theMATLAB Coder™software. If you have the Fixed-Point Designer™ software, you can usefiaccel(Fixed-Point Designer)to generate MEX code for fixed-point applications.

To follow the examples in this documentation:

  • To generate C/C++ code and MEX files withcodegen(MATLAB Coder), install theMATLAB Codersoftware, the Signal Processing Toolbox, and a C compiler. For the Windows®platform, MATLAB supplies a default C compiler. Runmex -setupat the MATLAB command prompt to set up the C compiler.

  • Change to a folder where you have write permission.

An asterisk (*) indicates that the reference page has usage notes and limitations for C/C++ code generation.

abs

Absolute value and complex magnitude

alignsignals

Align two signals by delaying earliest signal

angle

Phase angle

bandpower*

Band power

barthannwin

Modified Bartlett-Hann window

bartlett

Bartlett window

besselap*

Bessel analog lowpass filter prototype

bilinear

Bilinear transformation method for analog-to-digital filter conversion

binmask2sigroi

Convert binary mask to matrix of ROI limits

bitrevorder

Permute data into bit-reversed order

blackman

Blackman window

blackmanharris

Minimum four-term Blackman-Harris window

bohmanwin

Bohman window

buttap

Butterworth filter prototype

butter

Butterworth filter design

buttord*

Butterworth filter order and cutoff frequency

cceps

Complex cepstral analysis

cconv

Modulo-n circular convolution

cfirpm*

Complex and nonlinear-phase equiripple FIR filter design

cheb1ap*

Chebyshev Type I analog lowpass filter prototype

cheb1ord*

Chebyshev Type I filter order

cheb2ap*

Chebyshev Type II analog lowpass filter prototype

cheb2ord*

Chebyshev Type II filter order

chebwin

Chebyshev window

cheby1*

Chebyshev Type I filter design

cheby2*

Chebyshev Type II filter design

chirp

Swept-frequency cosine

conv*

卷积和多项式乘法

conv2

2-D convolution

convmtx

Convolution matrix

corrcoef*

Correlation coefficients

corrmtx

Data matrix for autocorrelation matrix estimation

cov*

Covariance

cpsd

Cross power spectral density

cummax

Cumulative maximum

cummin

Cumulative minimum

cusum*

Detect small changes in mean using cumulative sum

czt*

Chirp Z-transform

db2pow

Convert decibels to power

dct*

Discrete cosine transform

deconv*

Deconvolution and polynomial division

detrend*

Remove polynomial trend

dftmtx

Discrete Fourier transform matrix

diric

Dirichlet or periodic sinc function

downsample

Decrease sample rate by integer factor

dpss*

Discrete prolate spheroidal (Slepian) sequences

dtw

Distance between signals using dynamic time warping

edr

Edit distance on real signals

ellip*

Elliptic filter design

ellipap*

Elliptic analog lowpass filter prototype

ellipord*

Minimum order for elliptic filters

emd*

Empirical mode decomposition

enbw

Equivalent noise bandwidth

envelope*

Signal envelope

envspectrum*

Envelope spectrum for machinery diagnosis

eqtflength

Equalize lengths of transfer function's numerator and denominator

extendsigroi

Extend signal regions of interest to left and right

extractsigroi*

Extract signal regions of interest

falltime*

Fall time of negative-going bilevel waveform transitions

fft*

Fast Fourier transform

fft2*

2-D fast Fourier transform

fftfilt*

FFT-based FIR filtering using overlap-add method

fftshift

Shift zero-frequency component to center of spectrum

filloutliers*

Detect and replace outliers in data

filter*

1-D digital filter

filter2

2-D digital filter

filtfilt*

Zero-phase digital filtering

filtord

Filter order

finddelay

Estimate delay(s) between signals

findpeaks

Find local maxima

findsignal

Find signal location using similarity search

fir1

Window-based FIR filter design

fir2*

Frequency sampling-based FIR filter design

fircls*

Constrained-least-squares FIR multiband filter design

fircls1*

Constrained-least-squares linear-phase FIR lowpass and highpass filter design

firls

Least-squares linear-phase FIR filter design

firpm*

Parks-McClellan optimal FIR filter design

firpmord*

Parks-McClellan optimal FIR filter order estimation

flattopwin

Flat top weighted window

freqspace

Frequency spacing for frequency response

freqz*

Frequency response of digital filter

fsst*

Fourier synchrosqueezed transform

fwht

Fast Walsh-Hadamard transform

gauspuls

Gaussian-modulated sinusoidal RF pulse

gausswin

Gaussian window

gmonopuls

Gaussian monopulse

goertzel*

Discrete Fourier transform with second-order Goertzel algorithm

hamming

Hamming window

hann

Hann (Hanning) window

hht*

Hilbert-Huang transform

hilbert

Discrete-time analytic signal using Hilbert transform

icceps

Inverse complex cepstrum

idct*

Inverse discrete cosine transform

ifft*

Inverse fast Fourier transform

ifft2*

2-D inverse fast Fourier transform

ifftshift

Inverse zero-frequency shift

ifsst

Inverse Fourier synchrosqueezed transform

ifwht

Inverse Fast Walsh-Hadamard transform

instfreq*

Estimate instantaneous frequency

interp1*

1-D data interpolation (table lookup)

intfilt*

Interpolation FIR filter design

iscola

Determine whether window-overlap combination is COLA compliant

isoutlier*

Find outliers in data

istft*

Inverse short-time Fourier transform

kaiser

Kaiser window

kaiserord

Kaiser window FIR filter design estimation parameters

kurtogram*

Visualize spectral kurtosis

levinson*

Levinson-Durbin recursion

lp2bp

Transform lowpass analog filters to bandpass

lp2bs

Transform lowpass analog filters to bandstop

lp2hp

Transform lowpass analog filters to highpass

lp2lp

Change cutoff frequency for lowpass analog filter

lsf2poly

Convert line spectral frequencies to prediction filter coefficients

max*

Maximum elements of an array

maxflat*

Generalized digital Butterworth filter design

mean*

Average or mean value of array

meanfreq

Mean frequency

medfreq

Median frequency

median*

Median value of array

mergesigroi

Merge signal regions of interest

min*

Minimum elements of an array

movmad*

Moving median absolute deviation

movmedian

Moving median

mscohere

Magnitude-squared coherence

nuttallwin

Nuttall-defined minimum 4-term Blackman-Harris window

obw

Occupied bandwidth

orderspectrum

Average spectrum versus order for vibration signal

ordertrack*

Track and extract order magnitudes from vibration signal

orderwaveform

Extract time-domain order waveforms from vibration signal

parzenwin

Parzen (de la Vallée Poussin) window

pchip*

Piecewise Cubic Hermite Interpolating Polynomial (PCHIP)

peak2peak

Maximum-to-minimum difference

peak2rms

Peak-magnitude-to-RMS ratio

pentropy*

Spectral entropy of signal

periodogram

Periodogram power spectral density estimate

pkurtosis*

Spectral kurtosis from signal or spectrogram

plomb*

Lomb-Scargle periodogram

poly2ac*

Convert prediction filter polynomial to autocorrelation sequence

poly2lsf*

spe预测滤波器系数转换成线ctral frequencies

poly2rc*

Convert prediction filter polynomial to reflection coefficients

pow2db

Convert power to decibels

powerbw

Power bandwidth

pspectrum*

Analyze signals in the frequency and time-frequency domains

pulstran*

Pulse train

pwelch

Welch's power spectral density estimate

rainflow*

Rainflow counts for fatigue analysis

randn*

Normally distributed random numbers

rc2ac*

Convert reflection coefficients to autocorrelation sequence

rc2poly*

Convert reflection coefficients to prediction filter polynomial

rceps

Real cepstrum and minimum-phase reconstruction

rcosdesign*

Raised cosine FIR pulse-shaping filter design

rectpuls

Sampled aperiodic rectangle

rectwin

Rectangular window

removesigroi

Remove signal regions of interest

resample*

Resample uniform or nonuniform data to new fixed rate

risetime*

Rise time of positive-going bilevel waveform transitions

rlevinson*

Reverse Levinson-Durbin recursion

rms

Root-mean-square level

rpmfreqmap

Frequency-RPM map for order analysis

rpmordermap

Order-RPM map for order analysis

rssq*

Root-sum-of-squares level

sawtooth

Sawtooth or triangle wave

sfdr*

Spurious free dynamic range

sgolay

Savitzky-Golay filter design

sgolayfilt

Savitzky-Golay filtering

shortensigroi

Shorten signal regions of interest from left and right

sigroi2binmask

Convert matrix of ROI limits to binary mask

sin

Sine of argument in radians

sinad*

Signal to noise and distortion ratio

sinc

Sinc function

smoothdata*

Smooth noisy data

snr*

Signal-to-noise ratio

sos2tf

Convert digital filter second-order section data to transfer function form

sosfilt

Second-order (biquadratic) IIR digital filtering

spectrogram*

Spectrogram using short-time Fourier transform

spline*

Cubic spline data interpolation

square

Square wave

statelevels

State-level estimation for bilevel waveform with histogram method

std*

Standard deviation

stft

Short-time Fourier transform

stftmag2sig

Signal reconstruction from STFT magnitude

tachorpm*

Extract RPM signal from tachometer pulses

taylorwin

Taylor window

tf2ss

Convert transfer function filter parameters to state-space form

tfestimate*

Transfer function estimate

tfridge*

Time-frequency ridges

thd*

Total harmonic distortion

toi*

Third-order intercept point

triang

Triangular window

tripuls

Sampled aperiodic triangle

tsa*

Time-synchronous signal average

tukeywin

Tukey (tapered cosine) window

unwrap*

Shift phase angles

upfirdn

Upsample, apply FIR filter, and downsample

upsample

Increase sample rate by integer factor

var*

Variance

vmd*

Variational mode decomposition

wvd*

Wigner-Ville distribution and smoothed pseudo Wigner-Ville distribution

xcorr*

Cross-correlation

xcorr2

2-D cross-correlation

xcov

Cross-covariance

xspectrogram*

Cross-spectrogram using short-time Fourier transforms

xwvd*

Cross Wigner-Ville distribution and cross smoothed pseudo Wigner-Ville distribution

yulewalk*

Recursive digital filter design

zp2ss

Convert zero-pole-gain filter parameters to state-space form

zp2tf

Convert zero-pole-gain filter parameters to transfer function form