How to compute the PSD after generating a .m file from FDATool
Mostrar comentarios más antiguos
Hello everyone,
I designed my filter using the FDATool and exported to the .m file and have been computing the impulse, and the freq responses to further explore my filter. However, I'm not exactly sure how to compute the Power Spectral Density (PSD). From what I've read, you take the magnitude of the FFT and square it. But I'm not sure how this is done. Can anyone please help?
Thanks in advance, Clay
% All frequency values are normalized to 1.
N = 26; % Order Fpass = 0.35; % Passband Frequency Fstop = 0.6; % Stopband Frequency Wpass = 1; % Passband Weight Wstop = 1; % Stopband Weight dens = 20; % Density Factor
% Calculate the coefficients using the FIRPM function. b = firpm(N, [0 Fpass Fstop 1], [1 1 0 0], [Wpass Wstop], {dens}); Hd = dfilt.dffir(b);
Respuestas (1)
Wayne King
el 2 de Jul. de 2012
Editada: Wayne King
el 2 de Jul. de 2012
You can look at the magnitude response of your filter with:
fvtool(Hd)
Or
[H,W] = freqz(Hd);
plot(W,20*log10(abs(H)))
For a deterministic sequence like a filter impulse response, we normally refer to it as the frequency response. Power spectral density it used for random processes.
2 comentarios
Clay
el 2 de Jul. de 2012
Wayne King
el 2 de Jul. de 2012
No, it's not. You definitely want freqz()
Categorías
Más información sobre Multirate Signal Processing 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!