1
$\begingroup$

I have a filter response in the $z$-domain.

$$H_0(z) = 2 + 6z^{−1} + z^{−2} + 5z^{−3} + z^{−5}$$

How do I implement this filter on MATLAB?

I can do this if I have the coefficients but I do not know how to get them.

$\endgroup$
1
  • $\begingroup$ Welcome here. It seems that a first step is to get the coefficients. What type of filter does this equation model $\endgroup$ Oct 25 '20 at 7:24
2
$\begingroup$

Your filter is a 5-tap delay line FIR filter. The FIR filter's coefficients are [2 6 1 5 1]. If x is your filter's input sequence and you execute the following MATLAB command:

h = [2 6 1 5 1];

you can then implement the filter (to produce a y output sequence) using the following MATLAB command:

y = filter(h, 1, x);

You can see your filter's frequency magnitude and phase responses by executing the following MATLAB command:

freqz(h, 1, 256)
$\endgroup$
3
  • $\begingroup$ Shouldn't it be [2 6 1 5 0 1] since there is no $z^{-4}$ term? $\endgroup$
    – fibonatic
    Oct 25 '20 at 17:29
  • $\begingroup$ yes it shoud be [2 6 1 5 0 1]. Thank to you all $\endgroup$
    – user52384
    Oct 26 '20 at 2:03
  • $\begingroup$ Yes yes! [2 6 1 5 0 1] is correct. Sorry for the confusion. $\endgroup$ Oct 27 '20 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy