How to compute the PSD after generating a .m file from FDATool
2 views (last 30 days)
Show older comments
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);
0 Comments
Answers (1)
Wayne King
on 2 Jul 2012
Edited: Wayne King
on 2 Jul 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 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!