MATLAB: What is the difference between “fdesign” and “fir”

fir

Could u please explain me about the difference between "fdesign" and "fir" for design digital filter?

Best Answer

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