i want to filter a frequeny
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
mouh nyquist
am 6 Nov. 2014
Kommentiert: mouh nyquist
am 4 Dez. 2014
Hi all,
I write because I'm trying to do filtering in maltab.
in the code below I have a signal which is composed of two sinus of frequencies 0.3Hz and 2Hz.
I'd like to do is filter the sinus 2Hz the code below does not kidnapped this signal's component ...
you know where it comes from?
clear all;close all;clc;
%%original
t = 0:0.01:10;
y = sin(2*pi*0.3*t)+sin(2*pi*2*t);
%%filter
fs = 1000;
fcoupure = 2*[1 3]/fs;
[b]=fir1(1,fcoupure,'stop');
yfilter=filter(b,1,y);
figure (1);hold on;plot(t,y);plot(t,yfilter,'r');
%%butterworth
fs = 1000;
fcoupure = 2*[1 3]/fs;
[b,a]=butter(1,fcoupure,'stop');
yfilter=filter(b,a,y);
figure (2);hold on;plot(t,y);plot(t,yfilter,'r');
help me with any method not only butter
0 Kommentare
Akzeptierte Antwort
Rick Rosson
am 7 Nov. 2014
doc iirnotch
2 Kommentare
Andrew Reibold
am 7 Nov. 2014
Bearbeitet: Andrew Reibold
am 7 Nov. 2014
Did you read the doc? #doit4me
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Filter Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!