butter filter

11 次查看(过去 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.

更多回答(0 个)

类别

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