design and analysis of different convolution …

6
80 DESIGN AND ANALYSIS OF DIFFERENT CONVOLUTION TECHNIQUES Kirandeep Kaur 1 *, Harmanpreet Kaur 1 and Rajesh Mehra 1 *Corresponding Author: Kirandeep Kaur, [email protected] In this paper the technique of convolution and its need in signal processing is discussed. The comparison of three basic convolution techniques like linear, circular convolution and Discrete Fourier Transform for general digital signal processing is analyzed. Their performance has been compared in terms of computational complexity, number of operations and number of outputs. A relationship has been drawn between the three techniques using MATLAB simulation and mathematical methods. Keywords: Linear convolution, Circular convolution, Discrete fourier transform INTRODUCTION Convolution is considered to be heart of the digital signal processing. It is the mathematical way of combining two signals to obtain a third signal. Convolution helps to estimate the output of a system with arbitrary input, with knowledge of impulse response of the system. A linear system’s characteristics are completely specified by the system’s impulse response, as governed by the mathematics of convolution. Convolution is an operation which takes two functions as input, and produces a single function output (much like addition or multiplication of functions).  The method of combining these functions is defined as ISSN 2319 – 2518 www.ijeetc.com Vol. 3, No. 2, April 2014 © 2014 IJEETC. All Rights Reserved Int. J. Elec&Electr.Eng&Telecoms. 2014 1 Department of Electronics and Communication Engineering, National Institute of Technical’ Training & Research Chandigarh, UT, India. t d h f t h t f 0 * ...(1) Need of Convolution Let’s consider the case of formation of ripples on the surface of a pond. If a stone is thrown in the standing water of the pond, then it will cause a ripple to travel outwards across the surface. Now on the next instant when we take a bigger stone, then a bigger ripple is expected. Similarly if lighter stone is thrown, small ripple is expected. All three of the ripple patterns above share the same general shape, but differ only in their magnitude. Now to calculate the impact of different stones, we look at the impacting stone as our input and the resulting Research Paper

Upload: others

Post on 19-Apr-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DESIGN AND ANALYSIS OF DIFFERENT CONVOLUTION …

80

Int. J. Elec&Electr.Eng&Telecoms. 2014 Kirandeep Kaur et al., 2014

DESIGN AND ANALYSIS OF DIFFERENTCONVOLUTION TECHNIQUES

Kirandeep Kaur1*, Harmanpreet Kaur1 and Rajesh Mehra1

*Corresponding Author: Kirandeep Kaur,[email protected]

In this paper the technique of convolution and its need in signal processing is discussed. Thecomparison of three basic convolution techniques like linear, circular convolution and DiscreteFourier Transform for general digital signal processing is analyzed. Their performance has beencompared in terms of computational complexity, number of operations and number of outputs.A relationship has been drawn between the three techniques using MATLAB simulation andmathematical methods.

Keywords: Linear convolution, Circular convolution, Discrete fourier transform

INTRODUCTIONConvolution is considered to be heart of thedigital signal processing. It is the mathematicalway of combining two signals to obtain a thirdsignal. Convolution helps to estimate the outputof a system with arbitrary input, with knowledgeof impulse response of the system. A linearsystem’s characteristics are completelyspecified by the system’s impulse response,as governed by the mathematics ofconvolution.

Convolution is an operation which takes twofunctions as input, and produces a singlefunction output (much like addition ormultiplication of functions).  The method ofcombining these functions is defined as 

ISSN 2319 – 2518 www.ijeetc.comVol. 3, No. 2, April 2014

© 2014 IJEETC. All Rights Reserved

Int. J. Elec&Electr.Eng&Telecoms. 2014

1 Department of Electronics and Communication Engineering, National Institute of Technical’ Training & Research Chandigarh, UT,India.

t

dhfthtf0

* ...(1)

Need of ConvolutionLet’s consider the case of formation of rippleson the surface of a pond. If a stone is thrown inthe standing water of the pond, then it will causea ripple to travel outwards across the surface.Now on the next instant when we take a biggerstone, then a bigger ripple is expected.Similarly if lighter stone is thrown, small rippleis expected. All three of the ripple patternsabove share the same general shape, but differonly in their magnitude. Now to calculate theimpact of different stones, we look at theimpacting stone as our input and the resulting

Research Paper

Page 2: DESIGN AND ANALYSIS OF DIFFERENT CONVOLUTION …

81

Int. J. Elec&Electr.Eng&Telecoms. 2014 Kirandeep Kaur et al., 2014

ripple as our output. We can express thedependence of the ripple’s size on the weightof the stone by saying that the outputscales linearly with the input. Let’s consider aspecial stone, say of unit weight. If we knowthe ripple caused by this stone, we can thenfind the ripple caused by any stone(lighter or heavier) by just scaling by the properamount.

Similarly this approach can be extended tovarious signals in signal processing. Let’sconsider a case where determining thefrequency spectrum or frequency transferfunction of a linear network provides one withthe knowledge of how a network will respondto or alter an input signal. Conventionalmethods used to determine this entail the useof spectrum analyzers which use either sweepgenerators or variable-frequency oscillators toimpress upon a network all possiblefrequencies of equal amplitude and equalphase. The response of a network to allfrequencies can thus be determined. Anyamplitude and phase variations at the outputof a network are due to the network itself andas a result define the frequency transferfunction. Another means of obtaining this sameinformation would be to apply an impulsefunction to the input of a network and thenanalyze the network impulse-response for itsspectral frequency content. Comparison of thenetwork-frequency transfer function obtainedby the two techniques would yield the sameinformation. Since an impulse responseprovides information of a network frequencyspectrum or transfer function, it additionallyprovides a means of determining the networkresponse to any other time function input.Hence convolution can be used to find

response of any signal just knowing its impulseresponse. Convolution relates the three signalsof interest: the input signal, the output signal,and the impulse response. There are varioustypes of techniques to perform convolution.

CONVOLUTION TECHNIQUESThere are different type of techniques used toimplement convolution. They can be dividedon the basis of time domain as well asfrequency domain. In time domain we havelinear convolution, circular convolution. On theother hand we can have Discrete Fouriertransform and further its fast implementationsto be categorised under frequency domainpart.

Linear convolution is the simplest type ofconvolution. For two finite discrete sequencesof length Nx and Nh, the linear or aperiodicconvolution is defined by the form:

n

k

knxkhny0

...(2)

where h(k) and x(n – k) are zero outside theirappropriately defined intervals. For Nx > Nh,each summation need only be calculated forthe 0 < k < Nh–1 terms. The output, y(n), willhave length Nx + Nh–1. As we know thatconvolution forms the basis of all filteringprocesses. So if the linear convolution is usedto implement tapped delay line FIR filter, itrequires Nh multiplications and Nh additionsfor single output sample. This method isconducive for small impulse responses but itsinadequate efficiency makes it undesirable.So we switch on to other techniques.

The circular convolution, also knownas cyclic convolution, of two aperiodicfunctions occurs when one of them

Page 3: DESIGN AND ANALYSIS OF DIFFERENT CONVOLUTION …

82

Int. J. Elec&Electr.Eng&Telecoms. 2014 Kirandeep Kaur et al., 2014

is convolved in the normal way with a periodicsummation of the other function. Linearconvolution can be obtained from its cycliccounterpart. Circular convolution is much moreeffective than linear convolution in a real-timesignal processing system since it hassuccessive inputs of data. By providinghardware for circular convolution, DigitalSignal Processor (DSP) allows for such highspeed convolution processing which happenfrequently during the treatment of the timedomain of signals (Ungseon Yun andByeungwoo Jeon, 2010). In circularconvolution instead of considering twosequences x[n] and h[n] of different length weconsider them of same length N. Such that theoutput sequence y[n] lies between 0 to 2N–1.Now if we extend x[n] and h[n] periodically withperiod N (Chi-Tsong Chen, 1994). Thencircular convolution is represented by theequation.

1

0

N

ic ikhixky ...(3)

The basic motive behind implementingcircular convolution is that it saves memory aswell as improves the processing time.

In frequency domain the given time domainsequences are transformed to frequency rangeand are simply multiplied. The Discrete FourierTransform (DFT) is purely discrete, discrete-time data sets are converted into a discrete-frequency representation.. For the discretecase, multiplication in the frequency domaintranslates  circular convolution in the timedomain (Rabiner and Gold, 1975). So toovercome the computational complexity withcircular convolution we shift to frequencydomain and uses DFT. The discrete Fourier

transform changes an N point input signal intotwo N/2+1 point output signals. The input signalcontains the signal being decomposed, whilethe two output signals contain the amplitudesof the component (Steven, 2002). The DFT fora signal with period N is:

1

0

2N

n

Nknj

enxkX

...(4)

The IDFT for a signal can be calculated as:

1

0

21 N

k

Nnj

ekxN

nx

...(5)

We can use DFT and IDFT to calculate thecircular convolution using the equation:

mHmXIDFTmYIDFTny ...(6)

MATLAB RESULTS ANDSIMULATIONLet’s take an example by taking twosequences as x(n) = [1 2 3 4] and h(n) = [1 2

Figure 1: Linear Convolution of TwoSequences Using Matlab

Page 4: DESIGN AND ANALYSIS OF DIFFERENT CONVOLUTION …

83

Int. J. Elec&Electr.Eng&Telecoms. 2014 Kirandeep Kaur et al., 2014

4]. Computing the linear convolution of abovesequences using Matlab are as:

The above graphical results can be verifiedusing an easy mathematical approach a novelmethod for calculating convolution sum of twofinite length sequences (John Pierre, 1996).

x(n): 1 2 3 4

h(n): * 1 2 4

4 8 12 16

2 4 6 8

1 2 3 4

1 4 11 18 20 16

Let’s consider two sequence x[n] = [1 2 34] and h[n] = [1 2 4 0] of the same length andcompute its circular convolution using Matlabcode.

h[n]: 1 2 4 0

x[n]: * 1 2 3 4

4 8 16 0

6 12 0 3

8 0 2 4

0 1 2 4

18 21 20 11

y(3) y(0) y(1) y(2)

The far left value computed by this methodcorresponds to y(N – 1) [2] where N is thelength of the sequence. Therefore value 18corresponds to value y(3). The lengths of thesequences produce by discrete-timeconvolution and circular convolution aredifferent. Specifically, the sequence that resultsfrom circular convolution is the same length,N, as the two input sequences. However,discrete-time convolution results in a sequencethat has theoretically infinite length, but theinterval over which the output is nonzero is [0,2N – 2].

Discrete-time convolution can be thought ofas a low-pass version of the original signal onthe interval [0, N – 1] with a “tail” of filter decayplaced onto the end interval [N, 2N – 2]. Theoutput from circular convolution can be seento be the same as that for discrete-time linearconvolution except at the ends of the signal.Hence in the middle of the sequences, bothcircular convolution and discrete-timeconvolution give roughly the same outputvalues. The length of a circular convolution isequal to the length of the longest sequence.The trailing samples that were left alone inlinear convolution are now wrapped around,which leads to short and different results. The

Figure 2: Circular Convolutionof Two Finite Sequences

The above code computed result can beverified using the novel method for calculatingconvolution(John Pierre, 1996).

Page 5: DESIGN AND ANALYSIS OF DIFFERENT CONVOLUTION …

84

Int. J. Elec&Electr.Eng&Telecoms. 2014 Kirandeep Kaur et al., 2014

problem with convolution though is reduced toan extend but still in terms of numbermultiplications and additions required tocalculate each sample persists.

the convolution process introduce furtheroverhead (Jason, 1998).

Figure 3: Calculating Linear ConvolutionUsing DFT and IDFT

The Matlab result for calculating circularconvolution for sequence x[n] = [1 2 3 4] andh[n] = [1 2 4] using DFT and IDFT are as:

This method yields the desired linearconvolution result only if x(n) and h(n) arepadded with zeros prior to the DFT such thattheir respective lengths are Nx + Nh – 1,essentially zeroing out all circular artifacts.

The disadvantage of frequency domainmethod is Processing in the frequency domainintroduces significant input to output latency,since the input must be initially buffered andtransformed into the frequency domain.Conversely, the output must be inverselytransformed into the time domain. Thebuffering imposes a minimum 2 × Nx samplelatency. The frequency transformation itself and

No. of Outputs 6 4 6

No. of Adders 5 3 5

No. of Multipliers 5 4 6

No. of States 5 3 5

Multiplications perInput Sample 5 4 6

Additions perInput Sample 5 3 5

Table 1. Comparison Between 3Techniques

ParametersLinear

ConvolutionCircular

Convolution DFT

The above table shows the quantity wisecomparison between the three convolutiontechniques. The above table is based on theMatlab results obtained by designing filter onthe given 3 techniques and analysing its costimplementation.

CONCLUSIONAn effort has been made to compareconventional convolution techniques and tovisualise a relationship between them. Linearconvolution is computation wise morecomplex. Circular convolution gives reducednumber of outputs by about 33% in comparisonto linear type and hence memory requirementis less. DFT is far more easier in terms ofmathematical calculations than other twotechniques but it has more hardware latencyand number of overheads. But these differentmethods of convolution providesapproximately same value of outputs.

REFERENCES1. Chi-Tsong Chen (1994), “System and

Signal Analysis”, University of New York

Page 6: DESIGN AND ANALYSIS OF DIFFERENT CONVOLUTION …

85

Int. J. Elec&Electr.Eng&Telecoms. 2014 Kirandeep Kaur et al., 2014

at Stony Brook, Vol. 2, pp. 410-413,Oxford University Press.

2. Jason R VandeKieft (1998),“Computational Improvement to LinearConvolution with Multirate FilteringMethods”, Research Project, CoralGables, Florida.

3. John W Pierre (1996), “A Novel Methodfor Calculating the Convolution Sum ofTwo Finite Length Sequences”, IEEETransactions on Education, Vol. 39,No. 1, pp. 77-80.

4. National Semiconductor Application Note237, January 1980.

5. Steven W Smith (2002), “The Scientistand Engineer’s Guide to Digital SignalProcessing”, Newnes Publication Edition.

6. Ungseon Yun and Byeungwoo Jeon(2010), “Implementation of Real-TimeHigh Speed Convolution Using DSP”,New Trends in Information Scienceand Service Science (NISS) , May,pp. 499-502.