# multi level discrete wavelet transform of audio signal (one dimensional signal)

#### annda

Joined Jul 2, 2008
3
Hi all..

Currently, I'm working on my project about audio steganography using discrete wavelet transform (dwt). I'm using matlab to code and implement the system.

My goal is to successfully embed a text (*.txt) file used as message to be hidden in an audio file (*.wav).

I have no problem to make the system work by using single level dwt because in matlab there are built-in dwt and idwt function that can be used to decompose and reconstruct an one dimensional signal.

My problem is I can't do the multi-level dwt decomposition and reconstruction of a 1-D signal.

Well, there really are built-in function in matlab to do this, i.e. wavedec and waverec. But I can't use it straight away.

In my case, I need to access and modify the last level approximation coefficient or detail coefficient, and reconstruct the signal with this modified coefficient. Meanwhile, waverec will reconstruct signal using the coefficient produced by wavedec function *I suppose*. That will return in the original signal with no modified coefficient.

If anyone can help me, it'll be great.
Thank you before.

#### markintosh

Joined Mar 24, 2009
3
you can iterate the dwt and idwt process to obtain the requested level of decomposition, something similar to this could work:
Rich (BB code):
[LO_D, HI_D, LO_R, HI_R] = wfilters('haar'); %% type of wavelet %%
%% First level decomposition %%
[CA_lev_1, CD_lev_1] = dwt(signal,LO_D, HI_D);

%% Second level decomposition %%
[CA_lev_2_1, CD_lev_2_1] = dwt(CA_lev_1,LO_D, HI_D);
[CA_lev_2_2, CD_lev_2_2] = dwt(CD_lev_1,LO_D, HI_D);

%% Third level decomposition %%
[CA_lev_3_1_1, CD_lev_3_1_1] = dwt(CA_lev_2_1,LO_D, HI_D);
[CA_lev_3_1_2, CD_lev_3_1_2] = dwt(CD_lev_2_1,LO_D, HI_D);
[CA_lev_3_2_1, CD_lev_3_2_1] = dwt(CA_lev_2_2,LO_D, HI_D);
[CA_lev_3_2_2, CD_lev_3_2_2] = dwt(CD_lev_2_2,LO_D, HI_D);

%% Reconstruction %%

CD_lev_2_2 = idwt(CA_lev_3_2_2, CD_lev_3_2_2, LO_R, HI_R);
CA_lev_2_2 = idwt(CA_lev_3_2_1, CD_lev_3_2_1, LO_R, HI_R);
%% and so on %%
only two tips:
-feed the algortihm with a number of elements multiple of 2^number-of_level to avoid the creation of a number of decomposed parameters bigger than half the original size
- if you change the wavelet mother function the size of the two output vectors will be no more half the original size, so if you do this analyse step by step the size of the CA and CD generated before use them in the reconstruction.

#### hari1692

Joined Jan 29, 2013
3
hey,can u help me transforming the audio signal to image using audio to image wavelet transformation ???