Designing an Arbitrary FIR Filter

3 次查看(过去 30 天)
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]
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!

采纳的回答

Star Strider
Star Strider 2020-2-17
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 个评论
Krishna Ganesan
Krishna Ganesan 2020-2-19
Thank you very much for the clarification!
Star Strider
Star Strider 2020-2-19
My pleasure.
If my Answer helped you solve your problem, please Accept it!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multirate and Multistage Filters 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by