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

 採用された回答

Honglei Chen
Honglei Chen 2011 年 9 月 22 日

0 投票

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 件のコメント

Evgeni Stavinov
Evgeni Stavinov 2011 年 9 月 22 日
Thanks, that works.
Evgeni
Raed Amhaz
Raed Amhaz 2021 年 1 月 13 日
how i can use this filter and how to create an axis frequency for that filter?

サインインしてコメントする。

その他の回答 (1 件)

Honglei Chen
Honglei Chen 2011 年 9 月 22 日

0 投票

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 件のコメント

Evgeni Stavinov
Evgeni Stavinov 2011 年 9 月 22 日
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

サインインしてコメントする。

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by