Signal Processing Toolbox Previous page   Next Page

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 click the Magnitude and Phase Response button on the toolbar or select Magnitude and Phase Response from the Analysis menu to display the plot.

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 phasez to see the unwrapped phase.


Previous page  Analog Domain Delay Next page

© 1994-2005 The MathWorks, Inc.