continuous wavelet transform without using inbuilt function cwt()

I need to implement continuous wavelet transform without using the inbuilt function cwt(). here g is complex morlet wavelet. b,a is shift and scale parameter respectively. s(b,a)= 1/a ∫s(t) *g ((t-b)/a) dt
I'm not allowed to use fft. I tried implementing this using convolution, but not getting right results. please help.
if true
%%user CWT
clear all
N=300; %sample point numbers
t=linspace(0,30,N);
%%signal
x=5*sin(2*pi*0.5*t); % signal with freq of 0.5 HZ
%%cwt
fc=1;fb=15;
% psi=((pi*fb)^(-0.5)).*exp(2*1i*pi*fc.*...
% t).*exp(-t.^2/fb);
%%convolution Psi([N-n]/S)*x(n) so we calculate convolution(psi(n/s),x(n))
for s=1:60 %scale vector s=[1:1:60]
for i = 1:N % number of discrete times
for k = 1:i
if ((i-k+1)<N+1) && (k <N+1)
PSI = ((pi*fb)^(-0.5)).*exp(2*1i*pi*fc.*...
(t/s)).*exp(-(t/s).^2/fb);
c(i,s) = c(i)+ x(k)*PSI(i-k+1);
end
end
end
end
end

3 个评论

Hi, I have the same problem. I also tried calculating using the convolution algorithm but I'm getting different answers. Let me know if you find the solution.
I have done it but using different method. I used conv function and it worked. the conv function does the shifting for you so you only need to care about scaling.
I am now trying to implement it using FFT of signal and FFT of the wavelets then multiplication rather than convolution , but no luck so far.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Continuous Wavelet Transforms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by