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

Discussion in 'Programmer's Corner' started by annda, Jul 20, 2008.

  1. annda

    Thread Starter New Member

    Jul 2, 2008
    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. :)
  2. markintosh

    New Member

    Mar 24, 2009
    you can iterate the dwt and idwt process to obtain the requested level of decomposition, something similar to this could work:
    Code ( (Unknown Language)):
    1. [LO_D, HI_D, LO_R, HI_R] = wfilters('haar'); %% type of wavelet %%
    2. %% First level decomposition %%
    3. [CA_lev_1, CD_lev_1] = dwt(signal,LO_D, HI_D);
    5. %% Second level decomposition %%
    6. [CA_lev_2_1, CD_lev_2_1] = dwt(CA_lev_1,LO_D, HI_D);
    7. [CA_lev_2_2, CD_lev_2_2] = dwt(CD_lev_1,LO_D, HI_D);
    9. %% Third level decomposition %%
    10. [CA_lev_3_1_1, CD_lev_3_1_1] = dwt(CA_lev_2_1,LO_D, HI_D);
    11. [CA_lev_3_1_2, CD_lev_3_1_2] = dwt(CD_lev_2_1,LO_D, HI_D);
    12. [CA_lev_3_2_1, CD_lev_3_2_1] = dwt(CA_lev_2_2,LO_D, HI_D);
    13.  [CA_lev_3_2_2, CD_lev_3_2_2] = dwt(CD_lev_2_2,LO_D, HI_D);
    15. %% Reconstruction %%
    17. CD_lev_2_2 = idwt(CA_lev_3_2_2, CD_lev_3_2_2, LO_R, HI_R);
    18. CA_lev_2_2 = idwt(CA_lev_3_2_1, CD_lev_3_2_1, LO_R, HI_R);
    19. %% 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.
  3. hari1692

    New Member

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