continuous wavelet transform without using inbuilt function cwt()

조회 수: 7 (최근 30일)
Monika Gupta
Monika Gupta 2017년 3월 12일
댓글: Ameen Bin Obadi 2020년 5월 26일
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
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
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 CenterFile 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