[SOLVED] Correct Power spectrum Density of Morlet wavelet

Status
Not open for further replies.

syedshan

Advanced Member level 1
Joined
Feb 27, 2012
Messages
463
Helped
27
Reputation
54
Reaction score
26
Trophy points
1,308
Location
Jeonju, South Korea
Activity points
5,134
Dear all,

Please refer to the following code to generate the morlet wavelet.

%close all; clc; clear all;
Fo=50; Fs=Fo*4;
x=-5:1/Fs:5;
for i=1:length(x)
wavelet(i) = exp(-x(i)^2/2)*cos(x(i)*Fo);
end
subplot(2,1,1); plot(wavelet);

%PSD
h=spectrum.welch;
subplot(2,1,2); psd(h,wavelet,'Fs',Fs)

I want to find the frequency component of the morlet signal, but could not do that.
Please see where am I getting wring.
I should get high amplitude of PSD at about 50Hz, but I am getting it at about 7 or 8 Hz.


Bests,
Shan

- - - Updated - - -

Hi all,

I figured it out.
There was one silly mistake, instead of "cos(x(i)*Fo" I should have written "cos(2*pi*x(i)*Fo)"

With this I get the correct response

Bests,
Shan
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…