How can I implement FFT (y-axis:Power, x-axis:Frequency) with 4 cases: Lowpass/Highpass/Band/Notch
Mostrar comentarios más antiguos
Hi,
Currently I implement FFT (y-axis:Power, x-axis:Frequency) as below: (based on http://www.mathworks.com/help/matlab/math/fast-fourier-transform-fft.html)
d1=-250
d2=250
data= d1 + (d2-d1).*rand(1,256)
Fs=30
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
plot(f,power)
xlabel('Frequency (Hz)')
ylabel('Power')
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
Respuesta aceptada
Más respuestas (1)
Thuan
el 6 de Abr. de 2014
0 votos
Categorías
Más información sobre Analog Filters en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!