butter filter

조회 수: 13 (최근 30일)
amir
amir 2012년 6월 25일
hi
suppose there are three signal like this
syms t x
a=2*sin(2*pi*t*300)
b=2*sin(2*pi*t*600)
c=2*sin(2*pi*t*900)
i I'll pass the frequency of 900 with butter filter
and my script is
syms t x
a=2*sin(2*pi*t*300)
b=2*sin(2*pi*t*600)
c=2*sin(2*pi*t*900)
z=a+b+c
[z,a]=butter(3,90/100)
fvtool(z,a)
where is the problem ?
please help
  댓글 수: 4
Walter Roberson
Walter Roberson 2012년 6월 26일
Since you are overwriting "z" in your assignment of the output of butter(), you might as well not calculate the initial "z". The initial "z" is formed from the variables "a", "b", and "c", and those variables are not used after that point (the "a" that appears later is the "a" that is output from butter()), so you might as well not calculate them either. This reduces your script to
[z,a]=butter(3,90/100)
fvtool(z,a)
Are you sure that is correct and sufficient ??
If you want to pass 900 Hz and reject other frequencies, then you need a very narrow band-pass filter. The syntax you have used for butter() is not correct for creating a band-pass filter.
amir
amir 2012년 6월 26일
suppose that if we get back on first question, with a different frequency signal we want to separate one
What is your solution?
The band-pass filter can be used?
Can you write script fot me ?
thanks for your help!!!

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

채택된 답변

Wayne King
Wayne King 2012년 6월 26일
If you want to pass 900 Hz and reject the other frequencies, you need a highpass filter. You have designed a lowpass filter. Why are you using symbolic variables? And we need to know your sampling frequency in order to design a useful filter.
In this example, I'll assume that the sampling rate is 10 kHz.
Fs = 1e4;
[b,a] = butter(15,(2*650)/1e4,'high');
t = 0:1/Fs:1;
x = 2*sin(2*pi*t'*[300 600 900]);
x = sum(x,2);
% view your filter's magnitude response
fvtool(b,a,'Fs',Fs);
% filter the data
output = filter(b,a,x);
Although with such a stringent filtering problem, I think you're better off using fdesign.highpass.
d = fdesign.highpass('Fst,Fp,Ast,Ap',650,700,80,0.5,Fs);
Hd = design(d,'butter');
output = filter(Hd,x);
I think you see the above filter removes all but the 900 Hz component.
  댓글 수: 1
amir
amir 2012년 6월 26일
perfect ,thanks a lot

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Downloads에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by