필터 지우기
필터 지우기

Create a 4-pole, 300-6000HZ bandpass butterworth filter?

조회 수: 4 (최근 30일)
Nick
Nick 2012년 7월 16일
댓글: Mayank Lakhani 2015년 6월 8일
Hi. I'm pretty new to filters. I want to design a bandpass 300-6000Hz 4-pole butterworth filter. Not sure about how to do this in matlab. I have managed to make progress in this, but I am not sure what I am doing anyway.
Would really appreciate if someone could show the code for this. Would be even more appreciative if you could explain how these filters work so I can do it on my own in the future :)
Thank you!

채택된 답변

Wayne King
Wayne King 2012년 7월 16일
편집: Wayne King 2012년 7월 17일
If you want 4 poles and you have a bandpass filter, then you have to specify the order as 2. Also to convert from normalized frequency you divide by Fs/2 where Fs is the sampling frequency, not by Fs.
I'll assume the sampling rate is 20 kHz, but you have to specify it correctly.
Fs = 20000;
[B,A] = butter(2,[300 6000]/(Fs/2));
% view magnitude response
fvtool(B,A,'Fs',Fs)
figure;
% view pole-zero plot
zplane(B,A)
  댓글 수: 1
Mayank Lakhani
Mayank Lakhani 2015년 6월 8일
hi there,
how to add signal in the fv tool. suppose my output signal is y = filter(B, A, x); than how to use fv tool?

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Matt Kindig
Matt Kindig 2012년 7월 16일
If you have the Signal Processing Toolbox, you can use the 'butter' function.
doc butter
Also, you mention that you have made some progress in this. Can you show us the code you've done so far?
  댓글 수: 2
Nick
Nick 2012년 7월 16일
Well I currently use [A,B] = butter(10,0.2)
Does this mean this is a 10-pole filter? And does what would that 0.2 mean?
Ryan
Ryan 2012년 7월 16일
편집: Ryan 2012년 7월 16일
I have never used the toolbox and don't want to steer you in the wrong direction, but from the documentation I believe this:
[B,A] = butter(4,[300 6000],'stop');
acts as a 4th order bandstop filter between the cut off frequencies 300 and 6000 HZ. This does the opposite of what you're going for, but I don't see an option on 'ftype' to select otherwise. Possibly if you don't specify 'ftype' as 'stop','high' or 'low' it will act as a pass instead of stopband?

댓글을 달려면 로그인하십시오.


Ryan G
Ryan G 2012년 7월 16일
편집: Ryan G 2012년 7월 16일
If you look at the documentation it mentions you can define a 2 element frequency vector that you need to normalize to the sample rate of your data. Depending on the sample rate of your data you would want to implement something like this:
[b,a] = butter(4,[300 6000]/SampleRateOfData);
where the SampleRateOfData should be >6000. If you are designing a continuous time filter you could do
[b,a] = butter(4,[300 6000]/(2*pi),'s');
to design the filter in that domain.

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by