How to view the filter coefficients from thebandpass fitler desinged

Hello,
I designed a bandpass filter as below
d = fdesign.bandpass('N,F3dB1,F3dB2',40,500,1500,6000);
Hd = design(d,'butter');
fvtool(Hd)
But how to get(or see) these filter coefficients. Thanks.

 Accepted Answer

The following will get you very close:
Hd = fdesign.bandpass('N,Fc1,Fc2',40,500,1500,6000);
B = design(Hd);
Compare
fvtool(B,1);
fvtool(BPF_coefficients,1)

More Answers (2)

Hi Stefan, the filter design here uses second-order sections a matrix of quadratic polynomials in z^{-1}. Each row of Hd.sosMatrix is a polynomial of the form
b_0+b_1z^{-1}+b_2z^{-2}+1+a_1z^{-1}+a_2z^{-2}
This results in a robust IIR design. You can obtain the filter coefficients in the form of B and A vectors by using:
[B,A] = sos2tf(Hd.sosMatrix,Hd.ScaleValues);
However (big however), you should realize that second-order sections are used for a reason and you may find that the resulting B and A design is not as well-behaved as the original SOS design
fvtool(Hd); figure;
fvtool(B,A);

2 Comments

Actually have a set of coefficients as in the attached file and the designer says the band pass filter coefficients are generated by using
Sampling frequency = 6000 Hz, Lower cut-off frequency = 500 Hz, Upper cut-off frequency = 1500 Hz, Filter type = FIR, order=40.
But I am not sure of how to get (I mean the code to be used to get) the filter coefficients from the above data (filter parameters). Can I know how to make this. Thanks.
Hi, i have an issue with this filter desig too. When i designed a filter as below:
d = fdesign.bandpass('N,F3dB1,F3dB2',40,500,15000,60000);
Hd = design(d,'butter');
fvtool(Hd);
i received the resull as below:
So how can i get the coefficient as in the equatation:
y[n] = b0*x[n] + b1*x[n-1] +...+ bN*x[n-N] - a1*y[n-1] - ... - aM*y[n-M]

Sign in to comment.

Hi,
Can you please suggest a good way of designing a bandpass filter of order 11(to get 12 fitler coefficeints) with sampling frequency of 100Hz (as signal is being sampled at 100Hz)and also to save the filter coefficients in a variable.
I guess I need the bandpass lower cutoff=3Hz and higher cutoff=0.8Hz because when I checked the frequencies in my data I mostly have 1Hz frequency components and some lying below 3Hz.
The two data sets are attached here. thanks.

Products

Tags

Asked:

on 30 Jan 2014

Commented:

on 24 Mar 2020

Community Treasure Hunt

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

Start Hunting!