Rochester Institute of Technology
RIT Scholar Works
Theses
Thesis/Dissertation Collections
5-23-2003
A flexible hardware architecture for 2-D discrete
wavelet transform: design and FPGA
implementation
Richard Carbone
Follow this and additional works at:
http://scholarworks.rit.edu/theses
This Thesis is brought to you for free and open access by the Thesis/Dissertation Collections at RIT Scholar Works. It has been accepted for inclusion in Theses by an authorized administrator of RIT Scholar Works. For more information, please [email protected].
Recommended Citation
A Flexible Hardware Architecture for 2-D Discrete
Wavelet Transform: Design and FPGA Implementation
by
Richard
L.
H. Carbone
May 23,2003
A thesis submitted in partial fulfillment of
the requirements for the degree of
Masters of Science in
Computer Engineering
Rochester Institute of Technology
Approved by:
Principal Advisor:
Dr. Andreas Savakis, Associate Professor and Department Head
Committee Member:
Dr. Marcin Lukowiak, Visiting Assistant Professor
Committee Member:
Release Permission Form
Rochester Institute of Technology
A Flexible Hardware Architecture for 2-D Discrete Wavelet Transfonn:
Design and FPGA Implementation
I, Richard Carbone, hereby grant pennission to the Wallace Library of the Rochester Institute of
Technology to reproduce my thesis in whole or in part. Any reproduction will not be for
commercial use or profit.
Abstract
The Discrete Wavelet Transform
(DWT)
is a powerful signalprocessing tool that has recently gained widespread acceptance in thefield ofdigital image processing. The multiresolution analysis providedby
the DWTaddresses the shortcomings ofthe Fourier Transform and itsderivatives. The DWThasproven usefulin thearea of imagecompression whereitreplaces the Discrete Cosine Transform
(DCT)
in newJPEG2000andMPEG4 image and video compression standards. The Cohen-Daubechies-Feauveau(CDF)
5/3 and CDF 9/7 DWTs are usedfor reversible lossless and irreversiblelossy
compression encoders in the JPEG2000 standard respectively.Thedesignandimplementation ofaflexible hardwarearchitectureforthe2-D DWT ispresented
inthis thesis. Thisarchitecturecanbeconfiguredtoperformboth theforwardandinverseDWT for any DWT
family,
usingfixed-pointarithmetic and no auxiliarymemory. TheLifting
Scheme methodis usedtoperform theDWT insteadoftheless efficient convolution-based methods. TheDWTcore is modeled using MATLAB and
highly
parameterized VHDL. The VHDL model is synthesized to a Xilinx FPGA to prove hardware functionality. The CDF 5/3 and CDF 9/7 versions ofthe DWT are both modeled and used as comparisons throughout this thesis. The DWTcoreis usedinconjunction with averysimpleimagedenoising
module to demonstrate thepotentialoftheDWTcoretoperformimage processingtechniques.
The CDF 5/3 hardwareproduces identical resultsto its theoreticalMATLABmodel. The fixed-pointCDF 9/7 deviates very slightlyfrom itsfloating-point MATLABmodel witha ~59dBPSNR deviation fornine levels ofDWT decomposition. Theexecution timefor performing both DWTs isnearly identicalat -14clock cycles perimagepixelforone levelofDWTdecomposition. The hardware area generatedforthe CDF 5/3 is -16,000 gates using only 5% ofthe XilinxFPGA
Acknowledgements
Table
ofContents
Release Permission Form i
Abstract ii
Acknowledgements iii
TableofContents iv
ListofFigures vi
ListofTables ix
Chapter 1. Introduction 1
Chapter2.Background 3
2.1. Wavelet Motivation 3
2.1.1. Fourier Transform 4
2.1.2. Short Term Fourier Transform 4
2.2. MultiresolutionAnalysisandtheWavelet Transform 5
2.2.1. Continuous Wavelet Transform
(CWT)
62.2.2. Discrete Wavelet Transform
(DWT)
82.3. BiorthogonalWavelets 12
2.3.1. CDF 5/3 13
2.3.2. CDF 9/7 14
2.4. DWT using Convolution 16
2.5. DWT using
Lifting
Scheme 182.5.1. Featuresof
Lifting
Scheme 242.5.2.
Lifting
Step
Extraction 252.5.3. CDF 5/3 DWT using
Lifting
Scheme 262.5.4. CDF 9/7 DWT using
Lifting
Scheme 302.6. 2-D DWTandDigital Images 34
2.6.1. 2-D DWT 34
2.6.2. 2-D DWT Properties andDigital Images 39
2.7. Wavelet ApplicationstoDigital Images 41
2.7.1. Image
Denoising
412.7.2. Image Compression 44
2.8. Current Implementations ofDWT 47
2.8.1. Software 48
2.8.2. Hardware 48
Chapter 3.DesignandImplementationofDWT Core 51
3.1. DWT Core Features 51
3.2. DWT Core Design 53
3.3. DWT CoreImplementation 80
3.3.1. MATLAB Implementation 80
3.3.2. VHDLImplementation 81
3.3.3. FPGAImplementation 82
Chapter4. Results 86
4.1. DWT CoreVerification 86
4.1.1. MATLABVerification 88
4.1.2. VHDLVerification 93
4.2. PerformanceAnalysis 97
4.3. Synthesis Results 100
4.3.1. Hardware Area 100
4.3.2. Hardware Speed 103
4.4.
Denoising
Results 105Chapters.Conclusion 109
5.1. Recommendations for Future Work 109
References 117
Appendix 119
Appendix A: DWT Images 119
Appendix B:
Denoising
Results 120Appendix C: MATLAB Source Code 121
Appendix D: VHDL Source Code 122
List
ofFigures
Figure2.1: Exampleof aMother Wavelet 7
Figure2.2: ExampleofScaled
Baby
Wavelet 7Figure 2.3: ExampleofTranslated
Baby
Wavelet 7Figure2.4: Dyadic
Sampling
9Figure 2.5: Subband Decomposition without
Scaling
Function 9 Figure 2.6: Subband Decomposition withScaling
Function 10 Figure 2.7: HaarFamily
Wavelet(a)
andScaling
Function(b)
10 Figure 2.8: DWT AnalysisofSignal using Two-Channel SubbandCoding
11 Figure 2.9: Multiple Level DWT AnalysisofSignal using Two-Channel SubbandCoding
12 Figure 2.10: DWT SynthesisofSignal using Two-Channel SubbandCoding
12Figure 2.11: CDF 5/3 Analysis Wavelet 13
Figure 2.12: CDF 5/3 Synthesis Wavelet 13
Figure 2.13: CDF 9/7 Analysis Wavelet 14
Figure 2.14: CDF 9/7 Synthesis Wavelet 15
Figure 2.15: Forward DWT using Convolution 17
Figure 2.16: Split
Step
ofForward DWT usingLifting
Scheme 19 Figure 2.17: SplitandPredict StepsofForward DWT usingLifting
Scheme 20 Figure 2. 18:Split, Predict,
andUpdate StepsofForward DWT usingLifting
Scheme 21 Figure 2.19: Forward DWT usingLifting
SchemewithMultipleLifting
Steps 22 Figure 2.20: Forward DWT usingLifting
SchemewithMultipleLifting
andScaling
Steps 23Figure 2.21: Inverse DWTvia
Lifting
Scheme 23Figure 2.22: Inverse DWT using
Lifting
SchemewithMultipleLifting
andScaling
Steps 24 Figure 2.23: Forward CDF 5/3 DWT usingLifting
Scheme 27 Figure 2.24: Forward CDF 9/7 DWT usingLifting
Scheme 32Figure 2.25: Forward 2-D DWT 35
Figure 2.26: Forward 2-D DWT Row
Processing
ofImage 35Figure 2.27: Forward 2-D DWT Column
Processing
ofImage 36Figure 2.28: Forward 2-D DWTofImage 36
Figure 2.29: Forward 2-D DWT for Multiple LevelsofDecomposition 37 Figure 2.30: Forward 2-D DWT RowandColumn
Processing
ofImagefor Multiple LevelsofDecomposition 37
Figure 2.3 1: Forward 2-D DWTofImage for Multiple LevelsofDecomposition 38
Figure 2.32: Image
Denoising
Block Diagram 42Figure2.33: Hard
Thresholding
43Figure2.34: Soft
Thresholding
43Figure2.35: ImageCompressionBlock Diagram 45
Figure2.36: Embedded Zero Tree 47
Figure 2.37:
Analog
DevicesADV601Chip
Block Diagram 49Figure 3.1: DWTCore ComponentDiagram 53
Figure3.2: DWT CoreInterface 54
Figure3.3: MEMORY_CONTROLLERStateDiagram 55
Figure 3.4: MULTI_LIFT_REORDER_2D_CTRLState Diagram 56
Figure3.5: LIFT_REORDER_2D_CTRLState Diagram 58
Figure 3.7: LIFT_RE0RDER_1D_CTRLState Diagram 61
Figure 3.8: Forward CDF 5/3 DWTofRowofPixels using
Sliding
Window Method 63Figure3.9: Forward CDF 9/7 DWTofRowofPixels using
Sliding
Window Method 65Figure3.10:
Reordering
ofScaling
andWaveletCoefficientswithin aRow 66Figure 3.1 1:
Reordering
AlgorithmforScaling
andWaveletCoefficients within aRow 69Figure3.12: LIFT_1D_CTRL
Lifting
Scheme StateMachine 72Figure 3.13: LIFT_1D_CTRL
Reordering
State Machine 74Figure 3.14: Forward ConfigurationofSLTDING_WINDOWunitfor CDF 5/3 DWT 76 Figure 3.15: Inverse ConfigurationofSLTDING_WINDOWunitfor CDF 5/3 DWT 76 Figure 3.16: Forward ConfigurationofSLIDlNG_WINDOWunitfor CDF 9/7 DWT 77 Figure 3.17: Inverse ConfigurationofSLTDING_WINDOWunitfor CDF 9/7 DWT 77 Figure 3.18: ExampleofGenerated FPT_COEF_MULT Hardware 80
Figure 3.19: PictureofXSV-300 FPGA
Prototyping
Board 83Figure 3.20: Module DiagramofXSV-300 FPGA
Prototyping
Board 83 Figure 3.21: SRAM Interface Circuit Diagram for XSV-300 FPGAPrototyping
Board 84 Figure 3.22: Clock Interface Circuit Diagram for XSV-300 FPGAPrototyping
Board 84 Figure 3.23: Input Switch Interface Circuit Diagram for XSV-300 FPGAPrototyping
Board.. 84Figure 3.24: Output LED Interface Circuit Diagram for XSV-300 FPGA
Prototyping
Board... 85Figure 4.1: Lena 512x512 Pixel 8-bit Grayscale Image 87
Figure 4.2: ComparisonofLena Image Transformed using CDF 9/7 DWT Convolutionand
Lifting
Schemefor Multiple LevelsofDecomposition 89 Figure 4.3: ComparisonofLena Image Transformed using CDF 9/7 DWTLifting
SchemewithActualandApproximated Coefficients for Multiple LevelsofDecomposition 90 Figure 4.4: ComparisonofLena Image TransformedandReconstructed MultipleTimes using
Lifting
Scheme CDF 9/7 DWT for Multiple LevelsofDecomposition 92Figure 4.5: Rapper 75x84 Pixel 8-bit Grayscale Image 94
Figure 4.6: Execution Time for CDF 5/3andCDF 9/7 DWTonRapper Image for Multiple
LevelsofDecomposition 94
Figure 4.7: Normalized
Complexity
of2-D DWT for Different LevelsofDecomposition 97 Figure 4.8: NormalizedMemory
Bandwidth(Reads/Writes)
for CDF5/3 andCDF 9/7 DWTusing
Convolution,
Lifting
Scheme,
andDWTCore 99Figure 4.9: Normalized Arithmetic Operations for CDF 5/3 andCDF9/7 DWT using
Convolution,
Lifting
Scheme,
andDWT Core 100Figure 4.10: Combinational Logic Units for CDF 5/3 andCDF 9/7 DWT Synthesized for
Maximum Speed/Minimum Area usingRipple-Carry/CLAadders 101 Figure 4.11: Sequential Logic Units for CDF 5/3andCDF 9/7 DWT Synthesized for Maximum
Speed/MinimumArea usingRipple-Carry/CLAadders 102
Figure 4.12: Tri-State Buffer Units for CDF 5/3 andCDF 9/7 DWT Synthesized for Maximum
Speed/Mimmum Area usingRipple-Carry/CLAadders 102
Figure 4.13: Maximum Clock Speed for CDF 5/3 andCDF 9/7 DWT Synthesized for Maximum
Speed/MinimumArea usingRipple-Carry/CLAadders 103
Figure 4.19: Best Wavelet
Denoising
Results for Lena ImagewithSpeckle Noise 108Figure 5.1: Module DiagramofHardware ImplementationofWavelet
Denoising
Processor. 1 10 Figure 5.2: Module DiagramofGeneric Hardware ImplementationofWavelet-BasedImageProcessor Ill
List
ofTables
Table2.1: NumberofGuard Bits Needed for CDF 5/3 DWT
Scaling
andWaveletCoefficientstoEliminate OverflowandUnderflow 39
Table2.2: NumberofGuard Bits Needed for CDF 9/7 DWT
Scaling
andWaveletCoefficientstoEliminate OverflowandUnderflow 39
Table 3.1: MEMORY_CONTROLLER State Output Table 55
Table3.2: MULTI_LIFT_REORDER_2D_CTRL State Output Table 57
Table 3.3: LIFT_REORDER_2D_CTRL State Output Table 59
Table 3.4: MULTI_LIFT_REORDER_lD_CTRL State Output Table 60
Table 3.5: LIFT_REORDER_lD_CTRL State Output Table 61
Table 3.6: LJPT_1D_CTRL
Lifting
Scheme State Output Table 73Table 3.7: LIFT_1D_CTRL
Reordering
State Output Table 75 Table 4.1: CDF 9/7 Actualvs.ApproximatedCoefficient ValuesandError 90 Table 4.2: Maximum Clock Speed for CDF 5/3andCDF 9/7 DWT Synthesizedfor MaximumSpeed/Minimum Area using Ripple-Carry/CLAadders 103 Table 4.3: Maximum Clock Speed andEquivalent GateCount for Hardware CDF 5/3 DWT
Chapter 1. Introduction
The digital multimedia revolution is upon us. The exchange ofinformation is rapidly moving
away from the traditional analog realm and into the digital arena fostered
by
theincreasing
availabilityofthe internet in homes and at work. The speed and ease of which digital mediaistransferredand manipulated makes it an attractive alternativeto conventional analogmedia such as audio and video. An example of digital media that has received alot of attention in recent years is digital images. Digital image processing techniques can be used to compress, reduce noise, or even understand information present in digital images making this format even more
desirable.
The Discrete Wavelet Transform
(DWT)
is a signal processing technique that isbeginning
to show promise in the field ofdigital image processing. The new JPEG2000 and MPEG4 still image and video compression standards are based upon the DWT and are shown to produce superior results over their previous incarnations that do not use the DWT [7]. The DWT haspotential for many other applications to digital images other than compression such as noise reduction [12]. A hardware DWT core could be integrated into digital camera or scanners to performimageprocessinginsidethedevicesuch asimagecompressiontoincreasetheamount of imagesthatcanbestoredinternally. Despitethebenefitsahardware DWTcore could provideto these applications there are very few hardware implementations of the DWT commercially available
[19,
20].Aflexible hardware architecturefor performing theDWTon adigital image ispresented inthis thesis. Thisarchitecture uses avariationofthe
lifting
schemetechnique thatprovides significant advantages overtheboth the standardlifting
scheme-based DWTand convolution-basedDWT,
such as smaller memory requirements, fixed-point arithmetic instead of more costlyfloating
point, andlessarithmetic computations [9]. Inaddition, thearchitectureis flexible inthatit can beconfiguredtoperformmany differentvariationsoftheDWT. ForexampletheJPEG2000still image compression standard uses the Cohen-Daubechies-Feauveau(CDF)
5/3 and CDF 9/7this thesis is flexible in that it allows for the hardware for either of these two DWTs to be
generatedautomatically.
The DWT coreis modeledusing MATLAB and VHDL. The VHDLmodel is synthesized toa
Xilinx FPGAtoprovehardware functionality. The CDF 5/3 andCDF 9/7versions oftheDWT
are both modeled and used as comparisons throughout this thesis. The DWT core is used in
conjunction with averysimpleimage
denoising
moduletodemonstratethepotential oftheDWTcoretoperformimage processingtechniques.
Following
the introduction provided here in Chapter1,
an introduction to the discrete wavelettransform is provided through a brief discussion of signal processing techniques in Chapter 2.
Techniques for performing the discretewavelet transformare explored. The application ofthe
discrete wavelet transform to digital image processing and current implementations are also
discussed. Chapter 3 describes the unique features of the DWT core developed in this thesis.
The designofthe DWTcoreandits implementation is discussed in detail. Chapter4 discusses
theverificationoftheDWTcore. Aperformance analysis oftheDWTcoreis givenalong with
results from hardware synthesis.
Finally
theresults from applyingwaveletdenoising
to imagesare discussed. Chapter 5 provides concluding remarks and explores various recommendations
for futureworkintheareaofthediscretewavelettransform, particularlytheDWTcoredesigned
for this thesis.
Following
Chapter 5 are the reference section and appendix. Appendix Acontains images transformedusingthe discrete wavelettransform, Appendix B contains images
and resultsfromwaveletimage
denoising,
AppendixC, D,
andEcontainMATLAB,
VHDLandChapter 2. Background
This chapter introduces the discrete wavelet transform through a brief discussion of signal
processingtechniques. Techniques for performing the discrete wavelet transform are explored. The application ofthe discretewavelettransform todigital images and currentimplementations
are alsodiscussed.
2.1. WaveletMotivation
Signals are omni-present in the real world. Signals are the vehicle for
delivering
informationsuch as sound and images. Signals represent avalue or amplitude thatvaries
depending
on its location within a particular domain. Some signals occur in the timedomain;
that is theamplitude ofthe signal varies with time. Other signals occur in the spatial
domain;
that is the amplitude ofthesignalvariesdepending
onitsspatiallocation. Anaudio signalis an example of atime-domain signalhaving
an amplitude that varies withtime. A digital image is an example ofaspatial-domain signalhaving
an amplitude, orintensity
that variesdepending
on thespatiallocationwithintheimage.
Signal processing involves theconditioning ofraw datasignals intoaformthatis more suitable
fortheirintended application. Mathematicaltransforms serve as apowerful toolused toextract information which is notreadily availablefrom theraw signal
by
converting a signal fromone domaintoanother. Ofteninformationthatisembeddedin onedomain,
suchasthe timedomain,
ismore apparentinanotherdomain,
such asthefrequency
domain. Oneexamplefrom[1]
istheElectrocardiography
(ECG)
signal. 'Thetypical shapeofahealthy
ECGsignalis wellknownto cardiologists.Any
significant deviation fromthat shape is usuallyconsidered tobe a symptom of a pathological condition. This pathological condition,however,
may not always be quite obvious in the original time-domain signal. Cardiologists usually use the time-domain ECG signals which are recorded on strip-charts to analyze ECG signals.Recently,
the new computerizedECGrecorders/analyzers also utilizethefrequency
information to decide whether a pathological condition exits. A pathological condition can sometimes be diagnosed moreeasily when the
frequency
content of the signal isanalyzed"
[1]. A mathematical tool for
2.1.1. Fourier Transform
In 1882 the French mathematician J. Fourier showed that any periodic function can be
decomposed into aninfinite sum of periodic complex exponential
functions,
or sinusoids. After manyyears Fourier'sideas were generalizedto non-periodic functions andfinally
to periodic or non-periodic discrete time signals resulting in the Fourier Transform (FT). The FT converts atime-domainsignal intothe
frequency
domainthusproviding information asto whichfrequency
components are presentina signal. The FTprovides perfect resolutioninthefrequency
domain;
inother words theexact frequenciespresentinthe signal aredetermined. The FTalso provides perfect time resolution in the time domain as the value ofthe signal at every instantoftime is known.Theshortcomings oftheFT are thatwhilethefrequenciespresentin asignal canbe determined withperfectresolution, there is zero resolution in the timedomain as the time location ofthese
frequenciesare unknown. HencetheFTis sufficientfor stationarysignals where
frequency
does not vary withtime, but for non-stationary signals whosefrequency
does varywithtime, simplyknowing
whichfrequency
components exists may not be sufficient. A possible solution tofinding
both thefrequency
component and where it occurs in time is the Short Term Fourier Transform.[2]
2.1.2. ShortTerm Fourier Transform
The FTis suitable only forstationary signalsbutnot for non-stationary signals. The solutionis tofindportions of anon-stationarysignalthatare stationary. The Short Term Fourier Transform
(STFT)
does exactly thisby
segmenting anon-stationary signal into sections, orwindows, andtreating
each window as a stationary signal. The FT is then performed on each window of stationary signals. Atime-frequency
representation can nowbe obtained fromthe signal sincefrequency
information foreachwindowhasalocation intime.time-intervals
in which certain bands of frequencies exist can be known providing imperfectresolution in both the
frequency
and time domains. Narrow windows provide good time resolution, but poorfrequency
resolution.Conversely,
wide windows provide goodfrequency
resolution,butpoortimeresolution. In addition,wide windows maynolongercontainstationary signals
defeating
thepurpose oftheSTFT. Whereas thekernel intheFT is a window ofinfinitelength providing perfect
frequency
resolution and zerofrequency
resolution, the kernel in theSTFT is a window of finite length yielding imperfect resolution in both cases. The time and
frequency
resolution problems are results ofaphysical phenomenon and existregardless ofthetransform used,
however,
it is possible to analyze a signal using a different approach, called Multiresolution Analysis.[2, 3]
2.2. Multiresolution AnalysisandtheWavelet Transform
Multiresolution analysis
(MRA)
analyzes signals at multiple frequencies yielding differentresolutions at each frequency. At higher frequencies good time resolution is obtained at the
expense of poorer
frequency
resolution.Conversely,
at lower frequencies there is goodfrequency
resolution, but poor time resolution. Thepower ofMRA lies in the fact that certain information may go undetected at one resolution, but may be readily apparent at another resolution.[2, 4]
The STFT dividedanon-stationarysignalintoafinitenumber ofstationary signals, windows,for analysis. As discussed earlier, the resolution problems arose from the manner in which the
original non-stationary signal was segmented.
Using
smaller windows yielded poorfrequency
resolution and using larger segments provided poor time resolution. One solution is to use a
fully
scalable, modulated window that is shifted along the signal at every position to extractfrequency
information. Thisprocess wouldthenberepeated manytimeswithslightly shorter orlonger windows for each new repetition until every size window has been applied to every
position ofthe signal. Theendresultwillbeacollection of
time-frequency
representations of a2.2.1. Continuous Wavelet Transform
(CWT)
The Continuous Wavelet Transform
(CWT)
is the most recent solution to overcome theshortcomings of the FT and STFT providing perfect resolution in both the time domain and
frequency
domain.The term "wavelet"
literally
means "small wave". A wavelet is a function of finite length(small)
and whichis oscillatory(wave)
having
an averagevalue,integral,
of zero. Thesearethe mostimportantproperties of a wavelet asthey
satisfy theadmissibilityandregularityconditionsrequired for decomposition
(analysis)
and reconstruction(synthesis)
of a signal without loss ofinformation. Further information isprovidedin
[3]
regardingthedetailsoftheadmissibilityandregularity conditions. Whereas basis functions for the
FT,
and hence theSTFT,
are sinusoids(the FTdecomposesa signal/functionintoa series ofsinusoids), thebasis functions fortheCWT are known as
"baby
wavelets". More specifically, the CWT decomposes a signal or function intoa series ofbaby
waveletfunctions. Thesebaby
waveletsare derivedfroma singleprototypewavelet viadilations or contractions
(scaling)
andtranslations (shifts). Thisprototypewaveletisaptly named the "mother wavelet". An example of amother wavelet and derived wavelets are
shownin Figures
2.1, 2.2,
and2.3.A
baby
wavelet y/ir(r) is derived from the mother wavelet y/(t)by
varying scaling andtranslation parameters s and x respectively as shown in equation 2.1. The /= is for energy
normalizationacrossthedifferentscales.
(2.1)
sAt)=
-nV/\-r^
s J
The CWTis performed
by
multiplyingthesignaltobeanalyzedby
all thebaby
waveletshaving
earlier referred to a
time-frequency
resolution.[3, 5]
The CWT y(s,r) of a functionf(t)
is defined in equation 2.2. denotes complex conjugation. The s and x parameters represent thenew scale andtranslation scales respectively.
H**)=
J/(fK(0*
(2-2)
Forcompletenesstheinverse CWTtransformisdefined inequation2.3.
/(')=
\\y{s,x)ifsr{t)dxds
(2.3)
Figure 2.1: Exampleof aMother Wavelet
Figure 2.2: ExampleofScaled
Baby
WaveletThe CWT addresses the limited time and
frequency
resolution shortcoming of the STFTby
providing
frequency
(scale)
informationof a signal atmany different resolutionshence providing aMRAof a signal.Sincecomputers perform almost all calculations andprocessingofsignalsintherealworld, there is a concern about how practical the CWT is to implement. There are three properties ofthe CWT that make it difficult to use.
First,
the CWT is performedby
continuously shifting acontinuously scalable functionover a signal andperformingcalculations betweenthe two. The second problemisthat thereisan infinite number of waveletsintheCWT. Thethirdproblemis
thatformostfunctionsthewavelettransformshaveno analytical solutionsand canbecalculated
only numerically or
by
an optical analog computer. The Discretized Continuous Wavelet Transformcanbeusedtoperformthe CWT usingcomputers andthusprovidethewaveletseriesof a signal,
however,
thisis onlya sampledversion oftheCWTandis stillhighly
redundantandthereforeinefficient. Asa resulttheDiscrete Wavelet Transformwas developedtoaddressthese issuesand makewaveletprocessingmore practical.
[3]
2.2.2. DiscreteWavelet Transform
(DWT)
The Discrete Wavelet Transform
(DWT)
requires a discrete mother wavelet since thecomputationcomplexity ofperforming analysis of a signal with a continuous wavelet as inthe CWT is not efficient. Discrete wavelets can only be scaled and translated in discrete steps as
they
are not continuously scalable or translatable. The representation for the new discretized wavelet is shown in equation2.4,
j
andk are integers and so > 1 is a fixed dilation step. Thetranslationfactor r0 is dependentuponsq.
1 (1-J-c.n
vJAt)=-f=v/
A0 J
(2.4)
The effect of
discretizing
the wavelet is that the time-scale space is now sampled at discreteintervals. A value ofs0=2and r0 = 1 areusuallychosen sothat the samplingofthe
frequency
andtime axes correspond to dyadic sampling which is illustrated in Figure 2.4. One reason for
Figure 2.4: Dyadic
Sampling
Even witha discrete wavelet the wavelet transformrequires an infinite number ofsearings and
translationsofthemotherwavelet,
however,
thisis not possiblewith adiscretealgorithmsuch as the DWT. In order to provide good coverage of the signal spectrum using a finite number of wavelets the scaling factor of 2 is used andby
doing
so each wavelet will touch each otheras shownin Figure 2.5.[3]
Figure2.5: Subband Decompositionwithout
Scaling
FunctionItis impossible to cover the spectrum all the way down to zero as the spectrum is continually halved and never reaches zero. As a result, Mallat introduced a scaling function which
effectively
"corks"
theremaining spectrumthusrequiring only afinite number ofwavelets. As
shownin Figure
2.6,
this"cork" fillsthevoidwithalow-passspectrumcommonlyreferredtoasFigure2.6: Subband Decompositionwith
Scaling
FunctionScaling
Function.--\ . A
it
'
. I \
w. w.
-?
f
Anexample of aHaar
family
waveletandscaling functionsareshownin Figure 2.7aandbrespectively.
Figure 2.7: Haar
Family
Wavelet(a)
andScaling
Function(b)
dk.
a
Now that the continuous issues of the CWT have been addressed, a method is required to
perform the DWT on a signal. In 1976
Croisier,
Esteban and Galand used a special type ofanalysis-synthesis systemknown as aQuadrature Mirror Filter
(QMF)
filter bankto perform ananalysis of speechsignals andnamedtheiranalysis scheme"subbandcoding". Atechniquevery
similar to subband coding, called pyramidal coding, was defined
by
Burt in 1983. Thistechnique is alsoknown as MRAmentioned earlier. In 1989 Vetterli andLe Gall modifiedthe
subbandcodingschemeandthusremovedtheexistingredundancyintheinthepyramidalcoding
representation ofthe signal.
Similarly
in subbandcodingatime-scalerepresentation of adigitalsignal is obtained using digital
filtering
techniques. The signal is passed through a series ofhigh-pass filters and low-pass filters with different cut-off frequencies to analyze the
high-frequency
andlow-frequency
components of a signal respectively at different scales. Theresolution of the signal is changed
by
thefiltering
operations and the scale is changedby
upsampling and
downsampling
operations. The techniques used in subband coding can beapplied to the DWT. Two digital filter banks are used to perform low-pass and high-pass
filtering
ontheoriginal signal, effectively splitting it intotwofrequency
spectrums,orsubbands.Eachsubbandis down-sampled
by
afactoroftwo tokeep
the totalnumber of samples thesame as the original signal. The samples in the low-pass subband are referred to as the "scale"(scaling)
coefficients with thelow-pass filterbeing
the scaling filter. The scale coefficients are also commonlyreferred to as"average", "approximation",
or"smooth"
coefficients as the low-pass
filtering
serves to smooth the original signal. The samples in the high-pass subband are referredto as the "wavelet" coefficients withthe high-pass filterbeing
the wavelet filter. The wavelet coefficients are also referredto as"detail"
or
"difference"
coefficients asthe high-pass
filtering
serves to highlight regions of larger variance. These wavelet coefficients contain the smallest details ofinterest, however,
more detail information is present in the new low-passsubband ofthe signal. TheDWT analysis of asignal usingthe described two-channel subband techniqueisshown in Figure 2.8.
Figure 2.8: DWT AnalysisofSignal using Two-Channel Subband
Coding
i ?
L
?12
scaling
coef
input
?
H
?12
wavelet
coef
Theproceduredescribedabove canbeappliedrecursivelytoeachresulting low-pass subbandfor
multiplelevels of
decomposition,
or analysis, ofthe signal as shownin Figure 2.9. Indoing
so, an iterated filter bank has been developed requiring only twofilters, however,
only providingFigure 2.9: Multiple LevelDWTAnalysisofSignalusing Two-ChannelSubband
Coding
i ?
L
>12
scaling
coef
i ?
L
?12
wavelet
input
?H
?12
? coef?
H
?12
'wavelet
(level
2)
coef
(level
1)
Reconstruction of the signal, or synthesis, is performed in the opposite manner
by
usingsynthesisfiltersandupsamplingasdemonstrated in Figure 2.10.
Figure 2.10: DWT SynthesisofSignal using Two-Channel Subband
Coding
scaling
coef
T2
?L
-Join
?outputwavelet
coef
T2
>H
-2.3. Biorthogonal Wavelets
A transform is described as
being
orthonormal if both its forward and inverse transforms areidentical,
thereforeanorthonormal waveletis one thatis usedin bothanalysis and synthesis ofasignal. A filter
having
linearphase is one whose impulse responseis either symmetric or antisymmetric. Linearphaseis important foravarietyofreasonsin applications wherethe signal is
of finite
duration,
such as image compression. As mentioned earlier, two-channel subbandtransforms are usedto performthe DWTon a signal.
Unfortunately,
there are no two-channellinear-phase subbandfilters with finitesupportthat are alsoorthonormal. The solution is touse
two symmetric wavelets for analysis and synthesis that are orthogonal to each other, or
biorthogonal. These biorthogonal wavelets exhibitlinearphase andthereforeare now useful. [7
(chapter
4,6)]
Afamily
ofbiorthogonal waveletsthat has proved usefulin applications such asCDF 9/7 are two specific wavelets that will be used as continuing examples throughout this
thesisas
they
provide aninteresting
comparison.2.3.1. CDF 5/3
The Cohen-Daubechies-Feauveau
(CDF)
5/3 biorthogonal wavelet is a simple wavelet that hastwosets ofscaling and waveletfunctionsfor analysis andsynthesis, hence biorthogonality. The CDF 5/3 wavelet has a
5-tap
low-pass analysis filterh(z)
and3-tap
high-pass analysis filterg(z), hence5/3. The CDF 5/3also hasa
3-tap
low-pass synthesisfilterh(z)
and5-tap
high-passsynthesis filter g(z). The CDF 5/3 analysis and synthesis wavelets are shown in Figures 2.11
and2.12respectively.
Figure 2.11: CDF 5/3 Analysis Wavelet
A
|
2
j
I
a-a
.1
i.J
HljJ
-T
V
-A
(
i
I
] 1 2 3 A
Figure 2.12: CDF 5/3 Synthesis Wavelet
AnalysisFilters:
i_/\
1-2
l-i
3 li12
h(z)
= zl+z
H 1 zz2 w
8 4 4 4 8
1 -i , 1 i
-z +1 r
2 2
g(z)= --z ^l-z
Synthesis Filters:
h(z)
=iz-1+l
+ W2 2
/ \
1-2
1-1
3 It Itg(z)= z z + z z
w
8 4 4 4 8
2.3.2. CDF 9/7
The Cohen-Daubechies-Feauveau
(CDF)
9/7 biorthogonal wavelet is a more complex waveletthan theCDF 5/3 wavelet. Italso hastwo sets ofscalingandwaveletfunctions foranalysis and
synthesis,
however, they
are nearly identical and therefore more orthonormalthan the CDF5/3. The CDF 9/7wavelethas a9-tap
low-pass analysis filterh(z)
and7-tap
high-passanalysis filterg(z). The CDF 9/7 alsohas a
7-tap
low-pass synthesisfilterh(z)
and9-tap
high-pass synthesisfilter g(z). The CDF 9/7 analysis and synthesis wavelets are shown in Figures 2.13 and 2.14
respectively.
Figure 2.14: CDF9/7Synthesis Wavelet
The CDF 9/7analysis and synthesis sequences arelisted below.
Analysis Filters:
f 0.6029490182363579
+0.2668641
184428723^
+Z1)
h(z)
=2 +
z2
+
0.07822326652898785(z
0.0168641 1844287495(:
0.02674875741080976(z-4 +
z4)
z3+z3g(z)=
1.115087052456994
+Z1)
+ z2
0.09127176311424948(z"3 +z:
SynthesisFilters:
f 1.115087052456994
+
0.5912717631142470^
+Z1)
+z2
j(z)
=f 0.6029490182363579
-0.2668641184428723(z_1+
z1
)
-0.07822326652898785(:z"2
+
z2,
+0.01686411844287495(z"3
+
z3
)
+0.02674875741080976(z"4+z4)
2.4. DWT usingConvolution
The traditional method for performing the DWT on a discrete signal is
by
convolution using digital filter banks. Convolutionconsistsofperforming a series ofdotproductsbetweenaset of filter coefficients and the signal. Convolution using digital filters is performedby inputting
asamplealongwith afixed number ofits neighboring samples to thedigital filter. Aset offilter coefficientsisusedtoevaluatethesample anditsneighborstoget a new weighted,orconvolved,
value. The weighting operation is performed
by
multiplying all the samplesby
each oftheirrespectivefiltercoefficientvalues. The resultingproducts arethenaddedtogethertogetthefinal convolved value. The digital filter is shifted along the signal to repeat the above operation for everysampleintheoriginal signal andthefinalresultisthenewconvolvedsignal.
One issue encountered
during
convolution arises when sufficient neighboring samples do notexistforasample, asis thecasefor samplesneartheboundaries of afinitesignal. Anextension method needstobe implementedtoprovidethemissingsamplesto thedigitalfilter. A
boundary
extensionmethodisthenrequiredtodetermine howtoextendthesignalbeyondits boundariestoprovide the extra samples needed
by
the filter. One method is to simply make all the extra values outsidetheboundary
ofthe signal oneconstant value. Anexample ofthis methodis to simply extend the sample at the edge of the signal beyondtheboundary
so that any neighborsample outside the
boundary
is considered to be theboundary
sample. Anotherboundary
extension methodis called symmetric extension, hisymmetric extensionthe signal is reflectedacross the
boundary
providing a rnirror image of the original signal as the extra samples. Whethertheboundary
sampleisrepeatedor notbeyondtheboundary
isanotherconsideration.filters are constructed
directly,
one for the low-pass scaling filter and one for the high-passwaveletfilter. Oncethese twodigital filters areobtained, theforwardDWT isperformedexactly
as mentioned earlierusingthe two-channelsubbandcodingtechnique. Convolution is performed
onthesignalusing boththescalingand waveletdigital filters. Theappropriate extension method
is used to provide the missing samples. The resulting signals are downsampled
by
a factor oftwo to
keep
the same number of samples as the original signal. In this mannerthe scaling andwavelet coefficients are obtained as shown in Figure 2.15. Reconstruction of the signal is
performedintheoppositemannerusingsynthesisfilters.
Figure 2.15: Forward DWT using Convolution
i ?
L
?12
scaling
coef
input
>
H
?12
wavelet
coef
The examplebelow demonstrates the steps requiredtoperform the forward DWT foronelevel
of decomposition on a 1-D discrete signal using convolution. The CDF 5/3 DWT is used.
Symmetric extension ofthe signal is used to provide samples to the convolution filters beyond
theboundaries ofthesignal.
Rowofsamples: 4 7 3 5 9 6
Convolution is performedon the original row of samples using the CDF 5/3 high-pass wavelet
analysis filter. The results fromthe convolution are rounded using the floor function and then
downsampled
by
afactor2 startingwith thesecond sampleto obtainthewavelet coefficients ofthesignal.
g(z)
=SW
2 2
Rowofsamples: 4 7 3
Convolution 3
9
3
Waveletcoefficients:3 -1 -3
Convolution is also performed on the original row of samples using the CDF 5/3 low-pass
scalinganalysisfilter. Theresults fromtheconvolution are roundedusingthefloor functionand
then downsampled
by
a factor 2 starting with the first sample to get the scaling coefficients ofthesignal.
h(z)=_Iz-2+Iz-l+2 +
Izl_Iz2
8 4 4 4 8
Rowof samples: 4 7 3 5 9 6
Convolutionoutput: 5 5 3 5 8 7
Scaling
coefficients: 5 3 8Itis importanttonotethat
temporary
storageis requiredtoholdtheresults oftheconvolution asthe original samples cannot be overwritten until both the wavelet and scaling coefficients are
obtained.
Performing
the DWT via convolution is a relatively expensive operation requiringlarge amounts of intermediate storage and unnecessary computations. In addition a DWT
performed via convolution is limitedjust as the Fourier Transform is near the boundaries of a
finitesignal. Aproposedalternativeis the
Lifting
Scheme.2.5. DWT using
Lifting
SchemeIn 1994 Wim Sweldens proposed an alternative approach to computing the DWT using
biorthogonal wavelets calledthe
Lifting
Scheme. Thelifting
scheme calculatestheDWT usingspatial domain analysis rather than
frequency
domain analysis. This provides a more practicalapproach to computing the DWTthat is better suitedfor many applications not requiring more
complex frequency-based Fourier analysis techniques, hi addition, certain information within
the signal that cannotbeobtained using traditionalfrequency-based techniques canbe obtained
using the
lifting
scheme and are referred to as second-generation wavelets. Thelifting
schemecan be traced back to the Euclidean algorithm and was inspired
by
M. Lounsbery's workmore compact representation of a signal
by
finding
andexploiting spatial correlation within. Amajor assumption that the
lifting
scheme takes advantage of is that samples that are spatially close toone another are more similar to each otherthan samplesthat are spatially fartheraway.Therefore neighboring samples are maximallycorrelated.
Using
this assumption a sample couldbe interpolated
fairly
accuratelyby having
only knowledge of its close neighbors. A samplecouldbeinterpolatedeven moreaccuratelythemore neighborsthereareto interpolate from.
[8]
The
lifting
scheme consists of a series ofstepsthatmodify, orlift,
one set of samplestobeusedin the next step. This
"lifting"
of samples gives the
lifting
scheme its name. The first step toperforming theforward DWT usingthe
lifting
schemeis called the"Split" stepshown in Figure2.16. Thepurposeofthesplit step isto splittheoriginal signal intotwo setsthat aremaximally correlated. Given the assumption above neighboring samples are the most correlated so therefore
during
thesplitstepthesignalis splitintoone setcontaining onlytheeven samples and a second set containing onlythe odd samples. This is commonly referred toas aLazy
wavelet transform.Figure 2.16: Split
Step
ofForward DWTusingLifting
Scheme12
? even inz
-112
? oddo o o o
The second step ofthe
lifting
scheme is called the "Predict" step shown in Figure 2.17. Thepredict step first uses samples from the even set to predict the values in the odd set. More
specifically theright andleft even neighbors ofan odd sample are used intheprediction. Once theprediction is donethe predicted valuederived from theeven set is compared toactual value
from the odd set and the difference between the two is calculated. This difference should be
relatively smallcompared to theoriginal valuefromtheoddsetassumingthepredictionmethod
is This difference is referredto as the
"difference" or
"wavelet"
wavelet coefficient indicatestheextenttowhichtheprediction oftheoddset of samplesfromthe
evenset of samplesfail. Ifthewaveletcoefficientis zerothismeansthesample fromtheodd set
canbe exactlypredicted fromthesamples in theeven set.
Finally
each samplein theodd set isoverwritten with their respective wavelet coefficients, again which should be relatively small.
The odd set now contains the wavelet coefficients and the even set still contains the even
samples fromtheoriginal signal. Theodd set capturesthe
high-frequency
content oftheoriginalsignal now, but the even set still contains both high and
low-frequency
data from the originalsignal since it is merely a downsampled version and thus contains aliasing. A third step is
neededtoremovethealiasing.
Figure 2.17: SplitandPredictStepsofForward DWT using
Lifting
Scheme12
III ' ^/V^l 1
z
-1/
12
/
+j
? oddc\
a
*
A
t
A
t
\ 1 / s 1 / \ 1 / ^ ' ^^v '^^ '3^U
'tfh
The
following
is thepredictstepequation with a asthepredictstepcoefficient.Predict: odd^ =
oddold+a(evenleft+evenright
)
The third step of the
lifting
scheme is called the "Update" step shown in Figure 2.18. TheUpdate step uses the new wavelet coefficients in the odd set to update the even set producing
"smooth"
or
"scaling"
coefficients. Morespecificallytherightandleftodd neighborsof an even
sample areusedintheupdate. These scalingcoefficients nowhavesame average
intensity
oftheoriginal signal inthe form of
low-frequency
content and thus remove the aliasing. The scalingcoefficients nowoverwritetheirrespective samplesintheeven set. The signal now containsthe
Figure 2.18:
Split, Predict,
and UpdateStepsofForward DWT usingLifting
Scheme12
^V
scaling
111
Sf/ coef
z
-1A
1
B
A1.
12
^
waveletcoef
fWWl
The
following
istheupdatestepequationwith |3 astheupdate stepcoefficient.Update: evennew =
evenold+
p(oddleft
+oddright)
A more complex DWT
involving
more neighbors can be performedby
merely adding morepredict and update steps to themethoddescribed above, with thefinal predict and update steps
producingthewavelet andscalingcoefficientsrespectivelyas shownin Figure 2.19.
In addition, scaling steps can be added to adjust the DC gain of the wavelet and scaling
coefficients ifneeded asshownin Figure 2.20.
The inverse DWT usingthe
lifting
scheme is intuitive. Toperform theinverse DWT thelifting
steps are simplyperformed inthereverse orderusingtheinverseoperations. If any scaling was
performed on the wavelet and scaling coefficients at the end ofthe forward DWT then it first must be undone
by
scaling the coefficientsby
inverse scale factors. Next the last update stepmustbe undone followed
by
the last predict step. This continues backwards until all the steps havebeenundone andthe original signalhas beenobtained asdemonstrated in Figures 2.21 andFigure 2.19: ForwardDWT using
Lifting
SchemewithMultipleLifting
Steps12
^\
-4 + v.\ /
scaling
coef II 1Y
z
-1A
T
B
ic
!
l
i
:
D
12
-<?)
... J j- v i
wavelet
coef \ /
S^iv/ S'*i^/ S^f'
Figure 2.20:
Forward
DWTusingLifting
SchemewithMultipleLifting
andScaling
Stepsin
12
12
^)
\ 0 :scaling
v L.J.j coef
t i
!
D
L.^..J: ; 0 : wavelet
... ^
s
j+L 1 coef
li I
z
-1A
z
B
:c
1
>,
i i >, J + V.
V>
1 T 1*
*
*
*
Figure 2.22: InverseDWT using
Lifting
SchemewithMultipleLifting
andScaling
Stepsscaling
coef -iVS2r-4
D
wavelet !, : :
coef 11
..*.
,+,
Y
'' * rB
A
Join
k
z
JL
out
2.5.1. Featuresof
Lifting
SchemeThe main advantages ofcomputing the DWT viathe
lifting
scheme rather than convolution arethat it is much
faster,
is calculatedfully
in-place requiring no intermediate storage, hassymmetric forward and inverse transforms, potential for integer wavelet transform, and can be
usedinsituations wherefrequency-basedtechniquescannot.
[8]
2.5.1.1. Faster Implementation
Thetraditional DWTis performedusing atwo-bandsubbandanalysis whereby both ahigh-pass
and alow-passanalysis filterare appliedto theentire signal andtheresulting high-pass and
low-pass subbands are downsampled
by
afactoroftwo to gettheresult. Thelifting
schemeexploitsthe similarities between the two analysis filters to reduce the number of calculations.
Unnecessary
calculationsresulting in samplesthatwouldbe lost inthedownsampling
andrepeatcalculations between the two analysis filters are avoided thus providing an overall speedup. In
some casesthenumber of operations canbereduced
by
uptoafactoroftwo.[9]
2.5.1.2. In-Place Calculation
The
lifting
scheme computes the DWT in an iterative manner. After each iteration theintermediate results/samples can overwrite the previous results/samples without data loss and
thereforeno auxiliary memory is requiredin thecalculation oftheDWT. The
lifting
schemeis2.5.1.3.
Symmetric ForwardandInverse TransformTraditionally
theinverse DWTis performedby
using a set of synthesis filters separate fromtheanalysis filters and as a result the inverse transform may not be intuitive. The
lifting
schemeperforms the inverse DWT
by
simply undoing the operations ofthe forward DWT. The samemachinery usedfortheforward DWTcanbeusedfortheinverseDWT
by
reversingtheorder ofoperations.
2.5.1.4. Integer-to-integer Transform
Dueto the
linearity
ofthelifting
scheme, ifthe input data is in integerformat,
it is possibletomaintain data to be in integer format throughout the transform
by
introduction a roundingfunction inthe
filtering
operation. Dueto this property,the transformisreversible andis calledthe
integer-to-integer,
orInteger Wavelet Transform (IWT).2.5.1.5. Second Generation Wavelets
Since the
lifting
scheme does not use Fourier analysis to compute theDWT,
it can be used insituations wheretranslation anddilation is impossible. One example wouldbenearboundaries
of afinitesignal where normalFouriertechniqueswould provideborder distortionor artifacts.
2.5.2.
Lifting Step
ExtractionAsmentioned abovethe
lifting
schemeisanalternativetechniquefor performingtheDWT usingbiorthogonalwavelets. In ordertoperformtheDWT usingthe
lifting
schemethecorrespondinglifting
andscaling steps mustbe derived fromthebiorthogonalwavelets. Theanalysis filters oftheparticularwaveletare firstwritteninpolyphase matrixformshownbelow.
heven(Z)
geven(Z).hoddfc)
godd(Z).
The polyphase matrix is a 2 x 2 matrix containing the analysis low-pass and high-pass filters
each split up into their even and odd polynomial coefficients and normalized. From here the
matrix is factored into a series of2 x2 upper andlower triangularmatrices each withdiagonal
entries equalto 1. Theuppertriangularmatrices containthecoefficientsforthepredictsteps and
thelowertriangularmatrices containthecoefficients fortheupdate steps. Amatrixconsistingof
all O's with the exception of the diagonal values may be extracted to derive the scaling step
P(z)
=coefficients. Thepolyphasematrix is factored intotheform shown in theequation
below,
a isthecoefficientforthepredictstepand
p
is thecoefficientfortheupdate step.1 a(l+ z_I)T 1
0 1
JLp(i
+z)
1_
Anexample of a more complicated extraction
having
multiple predict and update steps as wellasscaling steps is shown
below;
a is the coefficient for thefirst predict step,p
is the coefficientforthefirstupdate step, A, isthecoefficient forthe second predictstep, 5 isthecoefficientfor
the second update step,
^
is the odd sample scaling coefficient, and,2
is the even samplescalingcoefficient.
P(Z): 1 a(l+ 1 1 y(i + 1 0
0 1 P(l+z) 1 0 1 5(1+z) 1 o
c2
According
tomatrixtheory, anymatrixhaving
polynomial entries and adeterminantof1 canbefactoredas describedabove. Therefore every FTRwavelet orfilter bankcanbe decomposed into
a series of
lifting
and scaling steps. Daubechies andSweldens discusslifting
step extraction infurther detail.
[10]
Thelifting
step extraction for the CDF 5/3 and CDF 9/7 biorthogonalwaveletsis shownbelow.
2.5.3. CDF 5/3 DWT using
Lifting
SchemeThelow-pass andhigh-passanalysisfilters fortheCDF 5/3 are restatedbelowwiththehigh-pass
filtertranslated
by
z"1.h(z)
=_Iz-2+Iz-l+2+Izl_Iz2
w8 4 4 4 8
i ( \ -if 1 -i , 1 i^
1-2
-i 1 z1g(z)=z 1 z!+l
z\
= zl+zl
SW
i
2 2J
2 2Thepolyphase matrix
P(z)
fortheCDF5/3 waveletisshownbelow.P(z)
=1 _! 3 1 1 -1 1
z + z z
8 4 8 2 2
1 1 1
- +
-z 1
P(z)
=l-^z
+z"1)
-i-fl+z"1)
4 8V / 2V /
Thepolyphase matrix canthenbefactored intotwo triangularmatrices.
1
P(z)
=1 -i-ll+
z"1)
2V ;
0 1
1
(1
+z) 1It isapparentthat twoliftsteps arerequired,one predict and one updatestep,toperformtheCDF 5/3 DWT. Thecoefficientforthepredictstep is:
1
a=
andthecoefficientfortheupdate step is:
Thepredict and update equationsfortheCDF 5/3 filterare shownbelow. Predict:
Update:
odd =odd ,j+ new """old
4(
evennew =
evenold+
2,evenieft+evenright
-(oddleft+oddright)
The floor function is used for both the predict and update equations to provide an
integer-to-integertransform. Theforward CDF 5/3 DWT usingthe
lifting
schemeis shownin Figure 2.23.Figure2.23: Forward CDF 5/3 DWT using
Lifting
Schemein
12
7-1
scaling
coefwavelet
coef
A
=The examplebelow demonstrates the steps required to perform the forward DWTforone level
of
decomposition
on a 1-D signal using thelifting
scheme. The CDF 5/3 DWT is used.Symmetric extension of only one sample beyond the
boundary
is necessary for thelifting
scheme.
Rowof samples: 4 7 3 5 9 6
The CDF 5/3 DWTconsists oftwo
lifting
steps. The firstlifting
step (predict step)is appliedtotheoriginalrow of samples andtheresults then safely overwritetheodd samples intheoriginal
signalforuseinthenext
lifting
step. Theresultsfromthissteparethewavelet coefficients.oddnew =
oddold+
l(
(evenleft+evenrigh)
Rowof samples: 4 7 3 5 9 6
Lifting
step 1 results: 3 -1 -3Newrowofsamp les: 4 3 3 -1 9 -3
Waveletcoefficients:3 -3
Thesecond
lifting
step (updatestep)is appliedto thenew waveletcoefficients andtheremainingeven samples ofthe original signal. The results then safely overwrite the even samples in the
signal. Theresultsfromthissteparethescalingcoefficients.
even^ =
even0ld+
-(oddleft+oddright)
4
Rowof samples: 4 3 3 -1 9
Lifting
step 2results: 5 3 8Newrowof samples: 5 3 3 -1 8
-3
-3
Theresulting wavelet and scalingcoefficients obtained fromthis example are identical to those
fromtheforward DWTexampleusingconvolution earlier.
The inverse DWTtransformisperformed
by
performingtheinvertedversions ofthelifting
stepson the wavelet and scaling coefficients in the reverse order as
they
were performed for theforward DWT. Thewavelet coefficients arelocated in the odd samplepositions andthescaling
coefficients arelocated intheeven sample positions.
Wavelet/Scaling
Coefficients: 5 3 3 -18 -3
The inverseversion ofthe second
lifting
step (update step) is appliedto the waveletandscalingcoefficients and the results then safely overwrite the scaling coefficients. The results from this
steparetheeven samples oftheoriginal signal.
evennew =
evenold
--(oddleft+oddright)
Wavelet/Scaling
Coefficients: 5 3 3 -1 8 -3
Inverse
lifting
step 2Results: 4 3 9
Newrow ofsamples: 4 3 3 -1 9 -3
The inverse version ofthe first
lifting
step (predict step) is appliedto newly determined evensamples and remaining wavelet coefficients. The results then safely overwrite the wavelet
coefficients. Theresultsfromthissteparetheodd samples oftheoriginalsignal.
ddnew =
ddold --(evenleft+evenrigJ
Newrowofsamples: 4
Inverse
lifting
step 1Newrow of samples: 4 7 3 5 9 6
Thecomplete signalhas been perfectlyreconstructed.
Reconstructed
signal: 4 7 3 5 9 6
2.5.4. CDF 9/7 DWTusing
Lifting
SchemeThe low-passandhigh-passanalysisfilters fortheCDF 9/7arerestatedbelowwiththehigh-pass filtertranslated
by
z"1.( 0.6029490182363579 ^
+0.2668641 184428723(z_1+
z1
)
h(Z): +
z2)
- 0.0168641 1
844287495(z~3 + z3
)
+0.02674875741080976(z"4+z4)
z1g(z)=z-1 1.115087052456994z-1+11)
+z1)
+0.09127176311424948(z-4+
z2}
' 1.115087052456994 -0.5912717631 142470(z_1+Z1)
+z2)
+z3)y
Thepolyphase matrix
P(z)
is trivial yetveryungainly andtherefore not shown. Thepolyphasematrix forthe CDF 9/7 wavelet canbe factored into the
following
fourtriangular matrices andone scale matrix.
i cdW1)! i oTi yfi+z"1)! i
oK
oo l
[p(i+z)
i]o ii(i+z)
lJLoc2.
P(z)
=where:
a=-1.586134342
P
= -0.05298011854y=0.8829110762
5=0.4435068522
A total offour liftsteps are required, twopredict andtwoupdate steps, toperformthe CDF9/7
DWT. Thecoefficientforthefirstpredictstep is:
a=
-1.586134342
Thecoefficientforthefirstupdatestep is:
P
=-0.05298011854Thecoefficientforthesecond predictstep is:
7=0.8829110762
Thecoefficientforthesecond updatestep is:
5=0.4435068522
Thescale coefficientfortheodd samplesis:
d
=1.149604398Thescale coefficientfortheeven samplesis:
2
=0.8698644523Thepredict and update equationsfortheCDF 9/7 filterare shownbelow.
Predictl: oddnew =
oddold+
[a(evenleft
+evenright)J
Updatel: evennew =
evenold+
[p(oddleft
+oddright)J
Predict2: oddnew =
oddold +
[j(evenleft
+evenright)J
Update2: evennew =
evenold+
[o(oddleft
+oddright)J
Scaleodd: oddnew =
|_d
*oddold
J
Scaleeven: evennew =
|_C2
xevenold
J
The floor function isusedforallthepredict, updateand scale equationstoprovide an
Figure2.24: Forward CDF 9/7 DWTusing
Lifting
Schemein
12
scaling
coef
wavelet coef
A
=B
=1.5861
34342
C
=
0.88291
1 0762
0.0529801
1
854
D
=0.4435068522
S
=1.149604398
S2
=0.8698644523
The CDF 9/7 DWT consists of four
lifting
steps and two scaling steps. The firstlifting
step(predict step
1)
is appliedtotheoriginalrowof samples andtheresults thensafelyoverwritetheodd samplesintheoriginal signalforuseinthenext
lifting
step.oddnew =
oddold+
[a(evenleft
+evenright)J
a= -1.586134342
Rowof samples: 4 7 3 5 9 6
Lifting
step 1 results: -5 -15 -23Newrowof samples: 4 5 3 -15 9 -23
Thesecond
lifting
step (update step1)
is appliedto theresults from thefirstlifting
step andtheremaining even samples of the original signal. The results then safely overwrite the even
samplesinthesignal.
eVennew =
eVenold+
Lp(0ddleft
+ddright)J
p
= -0.05298011854Rowofsamples: 4 5 3 -15 9 -23
The third
lifting
step (predict step2)
is applied to the results from the first and secondlifting
steps. Theresultsthensafelyoverwritetheresultsfromthefirst
lifting
step.oddnew
=oddold
+L.Y(evenleft
+evenright)J
7=0.8829110762
Rowof samples: 4 5 4 -15 11 -23
Lifting
step3results: 2 -2 -4Newrow of samples: 4 2 4 -2 11 -4
The fourth
lifting
step (update step2)
is appliedto the results from the second and thirdlifting
steps. Theresultsthensafelyoverwritetheresults fromthesecond
lifting
step.evennew =
evenold+
[.o(oddleft
+oddright)J
5=0.4435068522Rowof samples: 4 2 4 -2 11
Lifting
step 4results: 5 4 8Newrow of samples: 5 2 4 -2 8
The first scaling step is appliedto theresults fromthe third
lifting
step. The resultsthen safelyoverwrite the results from the third
lifting
step. The results from this step are the waveletcoefficients.
oddnew=LC.xoddoldJ
d
=1.149604398Rowof samples: 5 2 4 -2 8 -4
Lifting
step 4results: 2 -3 -5Newrow of samples: 5 2 4 -3 8 -5
The second scaling step is applied to the results from the fourth
lifting
step. The results thensafelyoverwritetheresultsfrom thefourth
lifting
step. Theresults fromthis step arethescalingcoefficients.
evennew=LC2xevenoldJ
2
=0.8698644523Rowof samples: 5 2 4 -3 8
Lifting
step 4results: 4 3 6Newrow of samples: 4 2 3 -3 6
Scaling
coefficients: 4 3 62.6. 2-D DWT andDigitalImages
As still and motion pictures are steadily moving from the traditional film media into digital
mediaformthedemandfor digital image processingtechniques is growing. Since digital images
aremerely 2-dimensionalspatial-domainsignals,thefieldofdigital image processing is simplya
classification of signal processing pertaining specifically to digital images and thus many
techniques that are used in signal processing are also applicable to digital images.
Hence,
theapplication oftheDWTtodigital images isofgrowing interest.
2.6.1. 2-D DWT
A digital image is an example of aspatial-domain signal
having
an amplitude, orintensity
thatvaries
depending
on the location within the image. An image consists of picture elements, or"pixels",
that representintensity
values at a specific location withthe image. Thesepixels arelocated within a discrete 2-D grid of rows and columns that represent the spatial-domain. A
grayscale image contains pixels
having
only oneintensity
value ranging from black to whitecreating a monochrome "black & white"
image,
also called anintensity
image. A color imageusually hasthree
intensity
values perpixelrepresentingred,blue and greento create afull-colorimage. Forthe most part, image processingtechniques that are unrelated tocolor are the same
TheDWTdescribedearlier appliesto 1-Dsignals, but canbe easilymodifiedtoaccompany 2-D
signals such asdigital images
by
treating
themas groups of1-D signals as shownin Figure 2.25.Figure2.25: Forward 2-DDWT
originalimage
?
L
12
rows
12
columns
H
12
columns
>
H
12
rows
12
columnsH
12
smooth + coefficients (LL) verticaldetail -? coefficients (LH) horizontal detail + coefficients (HL) diagonal detail -+ coefficients (HH) columnsIn ordertoperformthe 2-D DWT on imagethe 1-DDWT is performed
horizontally
along eachrow (or vertically alongthe columns if
desired)
ofthe imagetreating
each row as ifthey
weresingle 1-D signals as shownin Figure 2.26. The results are two subbands, one containing the low-pass scalingcoefficients andtheothercontainingthehigh-passwavelet coefficients.
Figure 2.26: Forward 2-D DWT Row
Processing
ofImageoooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo 09090909 oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo ooooiiii oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo
O 0 O 0 # 6 e
o o o o 9 9 9 9
0 o o o 9
o o o o
O 0 o o
0 O O 0
0 0 o o 99
O 0 o o 9 9 9 9
Afterthe 1-D DWT isperformedonall therows ofthe
image,
theprocess is repeatedverticallyonevery column ofthetwo subbandsfromtheprevious step as shown in Figure 2.27. Thetwo
original subbands are each splitinto twomoresubbands foratotal offoursubbands. Oncethis
Figure2.27: Forward 2-DDWT Column
Processing
ofImage0 0 0 0 9 9 9 9
9 O 0 O 9 9 9 9
0 O 0 0 9 9 9 9
9 0 0 0 9 9 9 9
0 0 0 O 9 9 9 9
9 O 0 0 9 9 9 9
0 0 0 0 9 9 9 9
9 0 0 0 9 9 9 9
0 O 0 0 9 9 9 9
o o o o 9 9 9 9
O 0 o o 9 9 9 9
0 o o 0 9 9 9 9
9 O O 0 9 9 9 9
9 0 O 0 9 9 9 9
9 O O 0 9 9 9 9
9 O O 0 9 9 9 9
0 0 0 0
0 0 O 0
o o o o
0 0 0 0
9 9 9 9
9 9 9 9
9 9 9 9
9 9 9 9
9 9 9 9
9 9 9 9
9 9