Why does the magnitude response of my filter have noise in the low-frequency range in Signal Processing Toolbox 6.4 (R14SP3)?

4 次查看(过去 30 天)
After designing a high-order filter (order 40) in FDATOOL, and exporting it to the workspace as "second-order sections" [SOS, G], I transform it into Transfer Function form using SOS2TF, and the magnitude response obtained is very different from what I designed in FDATOOL. Following is the code used to transform the data and display the resulting Magnitude response:
Fs=22050; % sample rate
%[B,A] = SOS2TF(SOS,G); doesn't work, but not the problem
[B,A] = sos2tf(SOS);
[H,W]=freqz(B,A,1000);
figure
plot(Fs*0.5*W/pi,10*log(abs(H)))
grid on;

采纳的回答

MathWorks Support Team
Converting from "second order sections" (SOS) to "transfer function" form (TF) using SOS2TF when the filter order is large, results in a magnitude response different than expected in Signal Processing Toolbox, because the convolutions required to convert from second-order sections to transfer function introduce large roundoff errors.
To work around this issue, create an "SOS filter object". This preserves the second-order sections. It is possible to use filter-related functions such as FREQZ on the object itself. For example, if Hd is the filter object, the following code
[H,W]=freqz(Hd,1000);
figure
plot(Fs*0.5*W/pi,10*log(abs(H)))
grid on;
will display the filter's magnitude response as it was designed. It is also possible to filter with the object directly:
y=filter(Hd,x); % This filters using the second-order sections.

更多回答(0 个)

标签

产品


版本

R14SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by