필터 지우기
필터 지우기

How to implement Haar wavelet from scratch

조회 수: 12 (최근 30일)
Sudhir Kumar
Sudhir Kumar 2022년 4월 18일
답변: Nithin 2023년 10월 11일
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