How to compute the PSD after generating a .m file from FDATool

2 views (last 30 days)
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);

Answers (1)

Wayne King
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
Clay
Clay on 2 Jul 2012
Thank you for your response.
I was actually computing the frequency response using the freqz function you mentioned. Sorry if this sounds stupid, but is computing the frequency response the same as computing the PSD?

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!