Designing an Arbitrary FIR Filter
1 view (last 30 days)
Show older comments
Krishna Ganesan
on 17 Feb 2020
Commented: Star Strider
on 19 Feb 2020
I need to design an Arbitrary FIR Filter whose response looks like this,
Frequency = [100 125 160 200 250 315 400 500 630 800 1000 1250 1600 2000 2500 3150 4000 5000 6300 8000 10000]
Required_Filter_Response = [55,38 55,74 52,13 52,64 51,25 49,04 46,50 44,99 42,95 40,73 39,47 37,53 35,36 34,33 32,33 30,36 28,01 25,98 23,19 20,42 18,65]
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/272133/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/272134/image.png)
My professor suggested me using designfilt and fvtool for realizing it. I am not new to MATLAB, but to filters and digital signal processing, I am.
Any suggestions on how to achieve it would be greatly appreciated. Thanks!
0 Comments
Accepted Answer
Star Strider
on 17 Feb 2020
This is probably as close as you can get:
Frequency = [100 125 160 200 250 315 400 500 630 800 1000 1250 1600 2000 2500 3150 4000 5000 6300 8000 10000];
Required_Filter_Response = [55.38 55.74 52.13 52.64 51.25 49.04 46.50 44.99 42.95 40.73 39.47 37.53 35.36 34.33 32.33 30.36 28.01 25.98 23.19 20.42 18.65];
Fs = 20000; % Create Sampling Frequency (Not Supplied, Must Be > 20000 Here)
Fn = Fs/2;
Fnew = linspace(min(Frequency), max(Frequency), fix(numel(Frequency)/2)*2);
Rnew = interp1(Frequency, Required_Filter_Response, Fnew);
b = firls(100, Fnew/Fn, Rnew/max(Rnew));
figure
freqz(b, 1, 2^14, Fs)
[h,f] = freqz(b, 1, 2^14, Fs);
figure
plot(Fnew, 20*log10(Rnew/max(Rnew)))
hold on
plot(f, 20*log10(abs(h)))
hold off
Note that the filter and the desired response are essentially the same in the second plot.
6 Comments
Star Strider
on 19 Feb 2020
My pleasure.
If my Answer helped you solve your problem, please Accept it!
More Answers (0)
See Also
Categories
Find more on Multirate and Multistage Filters 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!