AnalogAroma
Community Member
Offline
Posts: 32
Germany
|
@ RFICDude,
Thanks for your response. Well I have used MATLAB finction "psd" which gives dB/ Hz values , not integrated power over a band. So, frequency resolution is not needed for this graph. Am I right ?
I have used the following MATLAB code to plot the spectrum. ------------------------------ % x is the data vector. % Fs1 is sampling frequency.
h2 = spectrum.welch('Hann',512,50); hopts = psdopts(h2,x); % Default options set(hopts,'Fs',Fs1,'NFFT',4096,'SpectrumType','twosided','centerdc',true); hpsd = psd(h2,x,hopts); dataplot6 = figure; plot(hpsd); -------------------------------------------------------------------
The following info is taken from MATLAB help.
------------------- The power spectral density is intended for continuous spectra. Note that unlike the mean-squared spectrum (MSS), in this case the peaks in the spectra do not reflect the power at a given frequency. Instead, the integral of the PSD over a given frequency band computes the average power in the signal over such frequency band. See the help on AVGPOWER for more information. The Hpsd object also contains a vector of normalized frequencies W at which the PSD is estimated. W has units of rad/sample. For real signals, W spans the interval [0,Pi] when NFFT is even and [0,Pi) when NFFT is odd. For complex signals, W always spans the interval [0,2*Pi). ------------------------------------------
|