How to use the measure command in filter design

2 views (last 30 days)
Hi!
I am trying to use the measure command to store the filter properties in a variable so that i can refer to it for comparison with other filters. Here is my code:
hd = dfilt.dffir(FVr_temp); % designs the filter for the given coefficients
m=measure(hd);
if(m.astop==as)
S_struct.term=1;
end
The m.astop is not working but I did see it being used in some code. I want to access the passband and stop frequencies and attenuations and compare them with given values. How can I do it?
Also if measure cannot be used, then what is the alternate method.
Thanks

Answers (2)

Honglei Chen
Honglei Chen on 12 Sep 2013
You need to go through the fdesign interface so measure() can work. Otherwise, if you simply specify the filter coefficients, it does not know what the specification is and thus cannot perform the measurements. You can find this info and some examples in the following reference page
HTH
  1 Comment
Saumya
Saumya on 12 Sep 2013
Oh thank you I got it. But the problem is that I am only available with the filter coefficients in my algorithm. Is there any substitute to measure command. I mean after I get h from dfilt.dffir, can I use some other command to access the properties of the filter?

Sign in to comment.


Saumya
Saumya on 14 Sep 2013
Can somebody please help!
My doubt is that I have only filter coefficients available with me. Now I have to create the FIR filter and compare its properties like passband & stopband frequencies and attenuation, with the given values. I cannot use fdesign.lowpass and measure. So, what is the alternate method?
  1 Comment
Honglei Chen
Honglei Chen on 18 Sep 2013
compare it to what? If you know the spec, then you can just plug in the expected frequency and see if the response matches what it should be.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!