Main Content

相位响应

MATLAB® 函数可用于提取滤波器的相位响应。在给定频率响应的情况下,函数 abs 返回幅值,angle 返回以弧度为单位的相位角。要查看巴特沃斯滤波器的幅值和相位,请使用:

d = designfilt("lowpassiir",FilterOrder=9, ...
    HalfPowerFrequency=0.4);
freqz(d)

Figure contains 2 axes objects. Axes object 1 with title Phase, xlabel Normalized Frequency (\times\pi rad/sample), ylabel Phase (degrees) contains an object of type line. Axes object 2 with title Magnitude, xlabel Normalized Frequency (\times\pi rad/sample), ylabel Magnitude (dB) contains an object of type line.

unwrap 函数在频率分析中也很有用。unwrap 根据需要对相位增减若干个 360° 以将其展开,使之在 360° 相位不连续点处保持连续。要了解 unwrap 的作用,请设计一个 25 阶低通 FIR 滤波器:

h = fir1(25,0.4);

freqz 获得频率响应,并以度为单位绘制相位:

[H,f] = freqz(h,1,512,2);
plot(f,angle(H)*180/pi)
grid

Figure contains an axes object. The axes object contains an object of type line.

很难将 360° 跳跃(由 angle 中反正切函数的定义导致)与 180° 跳跃(表示频率响应为零)区分开来。unwrap 可去除 360° 跳跃:

plot(f,unwrap(angle(H))*180/pi)

Figure contains an axes object. The axes object contains an object of type line.

您也可以使用 phasez 查看展开的相位:

phasez(h,1)

Figure contains an axes object. The axes object with title Phase Response, xlabel Normalized Frequency ( times pi blank rad/sample), ylabel Phase (radians) contains an object of type line.

另请参阅

| | | |