FIR Filter in MATLAB
Show older comments
I've seen in MATLAB FIR Filter, that we can use the function 'designfilt', to obtain value from Filter coefficients regarding some specification(cut off frequency, order, etc...). My question is, on the other side, if we already have the filter coefficients, let's say 1x31 coefficients vektor, can we retrieve its specifications(order,cutoff frequency,ripple...)? Maybe using a function in MATLAB,which is i'd like to know.
Answers (1)
Star Strider
on 30 Nov 2016
0 votes
Use the freqz function to get the transfer function. You would have to calculate the ripple yourself, but that is not difficult. (The findpeaks function would help with that.) The order is the order of the denominator polynomial. You would have to know the sampling frequency to get the cutoff frequency in Hz, although it would again be straightforward to calculate it in radian frequency (on the interval (0,pi)) from the transfer function.
8 Comments
Big dream
on 1 Dec 2016
Star Strider
on 1 Dec 2016
My pleasure.
You would have to know how ‘A’ was designed. You can design a filter that has essentially identical characteristics as ‘A’ and have different coefficients.
It is almost impossible to ‘reverse engineer’ a filter to recover the exact characteristics used to design it. That information would probably allow you to reproduce it exactly, but without that information, you have to settle for reproducing it as accurately as possible.
Big dream
on 1 Dec 2016
Star Strider
on 1 Dec 2016
My pleasure.
Big dream
on 2 Dec 2016
Star Strider
on 2 Dec 2016
That’s not true for findpeaks. It has many name-value pair argument sets that make it very useful. Used with some of the set membership functions such as setdiff and ismember, it can find the peak of the passband maximum and the peaks of the ripple values, so calculating the ripple amplitude and converting that to dB is straightforward.
Calculating the cutoff frequencies for the passbands and stopbands is likewise straightforward, although for this, the interp1 function is best. It requires some programming, experimentation, and time, but is not difficult.
Please explore these functions. The documentation is clear, and if you have problems, we can help. Remember that freqz returns the complex transfer function, so use the abs function to convert it to magnitude values.
Big dream
on 5 Dec 2016
Star Strider
on 5 Dec 2016
My pleasure.
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!