Ex. 5.19
Ex. 5.19
Show that the Haar wavelet transform of a signal of length \(N=2^J\) can be computed in \(O(N)\) computations.
Soln. 5.19
We refer to Section 2.1 in Wavelet Methods in Statistics with R for readers interested in the pyramidal technique for Haar wavelet transform. Here we give a high level idea on why the time complexity is \(O(N)\).
Given a discrete sequence of data \(y=(y_1,y_2,...,y_N)\), without loss of generality, we assume that \(N=2^J\) for some integer \(J\ge 0\), the pyramidal technique consists of \(J\) steps, in each step, we calculate
for \(j=J-1,...,0\) and \(k=1,...,2^{j}\). Let \(c_{J, k} = y_k\) for initialization. At \(j\)-th step, the time complexity is \(2 * 2^j=2^{j+1}\), therefore the total time complexity is
Thus the complexity is \(O(N)\).