The input signal x(n) is decomposed into two sets of coefficients called approximation coefficients (denoted by ca) and detail coefficients (denoted by cd). These coefficients are obtained by convolving the input signal with a low-pass filter (for ca) or a high-pass filter (for cd) and then downsampling the convolution result by 2. The size of ca and cd is half of the size of the input signal for Periodic extention mode, and half of the sum of the input signal's size and the filter's size for Zero-padded extention mode. Note that the filters are determined by the chosen wavelet
The computation is implemented with a NAG function: nag_dwt().