我想知道为什么 GNU Octave 的以下代码在频域中的幅度为 2。例如,在图 1 中。(抱歉,我显然不允许发布图像!)可以看出带通巴特沃斯滤波器的-3dB点在150和300Hz,而不是设计要求的300和600Hz。我真的看不出我做错了吗?
%Start from nothing!
clear;
% Set the sampling frequency used by our digital filtering system:
fs=8000;
% Start designing a butterworth filter, passband. (In Hz)
pass_lo = 300;
pass_hi = 600;
% The order of the filter
order = 4;
% Determine the low and high frequencies of the passband as fractions of the
% sampling rate:
flo = pass_lo/fs;
fhi = pass_hi/fs;
% Use the butterworth filter design function to get the coefficients for a
% bandpass filter with the settings above:
[b,a] = butter(order, [flo fhi]);
% Determine the frequency response of the filter design above. Get the output
% in frequency rather than rad/s. Use 512 plot points.
[H,f] = freqz(b, a, 512, fs);
% Plot the result so that we can see if it is correct:
figure(1);
plot(f, 20*log10(abs(H)));
xlabel('Frequency (Hz)');
ylabel('Magnitude (dB)');