continuous wavelet transform without using inbuilt function cwt()
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
Ameen Bin Obadi
2020-5-26
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.
Ameen Bin Obadi
2020-5-26
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 个)
另请参阅
类别
在 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!