Coding wavelets the easy way

Zero insertion


We are now going to implement the box in the diagram which has an upward arrow.
The definition of the operator is the following: considering a structured signal, the output is obtained by inserting a zero between every value of the input. As far as synchronization is concerned, the signal at index 0 retains its value at index 0.
If you want to see this in terms of z-transform, the z-transform is obtained by replacing the indeterminate z by z^2.
You will code this into a function file named "zeroinsert.m" (the file extension may not show on some systems).
You will need to use the Matlab functions zeros, and size (to check whether the input is a line or column oriented vector. Also, have a look at the help for the colon ":" operator.
The solution is here.

Summary


We have implemented the following box in the diagram

OversamplingBox