 # Matlab Code for Discrete Wavelet Transform

Spread the love

In numerical analysis and functional analysis, a discrete wavelet transform (DWT) is any wavelet transform for which the wavelets are discretely sampled. As with other wavelet transforms, a key advantage it has over Fourier transforms is temporal resolution: it captures both frequency and location information (location in time)

## Matlab code for Discrete Wavelet Transform

```%Read Input Image

Input_Image=imread('rose.bmp');

%Red Component of Colour Image

Red_Input_Image=Input_Image(:,:,1);

%Green Component of Colour Image

Green_Input_Image=Input_Image(:,:,2);

%Blue Component of Colour Image

Blue_Input_Image=Input_Image(:,:,3);

%Apply Two Dimensional Discrete Wavelet Transform

[LLr,LHr,HLr,HHr]=dwt2(Red_Input_Image,'haar');

[LLg,LHg,HLg,HHg]=dwt2(Green_Input_Image,'haar');

[LLb,LHb,HLb,HHb]=dwt2(Blue_Input_Image,'haar');

First_Level_Decomposition(:,:,1)=[LLr,LHr;HLr,HHr];

First_Level_Decomposition(:,:,2)=[LLg,LHg;HLg,HHg];

First_Level_Decomposition(:,:,3)=[LLb,LHb;HLb,HHb];

First_Level_Decomposition=uint8(First_Level_Decomposition);

%Display Image

subplot(1,2,1);imshow(Input_Image);title('Input Image');

subplot(1,2,2);imshow(First_Level_Decomposition,[]);title('First Level Decomposition');

``` ## Applications of DWT

The discrete wavelet transform has a huge number of applications in science, engineering, mathematics and computer science. Most notably, it is used for signal coding, to represent a discrete signal in a more redundant form, often as a preconditioning for data compression. Practical applications can also be found in signal processing of accelerations for Image recognition ,Image retrieval techniques in digital communications and many others