Signal Processing Toolbox    

Magnitude and Phase

MATLAB provides functions to extract magnitude and phase from a frequency response vector h. The function abs returns the magnitude of the response; angle returns the phase angle in radians. To extract and plot the magnitude and phase of a Butterworth filter.

The unwrap function is also useful in frequency analysis. unwrap unwraps the phase to make it continuous across 360º phase discontinuities by adding multiples of ±360°, as needed. To see how unwrap is useful, design a 25th-order lowpass FIR filter.

Obtain the filter's frequency response with freqz, and plot the phase in degrees.

It is difficult to distinguish the 360° jumps (an artifact of the arctangent function inside angle) from the 180° jumps that signify zeros in the frequency response.

Use unwrap to eliminate the 360° jumps.


 Analog Domain Delay