Application of multistage decimator filter to signal

Dear all
We had a piece of code to decimate data (decimation ratio (dec_factor) > 13) that read:
Hfd=fdesign.decimator(dec_factor,'Nyquist');
Hm=design(Hfd,'multistage');
signal_output=filter(Hm,signal_input);
Matlad is warning that
Warning: Multistage design using fdesign.decimator will be removed. Use designMultistageDecimator instead.
So we are replacing the codewith:
Astop = 80;
TW = 0.03*fs_sampling/2;
Hm=designMultistageDecimator(dec_factor,fs_sampling,TW,Astop,'CostMethod','design');
We don´t know what to do with Hm in order to apply the filter to get signal_input.
Any ideas?
Thanks in advance

Answers (2)

The 'designMultistageDecimator' function in MATLAB returns a multistage decimator object, which you can use to filter your signal. The returned object 'Hm' is a multistage decimator object, and you can use it just like you used the 'Hm' object in your previous code.
Here’s how you can apply the filter to your signal:
signal_output = filter(Hm, signal_input);
This line of code applies the multistage decimator filter Hm to your input signal signal_input, and stores the result in 'signal_output'.
So, your complete code would look like this:
Astop = 80;
TW = 0.03*fs_sampling/2;
Hm = designMultistageDecimator(dec_factor, fs_sampling, TW, Astop, 'CostMethod', 'design');
signal_output = filter(Hm, signal_input);

4 Comments

Good morning,
Upon running this code, I encounter the following error:
Error using filter
Not enough input arguments.
Error in decimation_v1 (line 89)
signal_output =filter(Hm, signal_input);
Thanks
Good morning,
The error message suggests that the filter function is not receiving the expected number of input arguments. This is because the 'signal_input' variable not being defined or accessible in the scope where the filter function is called.
Please ensure that 'signal_input' is defined and contains the signal data you want to decimate.
If 'signal_input' is defined in a different function or script, you might need to pass it as an argument or declare it as a global variable. If 'signal_input' is supposed to be loaded from a file, make sure the file loading operation is successful and the data is correctly assigned to 'signal_input'.
Thanks!
Thank you for your response.
I will incorporate a portion of the signal we're utilising, enabling to observe the errors that we had:
signal_input=[0,-0.0839259010589917,-0.00762962736899908,-0.129703665272988,0.00762962736899908,-0.0839259010589917,-0.0152592547379982,-0.129703665272988,0,-0.0991851557969898,-0.0228888821069972,-0.137333292641987,-0.00762962736899908,-0.0915555284279908,-0.0228888821069972,-0.137333292641987,-0.00762962736899908,-0.0991851557969898,-0.0152592547379982,-0.129703665272988,-0.00762962736899908,-0.0991851557969898,-0.0152592547379982,-0.129703665272988,0,-0.0915555284279908,-0.00762962736899908,-0.122074037903989,0.00762962736899908,-0.0839259010589917,-0.00762962736899908,-0.114444410534988,0.00762962736899908,-0.0915555284279908,-0.00762962736899908,-0.122074037903989,0.00762962736899908,-0.0915555284279908,0,-0.114444410534988,0.00762962736899908,-0.0915555284279908,0,-0.114444410534988,0.00762962736899908,-0.0915555284279908,0.00762962736899908,-0.106814783165989,0.0152592547379999,-0.0915555284279908,0,-0.106814783165989,0.0152592547379999,-0.0839259010589917,0.00762962736899908,-0.0991851557969898,0.0228888821069990,-0.0839259010589917,0.00762962736899908,-0.0991851557969898,0.0152592547379999,-0.0839259010589917,0.00762962736899908,-0.0991851557969898,0.0152592547379999,-0.0915555284279908,0.0152592547379999,-0.0915555284279908,0.0228888821069990,-0.0839259010589917,0.0152592547379999,-0.0915555284279908,0.0152592547379999,-0.0991851557969898,0,-0.0915555284279908,0.0305185094759981,-0.0762962736899926,0.0305185094759981,-0.0610370189519944,0.0534073915829953,-0.0686666463209935,0.0228888821069990,-0.0839259010589917,0.0228888821069990,-0.0915555284279908,0.0152592547379999,-0.0839259010589917,0.0305185094759981,-0.0839259010589917,0.0228888821069990,-0.0839259010589917,0.0305185094759981,-0.0915555284279908,0.0228888821069990,-0.0839259010589917,0.0305185094759981,-0.0915555284279908,0.0152592547379999,-0.0839259010589917,0.0305185094759981,-0.0915555284279908,0.0228888821069990,-0.0686666463209935,0.0381481368449972,-0.0839259010589917,0.0305185094759981,-0.0686666463209935,0.0381481368449972,-0.0686666463209935,0.0381481368449972,-0.0610370189519944,0.0534073915829953,-0.0534073915829953,0.0534073915829953,-0.0610370189519944,0.0610370189519944,-0.0457777642139945,0.0534073915829953,-0.0534073915829953,0.0686666463209935,-0.0381481368449954,0.0534073915829953,-0.0534073915829953,0.0534073915829953,-0.0457777642139945,0.0457777642139963,-0.0762962736899926,0.0457777642139963,-0.0457777642139945,0.0305185094759981,-0.0915555284279908,0.0381481368449972,-0.0534073915829953,0.0381481368449972,-0.0915555284279908,0.0381481368449972,-0.0534073915829953,0.0381481368449972,-0.0839259010589917,0.0381481368449972,-0.0534073915829953,0.0381481368449972,-0.0839259010589917,0.0457777642139963,-0.0534073915829953,0.0457777642139963,-0.0839259010589917,0.0534073915829953,-0.0457777642139945,0.0457777642139963,-0.0762962736899926,0.0534073915829953,-0.0457777642139945,0.0457777642139963,-0.0762962736899926,0.0534073915829953,-0.0457777642139945,0.0457777642139963,-0.0686666463209935,0.0534073915829953,-0.0457777642139945,0.0534073915829953,-0.0686666463209935,0.0534073915829953,-0.0457777642139945,0.0534073915829953,-0.0686666463209935,0.0534073915829953,-0.0457777642139945,0.0457777642139963,-0.0610370189519944,0.0610370189519944,-0.0381481368449954,0.0686666463209935,-0.0457777642139945,0.0686666463209935,-0.0305185094759963,0.0762962736899944,-0.0457777642139945,0.0686666463209935,-0.0381481368449954,0.0610370189519944,-0.0534073915829953,0.0762962736899944,-0.0381481368449954,0.0686666463209935,-0.0457777642139945,0.0686666463209935,-0.0381481368449954,0.0686666463209935,-0.0457777642139945,0.0686666463209935,-0.0457777642139945,0.0534073915829953,-0.0534073915829953,0.0762962736899944,-0.0305185094759963,0.0762962736899944,-0.0305185094759963,0.0915555284279925,-0.0305185094759963,0.0686666463209935,-0.0457777642139945,0.0610370189519944,-0.0457777642139945,0.0610370189519944,-0.0534073915829953,0.0534073915829953,-0.0534073915829953,0.0610370189519944,-0.0534073915829953,0.0610370189519944,-0.0457777642139945,0.0610370189519944,-0.0457777642139945,0.0610370189519944,-0.0534073915829953,0.0610370189519944,-0.0457777642139945,0.0610370189519944,-0.0534073915829953,0.0610370189519944,-0.0457777642139945,0.0610370189519944,-0.0534073915829953,0.0610370189519944,-0.0457777642139945,0.0686666463209935,-0.0534073915829953,0.0610370189519944,-0.0381481368449954,0.0686666463209935,-0.0457777642139945,0.0762962736899944,-0.0305185094759963,0.0839259010589935,-0.0305185094759963,0.0839259010589935,-0.0305185094759963,0.0915555284279925,-0.0152592547379982,0.0839259010589935,-0.0381481368449954,0.0839259010589935,-0.0305185094759963,0.0762962736899944,-0.0534073915829953,0.0610370189519944,-0.0457777642139945,0.0534073915829953,-0.0610370189519944,0.0534073915829953,-0.0381481368449954,0.0534073915829953,-0.0762962736899926,0.0534073915829953,-0.0381481368449954,0.0534073915829953,-0.0839259010589917,0.0610370189519944,-0.0381481368449954,0.0534073915829953,-0.0762962736899926,0.0610370189519944,-0.0381481368449954,0.0534073915829953,-0.0762962736899926,0.0610370189519944,-0.0381481368449954,0.0610370189519944,-0.0686666463209935,0.0610370189519944,-0.0381481368449954,0.0610370189519944,-0.0686666463209935,0.0686666463209935,-0.0305185094759963,0.0686666463209935,-0.0610370189519944,0.0610370189519944,-0.0381481368449954,0.0686666463209935,-0.0534073915829953,0.0686666463209935,-0.0228888821069972,0.0686666463209935,-0.0610370189519944,0.0762962736899944,-0.0228888821069972,0.0762962736899944,-0.0534073915829953,0.0762962736899944,-0.0228888821069972,0.0839259010589935,-0.0457777642139945,0.0839259010589935,-0.0152592547379982,0.0839259010589935,-0.0457777642139945,0.0762962736899944,-0.0305185094759963,0.0762962736899944,-0.0457777642139945,0.0762962736899944,-0.0228888821069972,0.0839259010589935,-0.0457777642139945,0.0686666463209935,-0.0305185094759963,0.0762962736899944,-0.0457777642139945,0.0762962736899944,-0.0381481368449954,0.0610370189519944,-0.0534073915829953,0.0762962736899944,-0.0152592547379982,0.0915555284279925,-0.0228888821069972,0.106814783165991,0,0.0915555284279925,-0.0381481368449954,0.0839259010589935,-0.0152592547379982,0.0839259010589935,-0.0457777642139945,0.0762962736899944,-0.0228888821069972,0.0762962736899944,-0.0457777642139945,0.0839259010589935,-0.0305185094759963,0.0839259010589935,-0.0457777642139945,0.0762962736899944,-0.0305185094759963,0.0762962736899944,-0.0457777642139945,0.0762962736899944,-0.0305185094759963,0.0839259010589935,-0.0457777642139945,0.0839259010589935,-0.0228888821069972,0.0839259010589935,-0.0381481368449954,0.0839259010589935,-0.0228888821069972,0.0915555284279925,-0.0305185094759963,0.0839259010589935,-0.0152592547379982,0.0915555284279925,-0.0228888821069972,0.0991851557969916,-0.00762962736899908,0.0991851557969916,-0.0152592547379982,0.106814783165991,-0.00762962736899908,0.106814783165991,-0.0152592547379982,0.0991851557969916,-0.00762962736899908,0.0991851557969916,-0.0228888821069972,0.0915555284279925,-0.0228888821069972,0.0839259010589935,-0.0381481368449954,0.0839259010589935,-0.0228888821069972,0.0839259010589935,-0.0381481368449954,0.0839259010589935,-0.0305185094759963,0.0839259010589935,-0.0381481368449954,0.0839259010589935,-0.0228888821069972,0.0839259010589935,-0.0305185094759963,0.0839259010589935,-0.0228888821069972,0.0839259010589935,-0.0305185094759963,0.0839259010589935,-0.0228888821069972,0.0839259010589935,-0.0305185094759963,0.0839259010589935,-0.0228888821069972,0.0915555284279925,-0.0305185094759963,0.0915555284279925,-0.0305185094759963,0.0915555284279925,-0.0228888821069972,0.0839259010589935,-0.0305185094759963,0.0839259010589935,-0.0305185094759963,0.0839259010589935,-0.0305185094759963,0.0915555284279925,-0.0228888821069972,0.0915555284279925,-0.0228888821069972,0.0915555284279925,-0.0305185094759963,0.0915555284279925,-0.0228888821069972,0.0915555284279925,-0.0305185094759963,0.0915555284279925,-0.0228888821069972,0.0991851557969916,-0.0152592547379982,0.0991851557969916,-0.0228888821069972,0.0915555284279925,-0.0228888821069972,0.0915555284279925,-0.0305185094759963,0.0915555284279925,-0.0228888821069972,0.0915555284279925,-0.0228888821069972,0.0915555284279925,-0.0228888821069972,0.0991851557969916,-0.0305185094759963,0.0915555284279925,-0.0305185094759963,0.0762962736899944,-0.0381481368449954,0.0915555284279925,-0.0152592547379982,0.0991851557969916,-0.0152592547379982,0.122074037903989,0.00762962736899908,0.114444410534990,-0.0228888821069972,0.0991851557969916,-0.0152592547379982,0.0991851557969916,-0.0305185094759963,0.0915555284279925,-0.0228888821069972,0.0839259010589935,-0.0381481368449954,0.0915555284279925,-0.0228888821069972,0.0915555284279925,-0.0228888821069972,0.0915555284279925,-0.0152592547379982,0.0991851557969916,-0.0228888821069972,0.0915555284279925,-0.0152592547379982,0.0915555284279925,-0.0305185094759963,0.0915555284279925,-0.0152592547379982,0.0915555284279925,-0.0228888821069972,0.0991851557969916,-0.0152592547379982,0.0991851557969916,-0.0228888821069972,0.0991851557969916,-0.00762962736899908,0.106814783165991,-0.00762962736899908,0.106814783165991,-0.00762962736899908,0.114444410534990,0.0152592547379999,0.122074037903989,0,0.122074037903989,0.0152592547379999,0.122074037903989,-0.00762962736899908,0.114444410534990,0.00762962736899908,0.106814783165991,-0.0152592547379982,0.0991851557969916,0,0.0991851557969916,-0.0305185094759963,0.106814783165991,0.00762962736899908,0.106814783165991,-0.0381481368449954,0.0991851557969916,0.00762962736899908,0.0991851557969916,-0.0381481368449954,0.0991851557969916,0,0.0991851557969916,-0.0381481368449954,0.0991851557969916,0.00762962736899908,0.0991851557969916,-0.0381481368449954,0.0991851557969916,0.0152592547379999,0.0991851557969916,-0.0381481368449954,0.0991851557969916,0.00762962736899908,0.106814783165991,-0.0381481368449954,0.0991851557969916,0.00762962736899908,0.0991851557969916,-0.0381481368449954,0.0991851557969916,0.00762962736899908,0.106814783165991,-0.0305185094759963,0.106814783165991,0.00762962736899908,0.106814783165991,-0.0381481368449954,0.106814783165991,0.00762962736899908,0.0991851557969916,-0.0381481368449954,0.0991851557969916,0.00762962736899908,0.106814783165991,-0.0381481368449954,0.106814783165991,0,0.106814783165991,-0.0228888821069972,0.106814783165991,0,0.106814783165991,-0.0152592547379982,0.0991851557969916,-0.00762962736899908,0.106814783165991,-0.0152592547379982,0.0991851557969916,-0.00762962736899908,0.106814783165991,-0.0305185094759963,0.0991851557969916,-0.0152592547379982,0.0915555284279925,-0.0228888821069972,0.0839259010589935,-0.0381481368449954,0.0991851557969916,0.00762962736899908,0.106814783165991,-0.0152592547379982,0.122074037903989,0.0152592547379999,0.114444410534990,-0.0228888821069972,0.0991851557969916,-0.0152592547379982,0.0915555284279925,-0.0305185094759963,0.0915555284279925,-0.0228888821069972,0.0915555284279925,-0.0381481368449954,0.0839259010589935,-0.0228888821069972,0.0915555284279925,-0.0381481368449954,0.0839259010589935,-0.0228888821069972,0.0839259010589935,-0.0305185094759963,0.0915555284279925,-0.0228888821069972,0.0915555284279925,-0.0381481368449954,0.0839259010589935,-0.0228888821069972,0.0915555284279925,-0.0305185094759963,0.0915555284279925,-0.0152592547379982,0.0915555284279925,-0.0305185094759963,0.0915555284279925,-0.0152592547379982,0.0991851557969916,-0.0152592547379982,0.106814783165991,-0.00762962736899908,0.106814783165991,-0.0152592547379982,0.106814783165991,0,0.106814783165991,-0.0152592547379982,0.106814783165991,-0.00762962736899908,0.0991851557969916,-0.0228888821069972,0.0915555284279925,-0.0228888821069972,0.0915555284279925,-0.0305185094759963,0.0839259010589935,-0.0305185094759963,0.0762962736899944,-0.0381481368449954,0.0762962736899944,-0.0381481368449954,0.0839259010589935,-0.0381481368449954,0.0839259010589935,-0.0381481368449954,0.0839259010589935,-0.0381481368449954,0.0762962736899944,-0.0381481368449954,0.0839259010589935,-0.0381481368449954,0.0762962736899944,-0.0305185094759963,0.0839259010589935,-0.0381481368449954,0.0762962736899944,-0.0381481368449954,0.0839259010589935,-0.0381481368449954,0.0762962736899944,-0.0381481368449954,0.0762962736899944,-0.0457777642139945,0.0762962736899944,-0.0381481368449954,0.0762962736899944,-0.0381481368449954,0.0762962736899944,-0.0381481368449954,0.0762962736899944,-0.0381481368449954,0.0762962736899944,-0.0457777642139945,0.0762962736899944,-0.0381481368449954,0.0686666463209935,-0.0457777642139945,0.0762962736899944,-0.0457777642139945,0.0686666463209935,-0.0381481368449954,0.0839259010589935,-0.0305185094759963,0.0839259010589935,-0.0381481368449954,0.0839259010589935,-0.0305185094759963,0.0762962736899944,-0.0457777642139945,0.0762962736899944,-0.0381481368449954,0.0762962736899944,-0.0381481368449954,0.0839259010589935,-0.0381481368449954,0.0762962736899944,-0.0457777642139945,0.0762962736899944,-0.0381481368449954,0.0762962736899944,-0.0534073915829953,0.0686666463209935,-0.0381481368449954,0.0839259010589935,-0.0305185094759963,0.0991851557969916,0,0.106814783165991,-0.0228888821069972,0.0915555284279925,-0.0228888821069972,0.0839259010589935,-0.0381481368449954,0.0839259010589935,-0.0305185094759963,0.0762962736899944,-0.0457777642139945,0.0839259010589935,-0.0228888821069972,0.0762962736899944,-0.0457777642139945,0.0839259010589935,-0.0228888821069972,0.0839259010589935,-0.0381481368449954,0.0839259010589935,-0.0228888821069972,0.0839259010589935,-0.0457777642139945,0.0839259010589935,-0.0228888821069972,0.0762962736899944,-0.0457777642139945,0.0839259010589935,-0.0228888821069972,0.0839259010589935,-0.0457777642139945,0.0839259010589935,-0.0152592547379982,0.0839259010589935,-0.0457777642139945,0.0915555284279925,-0.0152592547379982,0.0915555284279925,-0.0305185094759963,0.0991851557969916,0.00762962736899908,0.0991851557969916,-0.0228888821069972,0.114444410534990,0.00762962736899908,0.0991851557969916,-0.0381481368449954,0.0915555284279925,-0.0152592547379982,0.0762962736899944,-0.0534073915829953,0.0762962736899944,-0.0228888821069972,0.0686666463209935,-0.0610370189519944,0.0762962736899944,-0.0305185094759963,0.0610370189519944,-0.0686666463209935,0.0686666463209935,-0.0381481368449954,0.0534073915829953,-0.0610370189519944,0.0686666463209935,-0.0534073915829953,0.0534073915829953,-0.0610370189519944,0.0610370189519944,-0.0457777642139945,0.0534073915829953,-0.0610370189519944,0.0610370189519944,-0.0457777642139945,0.0534073915829953,-0.0610370189519944,0.0610370189519944,-0.0610370189519944,0.0457777642139963,-0.0610370189519944,0.0534073915829953,-0.0686666463209935,0.0457777642139963,-0.0610370189519944,0.0534073915829953,-0.0686666463209935,0.0381481368449972,-0.0610370189519944,0.0534073915829953,-0.0686666463209935,0.0381481368449972,-0.0610370189519944,0.0534073915829953,-0.0762962736899926,0.0381481368449972,-0.0610370189519944,0.0457777642139963,-0.0686666463209935,0.0381481368449972,-0.0686666463209935,0.0610370189519944,-0.0610370189519944,0.0381481368449972,-0.0686666463209935,0.0534073915829953,-0.0686666463209935,0.0305185094759981,-0.0686666463209935,0.0534073915829953,-0.0686666463209935,0.0305185094759981,-0.0839259010589917,0.0457777642139963,-0.0762962736899926,0.0228888821069990,-0.0839259010589917,0.0381481368449972,-0.0762962736899926,0.00762962736899908,-0.0991851557969898,0.0305185094759981,-0.0762962736899926,0.0228888821069990,-0.0839259010589917,0.0534073915829953,-0.0457777642139945,0.0381481368449972,-0.0839259010589917,0.0381481368449972,-0.0762962736899926,0.0152592547379999,-0.0915555284279908,0.0381481368449972,-0.0762962736899926,0.0152592547379999,-0.0991851557969898,0.0305185094759981,-0.0762962736899926,0.00762962736899908,-0.0991851557969898,0.0305185094759981,-0.0839259010589917,0.00762962736899908,-0.0915555284279908,0.0305185094759981,-0.0839259010589917,0.0152592547379999,-0.0839259010589917,0.0381481368449972,-0.0839259010589917,0.0152592547379999,-0.0839259010589917,0.0457777642139963,-0.0762962736899926,0.0228888821069990,-0.0686666463209935,0.0534073915829953,-0.0762962736899926,0.0305185094759981,-0.0534073915829953,0.0610370189519944,-0.0686666463209935,0.0534073915829953,-0.0381481368449954,0.0686666463209935,-0.0534073915829953,0.0610370189519944,-0.0305185094759963,0.0839259010589935,-0.0457777642139945,0.0534073915829953,-0.0381481368449954,0.0762962736899944,-0.0610370189519944,0.0457777642139963,-0.0457777642139945,0.0610370189519944,-0.0686666463209935,0.0381481368449972,-0.0534073915829953,0.0610370189519944,-0.0610370189519944,0.0381481368449972,-0.0534073915829953,0.0686666463209935,-0.0610370189519944,0.0381481368449972,-0.0457777642139945,0.0686666463209935,-0.0610370189519944,0.0305185094759981,-0.0534073915829953,0.0686666463209935,-0.0610370189519944,0.0381481368449972,-0.0534073915829953,0.0610370189519944,-0.0534073915829953,0.0381481368449972,-0.0534073915829953,0.0686666463209935,-0.0534073915829953,0.0381481368449972,-0.0534073915829953,0.0686666463209935,-0.0534073915829953,0.0457777642139963,-0.0457777642139945,0.0762962736899944,-0.0457777642139945,0.0457777642139963,-0.0534073915829953,0.0762962736899944,-0.0457777642139945,0.0381481368449972,-0.0610370189519944,0.0686666463209935,-0.0457777642139945,0.0457777642139963,-0.0534073915829953,0.0686666463209935,-0.0457777642139945,0.0381481368449972,-0.0610370189519944,0.0762962736899944,-0.0381481368449954,0.0457777642139963,-0.0534073915829953,0.0762962736899944,-0.0381481368449954,0.0457777642139963,-0.0534073915829953,0.0686666463209935,-0.0381481368449954,0.0381481368449972,-0.0610370189519944,0.0686666463209935,-0.0381481368449954,0.0381481368449972,-0.0686666463209935,0.0610370189519944,-0.0381481368449954,0.0381481368449972,-0.0686666463209935,0.0610370189519944,-0.0534073915829953,0.0152592547379999,-0.0762962736899926,0.0686666463209935,-0.0381481368449954,0.0457777642139963,-0.0457777642139945,0.0991851557969916,-0.0228888821069972,0.0381481368449972,-0.0610370189519944,0.0686666463209935,-0.0534073915829953,0.0305185094759981,-0.0610370189519944,0.0610370189519944,-0.0534073915829953,0.0305185094759981,-0.0610370189519944,0.0610370189519944,-0.0610370189519944,0.0228888821069990,-0.0686666463209935,0.0534073915829953,-0.0610370189519944,0.0228888821069990,-0.0686666463209935,0.0610370189519944,-0.0686666463209935,0.0152592547379999,-0.0534073915829953,0.0610370189519944,-0.0686666463209935,0.0228888821069990,-0.0610370189519944,0.0610370189519944,-0.0610370189519944,0.0228888821069990,-0.0534073915829953,0.0686666463209935,-0.0534073915829953,0.0381481368449972,-0.0381481368449954,0.0762962736899944,-0.0381481368449954,0.0457777642139963,-0.0381481368449954,0.0839259010589935,-0.0305185094759963,0.0534073915829953,-0.0381481368449954,0.0839259010589935,-0.0381481368449954,0.0381481368449972,-0.0534073915829953,0.0686666463209935,-0.0534073915829953,0.0228888821069990,-0.0610370189519944,0.0534073915829953,-0.0610370189519944,0.0228888821069990,-0.0762962736899926,0.0534073915829953,-0.0534073915829953,0.0228888821069990,-0.0686666463209935];
dec_factor=50;
fs_sampling=200;
Astop = 80;
TW = 0.03*fs_sampling/2;
Hm = designMultistageDecimator(dec_factor, fs_sampling, TW, Astop, 'CostMethod', 'design');
signal_output = filter(Hm, signal_input);
Error using filter
Not enough input arguments.
Thanks in advance.
I have exactly the same error message from the same code. Running R2024a.

Sign in to comment.

As shown at designMultistageDecimator, this function retruns a dsp.FilterCascade object
M = 48;
Fin = 30.72e6*M;
Astop = 90;
BW = 1e7;
Fc = Fin/(2*M);
TW = 2*(Fc-BW);
c = designMultistageDecimator(M,Fin,TW,Astop)
c =
dsp.FilterCascade with properties: Stage1: [1x1 dsp.FIRDecimator] Stage2: [1x1 dsp.FIRDecimator] Stage3: [1x1 dsp.FIRDecimator] Stage4: [1x1 dsp.FIRDecimator] CloneStages: false
This object does not have a filter method.
methods(c)
Methods for class dsp.FilterCascade: FilterCascade freqrespopts info isreal phasedelay step addStage freqz isFilterCascade issos phasez stepz cascade freqzmr isLocked isstable realizemdl tf clone generateFilteringCode isallpass measure release zerophase coeffs generatehdl isequal noisepsd releaseStages zpk cost getNumStages isfir noisepsdopts removeStage zplane fdhdltool grpdelay islinphase order reset firtype impz ismaxphase outputDelay specifyall freqrespest impzlength isminphase parallel ss Static methods: helpFilterAnalysis helpSupportedSystemObjects Call "methods('handle')" for methods of dsp.FilterCascade inherited from handle.
Instead, operate on an input by use the object like a function call, as shown at dsp.FilterCascade
u = rand(4800,1);
y1 = c(u);
Reset the object to use again from scratch
reset(c);
y2 = c(u);
isequal(y1,y2)
ans = logical
1

Products

Release

R2023a

Asked:

on 4 Mar 2024

Answered:

on 24 Jul 2024

Community Treasure Hunt

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

Start Hunting!