How do you design a filter cascade with 4 filters total?

11 visualizzazioni (ultimi 30 giorni)
I am looking to pass raw time-series data through a sequence of 4 filters. I've attempted to construct a filter cascade using the DSP Systems Toolbox, but the resulting Bode diagram doesn't make sense. Additionally, the filtered signal has a considerable reduction in amplitude (~10000x smaller than the original). I am assuming there is a way to correct this in the gain settings?
I would ideally like to combine filters H2 & H3 to act as one bandpass filter and H1 and H4 as another. I chose to employ four distinct HP/LP filters, rather than 2 bandpass filters, because they have different orders. Let me know if I need to clarify anything. Thanks.
H1 = dsp.LowpassFilter('FilterType', 'IIR','FilterOrder',3, 'NormalizedFrequency', false, 'PassbandFrequency', 85, 'StopbandFrequency', 95, 'SampleRate', 500, 'DesignForMinimumOrder', false);
H2 = dsp.LowpassFilter('FilterType', 'IIR','FilterOrder',1, 'NormalizedFrequency', false, 'PassbandFrequency', 120, 'StopbandFrequency', 130, 'SampleRate', 500, 'DesignForMinimumOrder', false);
H3 = dsp.HighpassFilter('FilterType', 'IIR','FilterOrder',2, 'NormalizedFrequency', false, 'StopbandFrequency', 0.1, 'PassbandFrequency', 1, 'SampleRate', 500, 'DesignForMinimumOrder', false);
H4 = dsp.HighpassFilter('FilterType', 'IIR','FilterOrder',1, 'NormalizedFrequency', false, 'StopbandFrequency', 0.1, 'PassbandFrequency', 4, 'SampleRate', 500, 'DesignForMinimumOrder', false);
Final_Filter = dsp.FilterCascade(H2,H3, H1, H4);
  3 Commenti
Paul
Paul il 1 Apr 2024
Would be helpful to get more information, like why you think the Bode diagram doesn't make sense, and the input for which you think the output is incorrect.
Also, when I ran this in 2022a, all four calls resulted in the warning:
Warning: The StopbandFrequency property is not relevant in this configuration of the System object.
Do you see that as well? If so, it might be a clue that that H1-H4 might not be yielding the expecte responses. Hard to say without knowing more on what the end goal is.
Sam Chak
Sam Chak il 1 Apr 2024
@G, The order of the IIR filter is probably too low to meets the filter design specifications. If it is acceptable to let the DSP to auto-design the minimum order filter that meets the filter design specifications, then try the following:
H1 = dsp.LowpassFilter('FilterType', 'IIR', ...
'DesignForMinimumOrder', true, ...
'PassbandFrequency', 85, ...
'StopbandFrequency', 95, ...
'SampleRate', 500)
H2 = dsp.LowpassFilter('FilterType', 'IIR', ...
'DesignForMinimumOrder', true, ...
'PassbandFrequency', 120, ...
'StopbandFrequency', 130, ...
'SampleRate', 500)
H3 = dsp.HighpassFilter('FilterType', 'IIR', ...
'DesignForMinimumOrder', true, ...
'PassbandFrequency', 1, ...
'StopbandFrequency', 0.1, ...
'SampleRate', 500)
H4 = dsp.HighpassFilter('FilterType', 'IIR', ...
'DesignForMinimumOrder', true, ...
'PassbandFrequency', 4, ...
'StopbandFrequency', 0.1, ...
'SampleRate', 500)
Final_Filter = dsp.FilterCascade(H2, H3, H1, H4)

Accedi per commentare.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by