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 the magnitude and phase of a Butterworth filter:
and then click the Magnitude and Phase Response toolbar button:
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.
unwrap
eliminates the 360° jumps:
or you can use fvtool
to see the unwrapped phase:
![]() | Analog Domain | Delay | ![]() |