# Wavelet transform wavdec returns matrix of the wrong size

I have a question regarding the wavdecand dwt functions in MATLAB.

I am using wavdec(y,3,db4) on a size 1024 signal, which means I am trying to compute the third level db4 transform of the size 1024 signal y. If I am thinking about this correctly, theoretically the returned matrix after the transform should also be of size 1024.

However, when I perform the transform, the matrix I get returned is size 1044, which is 20 samples bigger than my original matrix.

Would anyone please be able to explain to me why this is happening?

dwtmode('per')