How to apply a FIR filter?

7 ビュー (過去 30 日間)
Neuron
Neuron 2011 年 12 月 30 日
I have a sound signal sampled at 44100Hz and I want to keep the frequencies 100 to 800 Hz. How can I do this with a FIR filter using the default hamming window? What are the correct values for order n, ripple etc. It seems hard to find this information.. thank you in advance.

回答 (3 件)

Abhishek Gupte
Abhishek Gupte 2012 年 1 月 11 日
Try using the FDATOOL.
  1 件のコメント
Neuron
Neuron 2012 年 1 月 17 日
I have to write code, gui not useful.
ty

サインインしてコメントする。


Sebastian Gatzka
Sebastian Gatzka 2012 年 1 月 17 日
Try to find the correct filter with the FDATOOL. Once you have found it you can implement it into your code!

Wayne King
Wayne King 2012 年 1 月 17 日
Are you sure you want to use the window method in this case?
At any rate, for the window method, the wider the main lobe, the smaller the side lobes and hence the smaller the ripple. Values for the more popular windows including the Hamming are published.
For the Hamming, the main lobe in radians per sample is (8*pi)/M where M is the length of the window (order of your filter-1). Accordingly, to determine your order take the width of main lobe (the passband width), set that equal to (8*pi)/M and solve for M
The first sidelobe for the Hamming window is around -53 dB, so that equals a ripple of 20*log10(delta) = -53
Let's say you want a passband (mainlobe width) of 0.3pi-0.1pi=0.2pi. You can solve for the order: 0.2pi = (8pi)/M M = 40
To design the filter (I'll just make the order 40, which gives 41 coefficients)
d = fdesign.bandpass('N,Fc1,Fc2',40,0.1,0.3);
Hd = window(d,'window',@hamming);
fvtool(Hd);
Make the necessary adjustments for specifications in Hz.
And just FYI, you can design the filter in FDATool and then generate the MATLAB with File -> Generate MATLAB Code

カテゴリ

Help Center および File ExchangeHamming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by