Borrar filtros
Borrar filtros

How to implement Haar wavelet from scratch

9 visualizaciones (últimos 30 días)
Sudhir Kumar
Sudhir Kumar el 18 de Abr. de 2022
Respondida: Nithin el 11 de Oct. de 2023
I have a audio signal recording sampling frequency of 16KHZ. I want to do sub band coding using Haar transform of that audio signal. How to impliment Haar wavelet transoform from scratch without using matlab inbuilt function. Is there any link to find please suggest me.

Respuestas (1)

Nithin
Nithin el 11 de Oct. de 2023
Hi Sudhir,
I understand that you want to implement the "haar transform" of an audio signal without using inbuilt MATLAB function.
To implement this, kindly refer to the following steps:
1. Load your audio signal sampled at 16 kHz into MATLAB.
2. Implement the Haar wavelet transform as a custom function:
function output = haar_transform(signal)
N = length(signal);
output = zeros(size(signal));
for len = N/2:-1:1
avg = (signal(1:2:len) + signal(2:2:len)) / 2;
diff = (signal(1:2:len) - signal(2:2:len));
signal(1:len) = avg;
output(len+1:2*len) = diff;
end
end
3. Call the "haar_transform" function on your audio signal to obtain the Haar wavelet coefficients.
haar_coefficients = haar_transform(your_audio_signal);
For more information regarding "haar transform", kindly refer to the following documentation:
I hope this answer resolves your query.
Regards,
Nithin Kumar.

Categorías

Más información sobre Discrete Multiresolution Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by