410 likes | 422 Views
Digital Signal Processing. Instructor: L. J. Wang, Dept. of Information Technology, National Pingtung Institue of Commerce Reference: Gilbert Strang and Truong Nguyen, Wavelets and Filter Banks, Wellesley-Cambridge Press, 1996.
E N D
Digital Signal Processing Instructor: L. J. Wang, Dept. of Information Technology, National Pingtung Institue of CommerceReference: Gilbert Strang and Truong Nguyen, Wavelets and Filter Banks, Wellesley-Cambridge Press, 1996. Reference: Mark S. Drew, Simon Fraser University, Canada. (http://www.sfu.ca/) L. J. Wang
Transforms • The transform of a signal (a vector) is a new repre-sentation of that signal. • Three groups of transforms: • Lossless (orthogonal) transforms • Invertible (biorthogonal) transforms • Lossy transforms (not invertible) L. J. Wang
Lossless (orthogonal) transforms • A lossless unitary transform is like rotation. • The transformed signal has the same length as the original. • The same signal is measured along new perpendicular axes. • Example: • FFT (Fast Fourier Transform) • DCT (Discrete Cosine Transform) • DST (Discrete Sine Transform) • HT (Hartley Transform) L. J. Wang
Invertible (biorthogonal) transforms • For biorthogonal transforms, lengths and angles may change. • The new axes are not necessarily perpendicular, but no information is lost. • Perfect reconstruction is still available. • It just inverts. • These transforms don’t remove any information (or any noise), they just move it around – aiming to separate out the noise and decorrelate the signal. L. J. Wang
Lossy transforms • Orthogonal transforms give orthogonal matrices and unitary transforms • Biorthogonal transforms give invertible matrices and perfect reconstruction. • For Lossy transforms: • The irreversible step is to destroy small components, as we do below in “compression”. • The invertible is lost. L. J. Wang
An example of transforms • The transform from x to y is executed by a matrix : • The matrix that recovers x from y is changed only by the factor 1/2 : L. J. Wang
An example of transforms (II) • If x(0)=1.2, x(1)=1.0, x(2)=-1.0, x(3)=-1.2 then: (compute sums and differences) y(0)=x(0)+x(1)=1.2+1.0=2.2 y(1)=x(0)-x(1)=1.2-1.0=0.2 y(2)=x(2)+x(3)=(-1.0)+(-1.2)=-2.2 y(3)=x(2)-x(3)=(-1.0)-(-1.2)= 0.2 • y(1) and y(3) are much smaller than y(0) and y(2). If we cancel the small numbers y(1) and y(3) --- the compressed signal yc is yc(0)=2.2, yc(1)=0, yc(2)=-2.2 and yc(3)=0. L. J. Wang
An example of transforms (III) • Those numbers 0.2 were below our threshold. In the compressed yc they are gone. • Finally, the signal xc reconstructed from yc: xc(0)=(yc(0)+yc(1))/2=(2.2+0)/2=1.1 xc(1)=(yc(0)-yc(1))/2=(2.2-0)/2=1.1 xc(2)=(yc(2)+yc(3))/2=(-2.2+0)/2=-1.1 xc(3)=(yc(2)-yc(3))/2=(-2.2-0)/2=-1.1 • The small difference between x(0) and x(1) is lost. L. J. Wang
Discrete Cosine Transform (DCT) • From spatial domain to frequency domain: L. J. Wang
DEFINITIONS: DCT/IDCT • Discrete Cosine Transform (DCT): • Inverse Discrete Cosine Transform (IDCT): L. J. Wang
64 (8 x 8) DCT basis functions L. J. Wang
Why DCT not FFT? • DCT is like FFT, but can approximate linear signals well with few coefficients. L. J. Wang
Computing the DCT • Factoring reduces problem to a series of 1D DCTs: • Most software implementations use fixed point arithmetic. Some fast implementations approximate coefficients so all multiplies are shifts and adds. L. J. Wang
Wavelets • A key idea for wavelets is concept of “scale”. • Sums and differences of neighbors are at the finest scale. • This is recursion --- the same transform at a new scale. • It leads to a multiresolution of the original signal. • Averages and details will appear at different scales. L. J. Wang
Wavelets (II) • The wavelet formulation keeps the differences y(1) and y(3) at the finest level, and iterates only on y(0) and y(2). (Following an example of transforms) • Iteration means sum and difference of the transform: z(0)=y(0)+y(2)=0 z(2)=y(0)-y(2)=4.4 • At this level there is extra compression. One component z(2) now does most of the work of the original four. L. J. Wang
Wavelets (III) • The wavelet transform is: z(0)=0 y(1)=0.2 z(2)=4.4 y(3)=0.2 • The compressed signal is: (after threshold) zc(0)=0 yc(1)=0 zc(2)=4.4 yc(3)=0 L. J. Wang
Wavelets (IV) • The multilevel transforms by recursion is clear in a flow-graph: • This is two-step wavelet transform. It is invertible. • To draw the flow-graph of the inverse, just reverse the arrows. L. J. Wang
Wavelet Transforms L. J. Wang
Wavelet Transforms (II) L. J. Wang
Wavelet Transforms (III) L. J. Wang
Wavelet Transforms (IV) L. J. Wang
Wavelet Transforms (V) L. J. Wang
Wavelet Transforms (VI) L. J. Wang
Wavelet Transforms (VII) L. J. Wang
Haar Wavelets • Scaling functions: • Haar scaling function is defined by and is shown in Fig.H-1. Some examples of its translated and scaled versions are shown in Fig.H-2~H-4. • Two-scale relation for Haar scaling function is L. J. Wang
Haar Wavelets (II) L. J. Wang
Haar Wavelets (III) • Wavelets: • Haar wavelet (x) is given by and is shown in Fig.H-5. • Two-scale relation for Haar wavelet is L. J. Wang
Haar Wavelets (IV) L. J. Wang
Haar Wavelets (V) • Decomposition relation: • Reconstruction relation: L. J. Wang
Biorthogonal Filter Bank L. J. Wang
5/3 Analysis Filter L. J. Wang
5/3 Synthesis Filter L. J. Wang
5/3 Filter Examples L. J. Wang
9/7 Wavelet Filter L. J. Wang
9/7 Filter Example L. J. Wang
Image decomposition L. J. Wang
Daubechies Wavelet D4 Filter L. J. Wang
Daubechies Wavelet D4 Filter (II) L. J. Wang