construct wavelet function and its scaling function

조회 수: 9 (최근 30일)
konoha
konoha 2021년 8월 14일
답변: konoha 2021년 8월 17일
i am using the dilation equation to construct wavelet function and its scaling function. The process is simple, use Haar scaling and then do iteration. I successfully construct the scaling function. using the exact method and with different order of coefficients, i couldn't get the desire wavelet function.
%%
cons = [1+sqrt(3), 3+sqrt(3), 3-sqrt(3), 1-sqrt(3)]/4;
iters = 4;
f = ones(1,50);
points = 100;
length_f = 50;
for iter = 0:iters
step_size = points*2^(iter-1);
temp_t = 0:1/((2^iter)*points):4;
temp_f = zeros(size(temp_t));
for l = 0:3
temp_f(l*step_size+1:length_f+l*step_size) = cons(l+1)*f(1:length_f) + temp_f(l*step_size+1:length_f+l*step_size);
end
f = temp_f;
length_f = find(f==0, 1)-1;
plot(temp_t, f)
title("Daubechies 2 Scaling Function: iter", iter+1)
xlabel("t")
ylabel("\phi(t)")
pause(1)
end
%%
cons = [sqrt(3)-1, 3-sqrt(3), -3-sqrt(3), 1+sqrt(3)]/4;
iters = 5;
f = ones(1,50);
points = 100;
length_f = 50;
for iter = 0:iters
step_size = points*2^(iter-1);
temp_t = 0:1/((2^iter)*points):4;
temp_f = zeros(size(temp_t));
for l = 0:3
temp_f(l*step_size+1:length_f+l*step_size) = cons(l+1)*f(1:length_f) + temp_f(l*step_size+1:length_f+l*step_size);
end
f = temp_f;
length_f = find(f==0, 1)-1;
plot(temp_t, f)
title("Daubechies 2 Wavelet Function: iter", iter+1)
xlabel("t")
ylabel("\phi(t)")
pause(1)
end

채택된 답변

konoha
konoha 2021년 8월 17일
cons_c = [1+sqrt(3), 3+sqrt(3), 3-sqrt(3), 1-sqrt(3)]/4;
cons_w = [-(sqrt(3)-1), 3-sqrt(3), -(3+sqrt(3)), 1+sqrt(3)]/4;
iters = 4;
f = ones(1,50);
points = 100;
length_f = 50;
for iter = 0:iters
step_size = points*2^(iter-1);
temp_t = 0:1/((2^iter)*points):4;
temp_cf = zeros(size(temp_t));
temp_wf = zeros(size(temp_t));
for l = 0:3
temp_cf(l*step_size+1:length_f+l*step_size) = cons_c(l+1)*f(1:length_f) +...
temp_cf(l*step_size+1:length_f+l*step_size);
end
f = temp_cf;
for l2 = 0:3
temp_wf(l2*step_size+1:length_f+l2*step_size) = cons_w(l2+1)*f(1:length_f) +...
temp_wf(l2*step_size+1:length_f+l2*step_size);
end
length_f = find(f==0, 1)-1;
subplot(2, 1, 1)
plot(temp_t, f)
title("Daubechies 2 Scaling Function: iter", iter+1)
xlabel("t")
ylabel("\phi(t)")
subplot(2, 1, 2)
plot(temp_t, temp_wf)
title("Daubechies 2 Wavelet Function: iter", iter+1)
xlabel("t")
ylabel("\psi(t)")
pause(1)
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Continuous Wavelet Transforms에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by