continuous wavelet transform without using inbuilt function cwt()
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Ameen Bin Obadi
le 26 Mai 2020
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
le 26 Mai 2020
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.
Réponses (0)
Voir également
Catégories
En savoir plus sur Continuous Wavelet Transforms dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!