FIR by using Frequency Sampling Methods
Show older comments
Hi everyone,
Can anybody tell me how can I design FIR filters (low pass, high pass, bandpass and stopband) by using Frequency Sampling Method. In MATLAB, I can't found a specific function to design these filters by using frequency sampling method like other methods such as window or optimal that include a specific function in MATLAB like kaiser, boxcar or firpm.
Please help me
Thank you
Answers (2)
Honglei Chen
on 20 Jun 2012
0 votes
You may want to take a look at firls
3 Comments
Mohammed
on 21 Jun 2012
Honglei Chen
on 21 Jun 2012
Then this
http://www.mathworks.com/help/toolbox/signal/ref/fir2.html
Mohammed
on 21 Jun 2012
Wayne King
on 21 Jun 2012
Hi Mohammed, you can use frequency sampling with certain fdesign objects and specifications like fdesign.arbmag for example
b1 = 0:0.01:0.18;
b2 = [.2 .38 .4 .55 .562 .585 .6 .78];
b3 = [0.79:0.01:1];
a1 = .5+sin(2*pi*7.5*b1)/4; % Sinusoidal response section.
a2 = [.5 2.3 1 1 -.2 -.2 1 1]; % Piecewise linear response section.
a3 = .2+18*(1-b3).^2; % Quadratic response section.
f = [b1 b2 b3];
a = [a1 a2 a3];
n = 300;
d = fdesign.arbmag('n,f,a',n,f,a); % First specifications object.
% use frequency sampling to design the filter
hd = design(d,'freqsamp','window',{@kaiser,.5}); % Filter.
fvtool(hd)
You can use designmethods to query which design methods are supported for a given specification.
For example: Design a very simple lowpass filter using fdesign.arbmap
d = fdesign.arbmag('N,F,A',10,[0 0.25 0.5 1],[1 1 0 0]);
designmethods(d)
Hd = design(d,'freqsamp');
Categories
Find more on Filter Design 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!