I am trying to implement DWT (Discrete Wavelet Transform) on a given signal, without using the dwt function in Matlab. My approach was to get the synthesis filter coefficients using,
[LoD, HiD, LoR, HiR] = wfilters('db4')
and then get the approximation and detail coefficients by convolving my input signal with the filters and then downsampling by 2
a = downsample(conv(x,LoD),2);
d = downsample(conv(x,HiD),2);
But the output for this doesn't match the output I get after using the Matlab function.
[a,d] = dwt(x,LoD,HiD)
Do I need to pad my signal for it to match the output? I have tried symmetric padding but it didn't help much.