Filter löschen
Filter löschen

How to implement Haar wavelet from scratch

9 Ansichten (letzte 30 Tage)
Sudhir Kumar
Sudhir Kumar am 18 Apr. 2022
Beantwortet: Nithin am 11 Okt. 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.

Antworten (1)

Nithin
Nithin am 11 Okt. 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.

Kategorien

Mehr zu Discrete Multiresolution Analysis finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by