How can I implement FFT (y-axis:Power, x-axis:Frequency) with 4 cases: Lowpass/Hi​ghpass/Ban​d/Notch

6 views (last 30 days)
Currently I implement FFT (y-axis:Power, x-axis:Frequency) as below: (based on
data= d1 + (d2-d1).*rand(1,256)
m = length(data); % Window length
n = pow2(nextpow2(m)); % Transform length
y = fft(data,n); % DFT
f = (0:n-1)*(Fs/n); % Frequency range
power = y.*conj(y)/n; % Power of the DFT
xlabel('Frequency (Hz)')
title('{\bf Periodogram}')
Currently, I don't know how to customize source code above for Lowpass/Highpass/Band/Notch.
Please help me, thanks for your support.
Best Regards,
Thuan Phan

Accepted Answer

Carlos on 1 Apr 2014
If you want to filter a signal in the frequency domain you just need to multiply your signals' frequency response (y in your code) by the frequency response of your filter.
In order to calcute your filter coefficients and if you have the filter design toolbox this tutorial has all the information you might need
You can also design your filter using the fdatool or using the signal processing toolbox (here you can find all of the filter functions in the signal processing toolbox
Thuan on 1 Apr 2014
Dear Mr. Carlos,
There are two domains to use: Digital Domain and Analog Domain. Currently, I use eeg data (in microVolt). And I will choose Digital Domain. Is this right? Thanks for your support.
Best Regards,

Sign in to comment.

More Answers (1)

Thuan on 6 Apr 2014
Dear Mr. Carlos,
I have implemented FFT with 4 filters. Thanks for your support.
Best Regards, Thuan Phan


Community Treasure Hunt

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

Start Hunting!