Effacer les filtres
Effacer les filtres

Designing an Arbitrary FIR Filter

1 vue (au cours des 30 derniers jours)
Krishna Ganesan
Krishna Ganesan le 17 Fév 2020
Commenté : Star Strider le 19 Fév 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]
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!

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Multirate and Multistage Filters dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by