转:群延迟函数(group delay function)

标签:
教育 |
http://www.dsprelated.com/blogimages/RickLyons/Group_Delay_Eq_1.jpgdelay
在公式(1),
http://www.dsprelated.com/blogimages/RickLyons/Group_Delay_Eq_2.jpgdelay
用公式 (2)
http://www.dsprelated.com/blogimages/RickLyons/Group_Delay_Eq_3.jpgdelay
对公式(3)的右边第一项进行求导展开,得到如下的形式:
http://www.dsprelated.com/blogimages/RickLyons/Group_Delay_Eq_4.jpgdelay
对等式(4)两边同时除以j/ejΦ(ω) 得到如下等式:
http://www.dsprelated.com/blogimages/RickLyons/Group_Delay_Eq_5.jpgdelay
从上面的等式(5)我们能得到什么呢?通过观察,我们发现如下熟悉的项:
- jd[H(ω)]/dω
=
n·h(n) 的DTFT -
M(ω)•ejΦ(ω)
=H(ω) =h(n) DDTFT - –d[Φ(ω)]/dω =
群延迟滤波器(group delay of the filter )
用DFT代替DTFT可以得到计算群延迟数字滤波器的公式:
http://www.dsprelated.com/blogimages/RickLyons/Group_Delay_Eq_7.jpgdelay
从上面的公式看出,计算群延迟滤波器的过程。公式(7)是传统群延迟算法对相位进行解卷的过程。需要注意的是DFT[h(n)]值为0的情况。
下面用Matlab演示公式
-
clear,
clc -
Npts
= 128; % 画图点数 -
B = [0.03, 0.0605, 0.121, 0.0605, 0.03]; -
A = [1, -1.194, 0.436]; -
-
Imp_Resp_Length = 40; -
[Imp_Resp,n] = impz(B,A,Imp_Resp_Length); -
ImpResp_times_Time = Imp_Resp.*n; -
[Freq_Resp, W] = freqz(Imp_Resp, 1, Npts, 'whole'); -
[Deriv_of_Freq_Resp, W] = freqz(ImpResp_times_Time, ... -
1, Npts, 'whole'); -
-
Grp_Delay = real(Deriv_of_Freq_Resp./Freq_Resp); -
%[gdm,
fgm] = grpdelay(B,A,Npts,'whole');gdm=Grp_Delay,w=fgm(rad) % Compute Group Delay -
Grp_Delay = fftshift(Grp_Delay);% 将序列中后半部分循环移动到前面 -
Freq = (W-pi)/(2*pi); % 频率轴 -
figure(1), clf -
subplot(2,1,1) -
plot(n, Imp_Resp, '-ks', ... -
n, ImpResp_times_Time, '-bs', 'markersize', 4) -
legend('h(n)','n times h(n)'); -
ylabel('Amplitude'), xlabel('n'), grid on, zoom on -
subplot(2,1,2) -
plot(Freq, Grp_Delay,'-rs', 'markersize', 4) -
ylabel('Group Delay (samples)') -
xlabel('Freq x Fs (Fs = sample rate)') -
grid on, zoom on