Code generation from MATLAB®is a restricted subset of the MATLAB language that provides optimizations for:
生成高效,生产质量C / C ++代码和MEX文件,用于部署桌面和嵌入式应用程序。对于嵌入式目标,子集限制了MATLAB语义,以满足目标环境的内存和数据类型要求。
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
to generate MEX code for fixed-point applications.
To follow the examples in this documentation:
To generate C/C++ code and MEX files withcodegen
, install theMATLAB Codersoftware, the Signal Processing Toolbox, and a C compiler. For the Windows®platform, MATLAB supplies a default C compiler. Runmex-setup.
at 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.
Absolute value and complex magnitude |
|
Align two signals by delaying earliest signal |
|
Phase angle |
|
Band power |
|
Modified Bartlett-Hann window |
|
Bartlett window |
|
贝塞尔模拟低通滤波器原型 |
|
Bilinear transformation method for analog-to-digital filter conversion |
|
Permute data into bit-reversed order |
|
Blackman window |
|
Minimum four-term Blackman-Harris window |
|
Bohman window |
|
Butterworth filter prototype |
|
Butterworth滤镜设计 |
|
Butterworth filter order and cutoff frequency |
|
Complex cepstral analysis |
|
Modulo-n circular convolution |
|
复杂和非线性相位平均灭菌滤波器设计 |
|
Chebyshev Type I analog lowpass filter prototype |
|
Chebyshev Type I filter order |
|
Chebyshev Type II analog lowpass filter prototype |
|
Chebyshev Type II filter order |
|
Chebyshev window |
|
Chebyshev Type I filter design |
|
Chebyshev Type II filter design |
|
Swept-frequency cosine |
|
|
Convolution and polynomial multiplication |
2-D卷积 |
|
Convolution matrix |
|
Correlation coefficients |
|
Data matrix for autocorrelation matrix estimation |
|
|
Covariance |
Cross power spectral density |
|
Cumulative maximum |
|
Cumulative minimum |
|
|
Chirp Z-Transform |
Convert decibels to power |
|
|
Discrete cosine transform |
Deconvolution and polynomial division |
|
Remove polynomial trend |
|
Discrete Fourier transform matrix |
|
Dirichlet or periodic sinc function |
|
Decrease sample rate by integer factor |
|
Discrete prolate spheroidal (Slepian) sequences |
|
使用动态时间翘曲信号之间的距离 |
|
椭圆滤波器设计 |
|
Elliptic analog lowpass filter prototype |
|
Minimum order for elliptic filters |
|
Empirical mode decomposition |
|
Equivalent noise bandwidth |
|
Signal envelope |
|
用于机械诊断的信封谱 |
|
均衡传输函数的分子和分母的长度 |
|
|
Fast Fourier transform |
2-D fast Fourier transform |
|
FFT-based FIR filtering using overlap-add method |
|
Shift zero-frequency component to center of spectrum |
|
Detect and replace outliers in data |
|
|
1-D digital filter |
2-D digital filter |
|
Zero-phase digital filtering |
|
Filter order |
|
Estimate delay(s) between signals |
|
Find local maxima |
|
Window-based FIR filter design |
|
|
Frequency sampling-based FIR filter design |
Constrained-least-squares FIR multiband filter design |
|
Constrained-least-squares linear-phase FIR lowpass and highpass filter design |
|
Least-squares linear-phase FIR filter design |
|
Parks-McClellan optimal FIR filter design |
|
Parks-McClellan最佳FIR滤波器订购估算 |
|
Flat top weighted window |
|
频率响应频率间距 |
|
Frequency response of digital filter |
|
Fourier synchrosqueezed transform |
|
Fast Walsh-Hadamard transform |
|
Gaussian-modulated sinusoidal RF pulse |
|
高斯窗口 |
|
Gaussian monopulse |
|
Discrete Fourier transform with second-order Goertzel algorithm |
|
Hamming window |
|
Hann (Hanning) window |
|
|
Hilbert-Huang transform |
Discrete-time analytic signal using Hilbert transform |
|
Inverse complex cepstrum |
|
|
Inverse discrete cosine transform |
|
Inverse fast Fourier transform |
2-D inverse fast Fourier transform |
|
Inverse zero-frequency shift |
|
Inverse Fourier synchrosqueezed transform |
|
Inverse Fast Walsh-Hadamard transform |
|
1-D data interpolation (table lookup) |
|
Interpolation FIR filter design |
|
Determine whether window-overlap combination is COLA compliant |
|
查找数据中的异常值 |
|
Inverse short-time Fourier transform |
|
Kaiser window |
|
Kaiser window FIR filter design estimation parameters |
|
Visualize spectral kurtosis |
|
|
Levinson-Durbin recursion |
Transform lowpass analog filters to bandpass |
|
Transform lowpass analog filters to bandstop |
|
Transform lowpass analog filters to highpass |
|
Change cutoff frequency for lowpass analog filter |
|
Convert line spectral frequencies to prediction filter coefficients |
|
|
Maximum elements of an array |
Generalized digital Butterworth filter design |
|
|
Average or mean value of array |
Mean frequency |
|
Median frequency |
|
Median value of array |
|
|
Minimum elements of an array |
移动中位绝对偏差 |
|
Moving median |
|
Magnitude-squared coherence |
|
Nuttall定义的最小4术语Blackman-Harris窗口 |
|
占领带宽 |
|
Parzen (de la Vallée Poussin) window |
|
Piecewise Cubic Hermite Interpolating Polynomial (PCHIP) |
|
Maximum-to-minimum difference |
|
Peak-magnitude-to-RMS ratio |
|
Periodogram power spectral density estimate |
|
Lomb-Scargle periodogram |
|
Convert prediction filter polynomial to autocorrelation sequence |
|
spe预测滤波器系数转换成线ctral frequencies |
|
Convert prediction filter polynomial to reflection coefficients |
|
Convert power to decibels |
|
Power bandwidth |
|
分析频率和时频域中的信号 |
|
Pulse train |
|
Welch's power spectral density estimate |
|
Rainflow counts for fatigue analysis |
|
Normally distributed random numbers |
|
将反射系数转换为自相关序列 |
|
Convert reflection coefficients to prediction filter polynomial |
|
Real cepstrum and minimum-phase reconstruction |
|
Raised cosine FIR pulse-shaping filter design |
|
Sampled aperiodic rectangle |
|
Rectangular window |
|
Resample uniform or nonuniform data to new fixed rate |
|
Reverse Levinson-Durbin recursion |
|
Root-mean-square level |
|
Sawtooth or triangle wave |
|
|
虚假的自由动态范围 |
Savitzky-Golay filter design |
|
Savitzky-Golay filtering |
|
Sine of argument in radians |
|
Sinc function |
|
Smooth noisy data |
|
Convert digital filter second-order section data to transfer function form |
|
Second-order (biquadratic) IIR digital filtering |
|
Spectrogram using short-time Fourier transform |
|
Cubic spline data interpolation |
|
Square wave |
|
|
Standard deviation |
Short-time Fourier transform |
|
Taylor window |
|
sta转换传递函数滤波器参数te-space form |
|
Transfer function estimate |
|
Time-frequency ridges |
|
Triangular window |
|
Sampled aperiodic triangle |
|
|
Time-synchronous signal average |
Tukey (tapered cosine) window |
|
|
Shift phase angles |
Upsample, apply FIR filter, and downsample |
|
Increase sample rate by integer factor |
|
|
方差 |
|
Wigner-Ville distribution and smoothed pseudo Wigner-Ville distribution |
交叉相关 |
|
2-D交叉相关 |
|
Cross-covariance |
|
使用短时傅里叶变换的跨谱图 |
|
|
十字Wigner-Ville分销和交叉平滑伪Wigner-Ville分布 |
Recursive digital filter design |
|
Convert zero-pole-gain filter parameters to state-space form |
|
Convert zero-pole-gain filter parameters to transfer function form |