Reg : FFT Filter
2 次查看(过去 30 天)
显示 更早的评论
Hello, I am just a beginner in Matlab, and just started to explore the complete usage of MatLab. I am given a task on filtering a noisy data. Say for Ex: I am given a inputdata.mat file, i loaded and plotted the data variable inside the mat file. got a curve with lots of noise. I want to use the FFT filter to filter the noisy data. As am a beginner, i would really appreciate if anyone can help me out in this. I know i have to use the fft command for the same, but i couldnt move any further. Need your help Thanks Venkat
0 个评论
回答(3 个)
William
2011-9-26
What version are you using? If you are using the student version you can use the "Filter" command within the control systems toolbox to visually create a filter.
Next you need to figure out how your data is input. If your .mat file is just points of a random noise function stacked on top of a sine wave you can use the filter function
help filter
If you don't have the control systems toolbox you can find the transfer function and work the problem with a number of for loops in a c code type manner.
If you can at all use the "filter" command. It does all the FFT work for you.
0 个评论
Wayne King
2011-9-26
If you have the Signal Processing Toolbox, you can:
1.) specify your filter using fdesign.lowpass (for example)
2.) design your filter using design()
3.) apply your filter to data using filter() or filtfilt()
In this example I design a lowpass FIR equiripple filter for data sampled at 10 kHz. I'll pass everything below 1 kHz, with the stopband starting at 1100 Hz. I specify 60 dB of attenuation in the stopband and 0.5 dB of passband ripple.
I'll create some noisy signal first to filter.
t = 0:1/1e4:1;
x = cos(2*pi*250*t)+sin(2*pi*500*t)+randn(size(t));
%Now to specify the filter
Fs = 1e4;
d = fdesign.lowpass('Fp,Fst,Ap,Ast',1000,1100,0.5,60,Fs);
% use specifications to design the filter
Hd = design(d,'equiripple');
% apply the filter to the noisy signal
y = filter(Hd,x);
You can view your filter response with:
fvtool(Hd)
Hope that helps,
Wayne
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Filter Design 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!