# Transforms

Fourier, chirp Z, DCT, Hilbert, cepstrum, Walsh-Hadamard

Signal Processing Toolbox™ provides functions that let you compute widely used forward and inverse transforms, including the fast Fourier transform (FFT), the discrete cosine transform (DCT), and the Walsh-Hadamard transform. Extract signal envelopes and estimate instantaneous frequencies using the analytic signal. Analyze signals in the time-frequency domain. Investigate magnitude-phase relationships, estimate fundamental frequencies, and detect spectral periodicity using the cepstrum. Compute discrete Fourier transforms using the second-order Goertzel algorithm.

## Functions

expand all

 `abs` Absolute value and complex magnitude `angle` Phase angle `fft` Fast Fourier transform `ifft` Inverse fast Fourier transform `fftshift` Shift zero-frequency component to center of spectrum `ifftshift` Inverse zero-frequency shift `dftmtx` Discrete Fourier transform matrix `fft2` 2-D fast Fourier transform `ifft2` 2-D inverse fast Fourier transform `instfreq` Estimate instantaneous frequency `czt` Chirp Z-transform `goertzel` Discrete Fourier transform with second-order Goertzel algorithm `dct` Discrete cosine transform `idct` Inverse discrete cosine transform
 `envelope` Signal envelope `fwht` Fast Walsh-Hadamard transform `ifwht` Inverse Fast Walsh-Hadamard transform `hilbert` Discrete-time analytic signal using Hilbert transform
 `emd` Empirical mode decomposition `fsst` Fourier synchrosqueezed transform `ifsst` Inverse Fourier synchrosqueezed transform `hht` Hilbert-Huang transform `instfreq` Estimate instantaneous frequency `kurtogram` Visualize spectral kurtosis `pkurtosis` Spectral kurtosis from signal or spectrogram `pentropy` Spectral entropy of signal `pspectrum` Analyze signals in the frequency and time-frequency domains `spectrogram` Spectrogram using short-time Fourier transform `xspectrogram` Cross-spectrogram using short-time Fourier transforms `stft` Short-time Fourier transform `stftmag2sig` Signal reconstruction from STFT magnitude `iscola` Determine whether window-overlap combination is COLA compliant `istft` Inverse short-time Fourier transform `tfridge` Time-frequency ridges `vmd` Variational mode decomposition `wvd` Wigner-Ville distribution and smoothed pseudo Wigner-Ville distribution `xwvd` Cross Wigner-Ville distribution and cross smoothed pseudo Wigner-Ville distribution
 `cceps` Complex cepstral analysis `icceps` Inverse complex cepstrum `rceps` Real cepstrum and minimum-phase reconstruction
 `bitrevorder` Permute data into bit-reversed order `digitrevorder` Permute input into digit-reversed order

## Topics

### Discrete Fourier and Cosine Transforms

Discrete Fourier Transform

Explore the primary tool of digital signal processing.

Chirp Z-Transform

Use the CZT to evaluate the Z-transform outside of the unit circle and to compute transforms of prime length.

Discrete Cosine Transform

Compute discrete cosine transforms and learn about their energy compaction properties.

DCT for Speech Signal Compression

Use the discrete cosine transform to compress speech signals.

Hilbert Transform

The Hilbert transform helps form the analytic signal.

Analytic Signal for Cosine

Determine the analytic signal for a cosine and verify its properties.

Envelope Extraction

Extract the envelope of a signal using the `hilbert` and `envelope` functions.

Analytic Signal and Hilbert Transform

Generate the analytic signal for a finite block of data using the `hilbert` function and an FIR Hilbert transformer.

Hilbert Transform and Instantaneous Frequency

Estimate the instantaneous frequency of a monocomponent signal using the Hilbert transform. Show that the procedure does not work for multicomponent signals.

Single-Sideband Amplitude Modulation

Perform single-sideband amplitude modulation of a signal using the Hilbert transform. Single-sideband AM signals have less bandwidth than normal AM signals.

Walsh-Hadamard Transform for Spectral Analysis and Compression of ECG Signals

Use an electrocardiogram signal to illustrate the Walsh-Hadamard transform.

### Cepstral Analysis

Complex Cepstrum — Fundamental Frequency Estimation

Use the complex cepstrum to estimate a speaker’s fundamental frequency. Compare the result with the estimate obtained with a zero-crossing method.

Cepstrum Analysis

Apply the complex cepstrum to detect echo in a signal.