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.
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
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