Using FFT to find CWT
3 次查看(过去 30 天)
显示 更早的评论
I am trying to calculate CWT not using the function "cwt" in matlab , but from the definition of CWT itself. I am doing this for the purpose of implemening the same mathematical steps on FPGA board.
So, I have a signal "I" of length (39062) and I have the morlet wavelet of length (39062). I find FFT for "I" , then I find FFT for morlet wavelet at each of the 124 scales , so I get amatrix of 124 by 39062 each row containing the FFT of each scale let us call it (psi1_f). Then I multipled the FFT of (I) with first row of psi1_f element by element and take IFFT, then multiply by second row and so on until I get a new matrix which should contain the CWT coeffiecints. My code is as follows:
fs=325.520833333333; % sampling frequncy
[cw1,freq1,~,fb1,scalingcfs]=cwt(I,'amor',fs); % this step is just to extract the fb and then extract the wavelets, I is my signal
[psi1,t1] = wavelets(fb1); % to extract psi1
%%%%%%%%%%
I_f=fft(I);
psi1_f=fft(psi1,39062,2); % finding FFT of each row (FFT of wavelet at each scale)
for i=1:124
temp=i*psi1_f(i,:); % this is just to increase magnitude of each wavelet (not sure if this is necessary)
cw11(i,:)=(I_f'.*temp);
end
cw11=ifft(cw11,39062,2); % now this cw11 should be the cwt coeffiecients
According to my known signal (I), I should get some very high frequency components at time 8 seconds and 104 seconds (total signal time is 120 seconds), howevr, I got these components delayed. They happen to be at 24 seconds and 112 seconds instead.
Any explanation and solution to this issue?
By the way: When I implement the same method but in time domain (definition of cwt is convolution in time doamin rather than multiplication) I got accurate results.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Continuous Wavelet Transforms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!