Why are magnitude/phase delay responses from filterbuilder different from freqz and phasedelay?
1 次查看(过去 30 天)
显示 更早的评论
Thank you in advance!
I am using filterbuilder to design a low pass filter with very tight specifications for magnitude and phase delay relative to 1300 Hz. Eventually I'd like to use the filter to produce data and send the data through a digital to analog device. The responses available through the filterbuilder GUI are too limited to check the filter against the specs. For that reason, I would like to be able to reproduce the responses of the filter and plot them with the overlays of the specifications. The passband should be 0 - 2000 Hz and the cutoff should be at 4000 Hz. This will be used to produce analog data, hence the high sample rate of 1 Meg/sec. The freqz function gives the complex filter response so I convert the magnitude into dB. The resulting magnitude differs from the filterbuilder magnitude by about 3 dB. Also, the phasedelay is off by a constant of approx. 1.69. Which do I believe? If the filterbuilder is correct, how can I access the data from the plots? I would prefer to be able to reproduce the plots on my own, however. Here is the code I am using to produce the responses:
function fit = testFilter(Hlp)
[H,f] = freqz(Hlp,500000,1000000); [phi,f2] = phasedelay(Hlp,500000,1000000); H_dB = 10*log(abs(H));
f_mag_tol = [ 0,... 1290,... 1300,... 1310,... 2000,... 2500,... 3750];
mag_tol_min = [-1,... -1,... -0.7,... -1,... -1,... -40,... -100];
mag_tol_max = [ 0,... 0,... -0.3,... 0,... 0,... -6,... -35];
figure(2); plot(f(1:4000),HdB(1:4000),'-k',f_mag_tol,mag_tol_min,':',f_mag_tol,mag_tol_max,':') title('Amplitude Response') xlabel('Frequency (Hz)') ylabel('Gain')
figure(3); plot(f(1:4000),phi(1:4000),'-k') title('Phase Delay') xlabel('Frequency (Hz)') ylabel('Phase Delay')
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multirate Signal Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!