What is the difference between "fdesign" and "fir" ?

1 view (last 30 days)
Could u please explain me about the difference between "fdesign" and "fir" for design digital filter?

Accepted Answer

Honglei Chen
Honglei Chen on 22 Jul 2013
d = fdesign.response(spec)
defines a particular filter specification. Based on that specification, if you do
myFilter = design(d)
you will get a filter which you can used to filter a signal by invoking
y = filter(myFilter,x)
This approach allows you to choose among eligible design methods at the design stage.
On the other hand,
b = fir1(n,Wn,'ftype',window)
is specifically for designing an FIR filter using window method, so you have to know that you want to use that particular method before you design that filter. What you get is simply the filter coefficients for the resulting FIR filter and you can use that to filter the signal via
y = filter(b,1,x)
If you happen to choose to design an FIR filter using window method in the fdesign approach, then you should get equivalent filters.
HTH

More Answers (2)

aomme
aomme on 21 Jul 2013
I mean between "d = fdesign.response(spec)" and "b = fir1(n,Wn,'ftype',window)"

aomme
aomme on 24 Jul 2013
Thank you very much "Honglei Chen"

Tags

Community Treasure Hunt

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

Start Hunting!