How to design a filter with a given transfer function

4 views (last 30 days)
I need to design a filter with a given transfer function (one zero, two polls) using filterbuilder. I need to use "Filter Design HDL Coder " toolbox. The spec is available here: http://twitpic.com/6o0ggg I cannot figure out how to do it from filterbuilder or fdatool

Accepted Answer

Honglei Chen
Honglei Chen on 22 Sep 2011
Hi Evgeni,
I guess I misunderstood your question. If you already know your zeros and poles, then you already have the coefficients. So all you need to do is to create a dfilt object based on that and then use generatehdl to generate the HDL code.
z = -1;
p = [0.0948+0.3094i;0.0948-0.3094i];
k = 0.4576;
[s,g] = zp2sos(z,p,k);
hf = dfilt.df2sos(s,g);
generatehdl(hf)
HTH,
  2 Comments
Raed Amhaz
Raed Amhaz on 13 Jan 2021
how i can use this filter and how to create an axis frequency for that filter?

Sign in to comment.

More Answers (1)

Honglei Chen
Honglei Chen on 22 Sep 2011
Hi Evgeni,
First of all, you will need to describe your response based on your frequency resposne curve. It looks like you know exactly what order you want for the filter, so you can fire up
filterbuilder('lowpass')
choose IIR and then type in those information as well as things like 3dB point.
Once you are happy with the design, you can then click 'Code Generation' panel on the GUI and there you will have option to generate the HDL code.
HTH
  1 Comment
Evgeni Stavinov
Evgeni Stavinov on 22 Sep 2011
Thanks for your answer. It helps, but only partially. I've experimented with parameters in the Lowpass IIR dialog, but wasn't able to get to the frequency response I need. The UI doesn't seem to allow me to specify the location of polls and zeros, and that's exactly what I need.
Sorry for the rookie question.
Evgeni

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!