How to design a filter with a given transfer function

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

 Réponse acceptée

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 commentaires

Thanks, that works.
Evgeni
how i can use this filter and how to create an axis frequency for that filter?

Connectez-vous pour commenter.

Plus de réponses (1)

Honglei Chen
Honglei Chen le 22 Sep 2011

0 votes

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 commentaire

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

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by