Comparison between Haar and Daubechies Wavelet Transformions on FPGA Technology

— Recently, the Field Programmable Gate Array (FPGA) technology offers the potential of designing high performance systems at low cost. The discrete wavelet transform has gained the reputation of being a very effective signal analysis tool for many practical applications. However, due to its computation-intensive nature, current implementation of the transform falls short of meeting real-time processing requirements of most application. The objectives of this paper are implement the Haar and Daubechies wavelets using FPGA technology. In addition, the comparison between the Haar and Daubechies wavelets is investigated. The Bit Error Rat (BER) between the input audio signal and the reconstructed output signal for each wavelet is calculated. It is seen that the BER using Daubechies wavelet techniques is less than Haar wavelet. The design procedure has been explained and designed using the stat-of-art Electronic Design Automation (EDA) tools for system design on FPGA. Simulation, synthesis and implementation on the FPGA target technology has been carried out.


INTRODUCTION
The wavelet transform is an emerging signal processing technique that can be used to represent real-life non-stationary signals with high efficiency [1]. Indeed, the wavelet transform is gaining momentum to become an alternative tool to traditional time-frequency representation techniques such as the discrete Fourier transform and the discrete cosine transform. By virtue of its multiresolution representation capability, the wavelet transform has been used effectively in vital applications such as transient signal analysis [2], numerical analysis [3], computer vision [4], and image compression [5], among many other audiovisual applications. Wavelet transform is mostly needed to be embedded in consumer electronics, and thus a single chip hardware implementation is more desirable than a multi-chip parallel system implementation.
Several VLSI architectures have been proposed for the implementation of the discrete wavelet transform. The first architecture, presented by Knowles [6], uses many large multiplexes for storing intermediate results. Parhi and Nishitani proposed a folded architecture that has shorter latency [7], however, it requires complex routing and control network. Chakabarti [8] proposed a systolic architecture, but also it requires many parallel hardware and complex routing. In general, custom VLSI circuits are inherently inflexible and their development is costly and time consuming, and thus they are not an attractive option for implementing the wavelet transform. FPGA becomes the most applicable microelectronic technology in many recent applications such as communication, mobile telephone, etc. This is due to the relatively high capacity and low cost of the FPGA and also, short design cycle and short time to market when using EDA tools. Since the FPGAs provide a new implementation platform for the discrete wavelet transform. FPGAs maintain the advantages of the custom functionality of VLSI ASIC devices, while avoiding the high development costs and the inability to make design modifications after production [9]. Furthermore, FPGAs inherit design flexibility and adaptability of software implementations.
The appearances of the computer Aided Design (CAD) tools of electronic circuit design have been led to a reduction in the period of the design cycle. The CAD tools are developed to the Electronic Design Automation (EDA) tools that leading to a

Wavelet Processing Algorithm
The discrete wavelet transform (DWT) is simply implemented by a 2-band reconstruction block as shown in Fig. 1. [10]

Fig. 1 The 2-band reconstruction block
The input signal X(z) is split by two filters H 0 (z) and H 1 (z) into a low pass component X 0 and a high pass component X 1 , both of which are decimated (down-sampled) by 2:1. In order to reconstruct the signal, a pair of reconstruction filters G 0 (z) and G 1 (z) and usually the filters are designed such that output signal Y(z) is identical to the input X(z). This is known as the condition for perfect reconstruction (PR) [10].The art of finding good wavelet lies in the design of the set of filters, to achieve various trade offs between spatial and frequency domain characteristics while satisfying the perfect reconstruction condition. Now we are going to discuss the condition for perfect reconstruction. As shown in figure 1 the process of decimation and interpolation by 2:1 at the output of H 0 (z) and H 1 (z) effectively sets all odd samples of these signals to zero.

-Similarly for High pass branch (with HPF
The first PR condition: requires aliasing cancellation and forces the above term in X(-z) to be zero [10]. Hence Which can be achieved if: Where k must be odd (usually k = ±1). The second PR condition: is that the transfer Using equations (5),(6), equation (4) becomes: This needs to be true for all z and, since the odd powers of z in P(z) cancel with those in P(-z), it requires that P 0 = 1 and that P n =0 for all n even and non zero [10].P(z) is the transfer function of low pass branch in Fig. 2. and P(-z) is that of the high pass branch. For compression applications P(z) should be zero-phase to minimize distortions when the high pass branch is quantized to zero; so to obtain PR it must be of the form: We may now define a design method for the PR filters to be as follows: Choose P 1 ,P 3 ,P 5 ,… in (2.9) to give a zero-phase lowpass product filter P(z) with good characteristics.
Factorize P(z) into H 0 (z) and G 0 (z), preferably so that the two filters have similar lowpass frequency responses.
To simplify the tasks of choosing P(z) and factorizing it, based on the zero-phase symmetry we transform P(z) into P t (z) such that: [10] ( ) To obtain the frequency response, let Hence Z is purely real, varying from 1 at Substituting this into P t (Z) gives the frequency response of P.

Haar wavelet transform
A Haar wavelet is the simplest type of wavelet [11]. In discrete form, Haar wavelets are related to a mathematical operation called the Haar transform. The Haar transform serves as a prototype for all other wavelet transforms. Like all wavelet transforms, the Haar transform decomposes a discrete signal into two subsignals of half its length. One subsignal is a running average or trend; the other subsignal is a running difference or fluctuation.
The Haar wavelet transform has a number of advantages [12]: It is conceptually simple.
• It is fast.
• It is memory efficient, since it can be calculated in place without a temporary Array. • It is exactly reversible without the edge effects that are a problem with other Wavelet transforms. The Haar transform also has limitations [11], which can be a problem with for some applications. In generating each of averages for the next level and each set of coefficients, the Haar transform performs an average and difference on a pair of values. Then the algorithm shifts over by two values and calculates another average and difference on the next pair. The high frequency coefficient spectrum should reflect all high frequency changes. The Haar window is only two elements wide. If a big change takes place from an even value to an odd value, the change will not be reflected in the high frequency coefficients. So Haar wavelet transform is not useful in compression and noise removal of audio signal processing.
Haar 2-tap wavelet has been chosen for this implementation.
The filters coefficients corresponding to this wavelet type are shown in Table I [10]. H0 and H1 are the input decomposition filters and G0 and G1 are the output reconstruction filters.

Daubechies wavelet transform
The Daubechies wavelet transforms are defined in the same way as the Haar wavelet transform by computing the running averages and differences via scalar products with scaling signals and wavelets the only difference between them consists in how these scaling signals and wavelets are defined [11].
This wavelet type has balanced frequency responses but non-linear phase responses. Daubechies wavelets use overlapping windows, so the high frequency coefficient spectrum reflects all high frequency changes. Therefore Daubechies wavelets are useful in compression and noise removal of audio signal processing [12].
Daubechies 4-tap wavelet has been chosen for this implementation [11]. The filters coefficients corresponding to this wavelet type are shown in Table II.

Design of Haar and Daubechies Wavelet transform using FPGA
Due to the progress in the intensive integration of electronic devices and circuits, the components on the FPGA chip (gates, I/O, buffers, look up tables LUT, registers … etc.) becomes an ultra high number and then it is out of the human manipulation capabilities. Therefore the design on FPGA needs a powerful computer program (software). This program is constructed by a very specialized and expertise software developers that working in cooperation with the original FPGA manufacturer. Nowadays, the electronic design automation EDA tools are suitable for this task. A limited number of EDA factories have a full design flow for EDA of FPGA but Mentor Graphics tools: (FPGA Advantage R ) flow is available in our laboratory. This EDA tools has the following components: 1 -(HDL -designers R ) [13] for data entry that represent the project design.
2 -(Modelsim R ) [14] for simulation that generate the machine code directly from the complier, which provides faster compilation and some speed up in runtime .
3 -(Leonardo -spectrum R ) [15] that used for synthesis and implementation of the design on the target technology.
When the design cycle is completed -that is the project elements are processed through all the mentioned above tools -and the results have been accepted; then the implementation of the design is downloaded to the chosen FPGA device.
The architecture of FPGA can handle the implementation of any combinational or sequential logic functions. As well, it accepts the implementation of the basic mathematical operations (addition, subtraction, multiplication and division). Therefore, the FPGA is suitable for the implementation of the discrete wavelet transform.
The design is started with Forward Haar and Daubechies wavelet transforms implementation, The basic building block of the forward Haar or Daubechies discrete wavelet transform filter bank is the decimator which consists of an FIR filter followed by a down-sampling operator [16].Inverse DWT implementation for Haar and Daubechies wavelets, The basic building block of the inverse Haar or Daubechies discrete wavelet transform filter bank is the interpolator which consists of an FIR filter proceeded by an up-sampling operator [16]. The up-sampler inserts an equidistant zero-valued sample between every two consecutive samples

Data entry
By the EDA tools such as ( FPGA advantage R ) the designer can create the design description with one or more of the following methods; the block diagrams, state machine diagrams, flow charts, truth tables and/or VHDL code. The mentioned types of graphical descriptions are automatically convertedby the tool -to a fast and efficient HDL description.
The hierarchical design capability of the EDA tools simplifies the design task. At the top level, of the hierarchy, global design can be made in the form of system entity block. The second level represented the system components, in the form of a block diagram, as illustrated in Fig. 3 The details of each component can be entered to the EDA tool using the suitable method of those mentioned above. We present the components of our design using EDA built in modules called (module-ware). Fig. 4 and

Simulation of DWT for FPGA
The Data entry phase is terminated by a successful compilation of the complete hierarchical design. The next step is the simulation of the design to illustrate how it works. For this purpose a test bench facility is available in the EDA tool which is the most suitable method to run a complete simulation for the design. It describes with the VHDL code. The test bench provides access to text file which contains the data of the encoded audio signal of tada.wav file generated by matlab program. Fig. 2 illustrates the VHDL code of the test bench only.

Simulation Results:
To illustrate the functionality of the designed Haar and Daubechies wavelet transforms through the simulation, the designed test bench have been run and the encoded audio signal was applied as the input of the Haar and Daubechies wavelet transform with clock period equal to 400 ns . The test bench results of the Daubechies and Haar wavelets are presented in Fig. 6 and Fig. 7 respectively. The output curves in the two figures are presented from top to down as: the input audio signal and the reconstructed output. Thus from the simulation results using the Haar and Daubechies wavelet transforms, It is seen that the BER using Daubechies wavelet techniques is less than Haar wavelet as shown in TableIII.

Synthesis of DWT on FPGA
In the case of satisfied simulation results, it is not a guarantee that the real FPGA will also function, the synthesis phase will started. A synthesis tool is used to include the propagation delay of the real scheme using the delay of each element that used in the design including the internal wiring connections. This time of propagation is calculated from any input to any output to detect the path that has the long propagation time or it is normally called the (critical path). The designer must takes into consideration these critical paths, which in some cases block the action of a desired function. Normally the design is an iterative process to compromise among many parameters or criteria. This means that; we may go through the design steps as many as we can to improve and optimize the result of our design.

Synthesis results:
We have implemented the design using Xilinx FPGA device, XC4000XL. This device contains 4000k gates and can operate at a maximum clock speed of 1MHz. Fig. 8 and Fig. 9, illustrate the critical path of the designed Daubechies and Haar wavelet transforms respectively.

Conclusion
This paper proposed an efficient implementation of the Daubechies and Haar wavelet transform and compared between both of them using FPGA technology. The suggested design is tested. The synthesis result of the suggested design is presented. The simulation obtained results are compared from the Bit Error Rat (BER) point of view between the input audio signal and the reconstructed output signal. The Daubechies wavelet has proved to be more efficient for audio applications than Haar wavelet. Based on the results obtained by the simulation and synthesis of the design we can say that the implementation on FPGA gives a fast and reliable realization of wavelet transform and inverse wavelet transform.