How can I write the Matlab “filter”-function myself?

后端 未结 5 1811
攒了一身酷
攒了一身酷 2021-02-06 19:23

I would like to use a Butterworth filter on a 1D-Signal. In Matlab the script would look like this:

 f=100;
 f_cutoff = 20; 
 fnorm =f_cutoff/(f/2);
 [b,a] = but         


        
5条回答
  •  醉梦人生
    2021-02-06 19:51

    BlackEagle's solution does not reproduce the same results as MATLAB with other arrays. For example:

    b = [0.1 0.1]
    a = [2 -2.5 1]
    u = [1, zeros(1, 30)];
    z = filter(b, a, u)
    

    Gives you completely other results. Be careful.

提交回复
热议问题