Clear Filters
Clear Filters

Display Aproximation Coefficients from a Wavelet Transform using 3 Scales

1 view (last 30 days)
Hi, everyone.
I'm applying a Wavelet Transform to a signal using 3 Scales. My code is this one:
[c,l]=wavedec(bandpass_data,3,'db2'); %Descomposición de la señal en 3 niveles
approx=appcoef(c,l,'db2'); %Coeficientes de aproximación (Frecuencias bajas)
[cd1,cd2,cd3]=detcoef(c,l,[1,2,3]); %Coeficientes de detalle (Frecuencias altas)
subplot(5,1,1)
plot(bandpass_data)
title('Señal Original')
subplot(5,1,2)
plot(approx)
title('Coeficientes de Aproximación')
subplot(5,1,3)
plot(cd3)
title('Coeficientes de Detalle - Nivel 3')
subplot(5,1,4)
plot(cd2)
title('Coeficientes de Detalle - Nivel 2')
subplot(5,1,5)
plot(cd1)
title('Coeficientes de Detalle - Nivel 1')
And the signal bandpass_data is attached to this message.
My problem is: How can I display the approximation coefficients from scale 1 and 2 too in graphs, because I'm only displaying the approximation coefficient from scale 3?? I already do it with the detail coefficients, but I can't figure it out how to do the same thing with the approximation coefficients.
If someone could help me I would be very greatful.
  1 Comment
José Santos Pérez Leal
José Santos Pérez Leal on 29 Jun 2021
I already solve this problem. This is my solution, in case it helps someone:
[c,l]=wavedec(bandpass_data,3,'db2'); %Descomposición de la señal en 3 niveles
Lev=1;
ca1=appcoef(c,l,'db2',Lev); %Coeficientes de aproximación (Frecuencias bajas)
Lev2=2;
ca2=appcoef(c,l,'db2',Lev2); %Coeficientes de aproximación (Frecuencias bajas)
Lev3=3;
ca3=appcoef(c,l,'db2',Lev3); %Coeficientes de aproximación (Frecuencias bajas)
[cd1,cd2,cd3]=detcoef(c,l,[1,2,3]); %Coeficientes de detalle (Frecuencias altas)
subplot(7,1,1)
plot(bandpass_data)
title('Señal Original')
subplot(7,1,2)
plot(ca1)
title('Coeficientes de Aproximación - Nivel 1')
subplot(7,1,3)
plot(ca2)
title('Coeficientes de Aproximación - Nivel 2')
subplot(7,1,4)
plot(ca3)
title('Coeficientes de Aproximación - Nivel 3')
subplot(7,1,5)
plot(cd1)
title('Coeficientes de Detalle - Nivel 1')
subplot(7,1,6)
plot(cd2)
title('Coeficientes de Detalle - Nivel 2')
subplot(7,1,7)
plot(cd3)
title('Coeficientes de Detalle - Nivel 3')

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!