Effacer les filtres
Effacer les filtres

Display Aproximation Coefficients from a Wavelet Transform using 3 Scales

1 vue (au cours des 30 derniers jours)
José Santos Pérez Leal
José Santos Pérez Leal le 28 Juin 2021
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 commentaire
José Santos Pérez Leal
José Santos Pérez Leal le 29 Juin 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')

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur MATLAB 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!

Translated by