How can I add a filter to remove certain frequencies?

38 次查看(过去 30 天)
I have a function that has frequencies from 0 to 30 and from 80 to 100. Essentially, I am trying to cut the function so that only the frequencies from 0 to 30 show, but the function is still the same length. Since I still want the function the same length, I have thought about using a low pass filter to block any frequencies above 30 Hz and then adding zeros to the end to make it the same length. For some reason this doesn't work. I have attached a picture of my original plot.
This is my code so far. fs=100; t=0:1/fs:1-1/fs; x1=fft(VarName1); figure mag=abs(x1); f=(0:length(x1)-1)*100/length(x1); plot(f,mag); ylabel('Magnitude'); xlabel('Frequency'); title('x(n)');

回答(1 个)

Stalin Samuel
Stalin Samuel 2014-11-8

类别

Help CenterFile Exchange 中查找有关 Filter Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by