How to design a filter with a given transfer function
4 views (last 30 days)
Show older comments
Evgeni Stavinov
on 20 Sep 2011
Commented: Raed Amhaz
on 13 Jan 2021
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
0 Comments
Accepted Answer
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
on 13 Jan 2021
how i can use this filter and how to create an axis frequency for that filter?
More Answers (1)
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
See Also
Categories
Find more on Digital Filter Design in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!