How to implement Haar wavelet from scratch

9 次查看(过去 30 天)
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.

回答(1 个)

Nithin
Nithin 2023-10-11
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.

类别

Help CenterFile Exchange 中查找有关 Discrete Multiresolution Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by