Designing a Butterworth filter given center frequency
4 ビュー (過去 30 日間)
古いコメントを表示
Hi, all!
I'm a student just now starting get a handle on Matlab and I'm having trouble with an assignment. I have to design a 10th order Butterworth bandpass filter with center frequency of 1000 Hz. This is the code I've got so far
Fc = 1000;
F1 = 500;
F2 = 1500;
W1 = 2*pi*F1;
W2 = 2*pi*F2;
Fn = 10000
Wp = [W1 W2]/Fn
[b,a] = butter(5,Wp,'bandpass');
figure(1);
freqz(b,a);
I'm getting about the expected shape of the magnitude plot but the center is at 0.5 and I can't for the life of me move it. What am I missing? Is my approach completely wrong? Let me know if I've left out any information or if I'm being an idiot or something. Thanks for the help!
0 件のコメント
回答 (1 件)
Star Strider
2016 年 11 月 15 日
Your design is correct. Your code isn’t. You need to define your passband as normalised frequencies with respect to your Nyquist frequency. This is easy to see in your freqz call if you include the sampling frequency. (I chose a FFT length of 4096 arbitrarily. Nothing magic about it.)
This gives the result you describe as your objective:
Fc = 1000;
F1 = 500;
F2 = 1500;
Fs = 20000; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
Wp = [F1 F2]/Fn; % <— DEFINE THE PASSBAND THIS WAY
[b,a] = butter(5,Wp,'bandpass');
figure(1);
freqz(b,a, 4096, Fs); % <— INCLUDE ‘Fs’ HERE
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Analog Filters についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!