Finite-Length Discrete Transform

Slides:



Advertisements
Similar presentations
Digital Filter Banks The digital filter bank is set of bandpass filters with either a common input or a summed output An M-band analysis filter bank is.
Advertisements

DFT properties Note: it is important to ensure that the DFTs are the same length If x1(n) and x2(n) have different lengths, the shorter sequence must be.
Chapter 8: The Discrete Fourier Transform
FFT-based filtering and the Short-Time Fourier Transform (STFT) R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2003.
Chapter 12 Fourier Transforms of Discrete Signals.
Signals and Systems Discrete Time Fourier Series.
Systems: Definition Filter
Finite Impuse Response Filters. Filters A filter is a system that processes a signal in some desired fashion. –A continuous-time signal or continuous.
1 1.1 © 2012 Pearson Education, Inc. Linear Equations in Linear Algebra SYSTEMS OF LINEAR EQUATIONS.
Copyright © Shi Ping CUC Chapter 3 Discrete Fourier Transform Review Features in common We need a numerically computable transform, that is Discrete.
Discrete-Time and System (A Review)
ELEN 5346/4304 DSP and Filter Design Fall Lecture 4: Frequency domain representation, DTFT, IDTFT, DFT, IDFT Instructor: Dr. Gleb V. Tcheslavski.
DTFT And Fourier Transform
1 7.1 Discrete Fourier Transform (DFT) 7.2 DFT Properties 7.3 Cyclic Convolution 7.4 Linear Convolution via DFT Chapter 7 Discrete Fourier Transform Section.
1 Chapter 8 The Discrete Fourier Transform 2 Introduction  In Chapters 2 and 3 we discussed the representation of sequences and LTI systems in terms.
1 Signals & Systems Spring 2009 Week 3 Instructor: Mariam Shafqat UET Taxila.
CHAPTER 3 Discrete-Time Signals in the Transform-Domain
CHAPTER 8 DSP Algorithm Implementation Wang Weilian School of Information Science and Technology Yunnan University.
8.1 representation of periodic sequences:the discrete fourier series 8.2 the fourier transform of periodic signals 8.3 properties of the discrete fourier.
Digital Signal Processing – Chapter 10
1 BIEN425 – Lecture 8 By the end of the lecture, you should be able to: –Compute cross- /auto-correlation using matrix multiplication –Compute cross- /auto-correlation.
Copyright © 2001, S. K. Mitra Digital Filter Structures The convolution sum description of an LTI discrete-time system be used, can in principle, to implement.
Discrete Fourier Transform Prof. Siripong Potisuk.
The Discrete Fourier Transform 主講人:虞台文. Content Introduction Representation of Periodic Sequences – DFS (Discrete Fourier Series) Properties of DFS The.
Zhongguo Liu_Biomedical Engineering_Shandong Univ. Chapter 8 The Discrete Fourier Transform Zhongguo Liu Biomedical Engineering School of Control.
BYST CPE200 - W2003: LTI System 79 CPE200 Signals and Systems Chapter 2: Linear Time-Invariant Systems.
Hossein Sameti Department of Computer Engineering Sharif University of Technology.
Department of Computer Eng. Sharif University of Technology Discrete-time signal processing Chapter 3: THE Z-TRANSFORM Content and Figures are from Discrete-Time.
Real time DSP Professors: Eng. Julian S. Bruno Eng. Jerónimo F. Atencio Sr. Lucio Martinez Garbino.
Digital Signal Processing Chapter 3 Discrete transforms.
Fourier Analysis of Discrete Time Signals
Z TRANSFORM AND DFT Z Transform
Copyright ©2010, ©1999, ©1989 by Pearson Education, Inc. All rights reserved. Discrete-Time Signal Processing, Third Edition Alan V. Oppenheim Ronald W.
Lecture 6: DFT XILIANG LUO 2014/10. Periodic Sequence  Discrete Fourier Series For a sequence with period N, we only need N DFS coefs.
Chapter 5 Finite-Length Discrete Transform
Dan Ellis 1 ELEN E4810: Digital Signal Processing Topic 3: Fourier domain 1.The Fourier domain 2.Discrete-Time Fourier Transform (DTFT) 3.Discrete.
DTFT Properties  Example - Determine the DTFT Y(e jω ) of  Let  We can therefore write  the DTFT of x[n] is given by.
Digital Signal Processing
Linear filtering based on the DFT
Lecture 17: Response of FIR filters to exponential inputs, response of FIR filters to periodic inputs, cascaded filters Sections 4.4.2,4.4.4, Sections.
DTFT continue (c.f. Shenoi, 2006)  We have introduced DTFT and showed some of its properties. We will investigate them in more detail by showing the associated.
Professor A G Constantinides 1 Discrete Fourier Transforms Consider finite duration signal Its z-tranform is Evaluate at points on z-plane as We can evaluate.
Fast Fourier Transforms. 2 Discrete Fourier Transform The DFT pair was given as Baseline for computational complexity: –Each DFT coefficient requires.
The Discrete Fourier Transform
Topics 1 Specific topics to be covered are: Discrete-time signals Z-transforms Sampling and reconstruction Aliasing and anti-aliasing filters Sampled-data.
University of Ioannina - Department of Computer Science Filtering in the Frequency Domain (Circulant Matrices and Convolution) Digital Image Processing.
What is filter ? A filter is a circuit that passes certain frequencies and rejects all others. The passband is the range of frequencies allowed through.
Finite Impuse Response Filters. Filters A filter is a system that processes a signal in some desired fashion. –A continuous-time signal or continuous.
EE345S Real-Time Digital Signal Processing Lab Fall 2006 Lecture 17 Fast Fourier Transform Prof. Brian L. Evans Dept. of Electrical and Computer Engineering.
In summary If x[n] is a finite-length sequence (n  0 only when |n|
بسم الله الرحمن الرحيم Digital Signal Processing Lecture 14 FFT-Radix-2 Decimation in Frequency And Radix -4 Algorithm University of Khartoum Department.
بسم الله الرحمن الرحيم Lecture (12) Dr. Iman Abuel Maaly The Discrete Fourier Transform Dr. Iman Abuel Maaly University of Khartoum Department of Electrical.
1 Chapter 8 The Discrete Fourier Transform (cont.)
DIGITAL SIGNAL PROCESSING ELECTRONICS
FFT-based filtering and the
4.1 DFT In practice the Fourier components of data are obtained by digital computation rather than by analog processing. The analog values have to be.
Chapter 8 The Discrete Fourier Transform
Sampling the Fourier Transform
Z TRANSFORM AND DFT Z Transform
Lecture 17 DFT: Discrete Fourier Transform
Discrete-Time Fourier Transform Discrete Fourier Transform z-Transform
Chapter 8 The Discrete Fourier Transform
Tania Stathaki 811b LTI Discrete-Time Systems in Transform Domain Ideal Filters Zero Phase Transfer Functions Linear Phase Transfer.
Discrete-Time Signal processing Chapter 3 the Z-transform
The Report of Monographic Study
Chapter 8 The Discrete Fourier Transform
Fast Fourier Transform (FFT) Algorithms
Fast Fourier Transform
CE Digital Signal Processing Fall Discrete Fourier Transform (DFT)
Presentation transcript:

Finite-Length Discrete Transform Chapter 5 Finite-Length Discrete Transform

§5.2.1 The Discrete Fourier Transform Definition - The simplest relation between a length-N sequence x[n], defined for 0≤n≤N-1, and its DTFT X(ejω) is obtained by uniformly sampling X(ejω) on the ω-axis between 0≤ω≤2π at ωk= 2πk/N, 0≤k≤N-1 From the definition of the DTFT we thus have

§5.2.1 The Discrete Fourier Transform Note: X[k] is also a length-N sequence in the frequency domain The sequence X[k] is called the discrete Fourier transform (DFT) of the sequence x[n] Using the notation WN= e-j2π/N the DFT is usually expressed as:

§5.2.1 The Discrete Fourier Transform The inverse discrete Fourier transform (IDFT) is given by To verify the above expression we multiply both sides of the above equation by and sum the result from n = 0 to n=N-1

§5.2.1 The Discrete Fourier Transform resulting in

§5.2.1 The Discrete Fourier Transform Making use of the identity we observe that the RHS of the last equation is equal to X[l] Hence

§5.2.1 The Discrete Fourier Transform Example – Consider the length-N sequence Its N-point DFT is given by

§5.2.1 The Discrete Fourier Transform Example – Consider the length-N sequence Its N-point DFT is given by

§5.2.1 The Discrete Fourier Transform Example – Consider the length-N sequence defined for 0≤n≤N-1 Using a trigonometric identity we can write

§5.2.1 The Discrete Fourier Transform The N-point DFT of g[n] is thus given by

§5.2.1 The Discrete Fourier Transform Making use of the identity we get

§5.2.2 Matrix Relations The DFT samples defined by can be expressed in matrix form as X=Dnx where

§5.2.2 Matrix Relations and DN is the N×N DFT matrix given by

§5.2.2 Matrix Relations Likewise, the IDFT relation given by can be expressed in matrix form as where is the N×N DFT matrix

§5.2.2 Matrix Relations where Note:

§5.2.3 DFT Computation Using MATLAB The functions to compute the DFT and the IDFT are fft and ifft These functions make use of FFT algorithms which are computationally highly efficient compared to the direct computation Programs 5_1.m and 5_2.m illustrate the use of these functions

§5.2.3 DFT Computation Using MATLAB Example –a Program 5_3.m can be used to compute the DFT and the DTFT of the sequence x[n]=cos(6πn/16), 0≤n≤15 as shown below indicates DFT samples

§5.3.3 DTFT from DFT by Interpolation The N-point DFT X[k] of a length-N sequence x[n] is simply the frequency samples of its DTFT X(ejω) evaluated at N uniformly spaced frequency points Given the N-point DFT X[k] of a length-N sequence x[n], its DTFT X(ejω) can be uniquely determined from X[k]

§5.3.3 DTFT from DFT by Interpolation Thus

§5.3.3 DTFT from DFT by Interpolation To develop a compact expression for the sum S, let Then From the above

§5.3.3 DTFT from DFT by Interpolation Or, equivalently, Hence

§5.3.3 DTFT from DFT by Interpolation therefore

§5.3.4 Sampling the DTFT Consider a sequence x[n] with a DTFT X(ejω) We sample X(ejω) at N equally spaced points ωk=2πk/N, 0≤k≤N-1 deleloping the N frequency samples These N frequency samples can be considered as an N-point DFT Y[k] whose N- point IDFT is a length-N sequence y[n]

§5.3.4 Sampling the DTFT Now Thus An IDFT of Y[k] yields

§5.3.4 Sampling the DTFT i.e. Making use of the identity

§5.3.4 Sampling the DTFT we arrive at the desired relation Thus y[n] is obtained from x[n] by adding an infinite number of shifted replicas of x[n], with each replica shifted by an integer multiple of N sampling instants, and observing the sum only for the interval 0≤n≤N-1

§5.3.4 Sampling the DTFT To apply to finite-length sequences, we assume that the samples outside the specified range are zeros Thus if x[n] is a length-M sequence with M≤N, then y[n]= x[n] , for 0≤n≤N-1

§5.3.4 Sampling the DTFT If M > N, there is a time-domain aliasing of samples of x[n] in generating y[n], and x[n] cannot be recovered from y[n] Example – Let {x[n]}={0 1 2 3 4 5} ↑ By sampling its DTFT X(ejω) at ωk=2πk/4, 0≤k≤3 and then applying a 4-point IDFT to these samples, we arrive at the sequence y[n] given by

§5.3.4 Sampling the DTFT y[n]= x[n]+ x[n+4]+x[n-4] 0≤n≤3 i.e. {y[n]}={4 6 2 3} ↑ {x[n]} cannot be recovered from {y[n]}

Numerical Computation of the DTFT Using the DFT A practical approach to the numerical computation of the DTFT of a finite-length sequence Let X(ejω) be the DTFT of a length-N sequence x[n] We wish to evaluate X(ejω) at a dense grid of frequencies ωk=2πk/M, 0≤k≤M-1,where M >> N:

Numerical Computation of the DTFT Using the DFT Define a new sequence Then

Numerical Computation of the DTFT Using the DFT Thus is essentially an M-point DFT Xe[k] of the length-M sequence xe[n] The DFT Xe[k] can be computed very efficiently using the FFT algorithm if M is an integer power of 2 The function freqz employs this approach to evaluate the frequency response at a prescribed set of frequencies of a DTFT expressed as a rational function in e-jω

DFT Properties Like the DTFT, the DFT also satisfies a number of properties that are useful in signal processing applications Some of these properties are essentially identical to those of the DTFT, while some others are somewhat different A summary of the DFT properties are given in tables in the following slides

Table 5.1: DFT Properties: Symmetry Relations x[n] is a complex sequence

Table 5.2: DFT Properties: Symmetry Relations x[n] is a real sequence

Table 5.3: General Properties of DFT

§5.4.1 Circular Shift of a Sequence This property is analogous to the time- shifting property of the DTFT as given in Table 3.4, but with a subtle difference Consider length-N sequences defined for 0≤n≤N-1 Sample values of such sequences are equal to zero for values of n<0 and n≥N

§5.4.1 Circular Shift of a Sequence If x[n] is such a sequence, then for any arbitrary integer n0, the shifted sequence x1[n]= x(n-n0) is no longer defined for the range 0≤n≤N-1 We thus need to define another type of a shift that will always keep the shifted sequence in the range 0≤n≤N-1

§5.4.1 Circular Shift of a Sequence The desired shift, called the circular shift, is defined using a modulo operation: For n0>0 (right circular shift), the above equation implies

§5.4.1 Circular Shift of a Sequence Illustration of the concept of a circular shift

§5.4.1 Circular Shift of a Sequence As can be seen from the previous figure, a right circular shift by n0 is equivalent to a left circular shift by N-n0 sample periods A circular shift by an integer number n0 greater than N is equivalent to a circular shift by

§5.4.2 Circular Convolution This operation is analogous to linear convolution, but with a subtle difference Consider two length-N sequences, g[n] and h[n], respectively Their linear convolution results in a length-(2N-1) sequence yL[n] given by

§5.4.2 Circular Convolution In computing yL[n] we have assumed that both length-N sequence have been zero-padded to extend their lengths to 2N-1 The longer form of yL[n] results from the time-reversal of the sequence h[n] and its linear shift to the right The first nonzero value of yL[n] is yL[0]=g[0]h[0] ,and the last nonzero value is yL[2N-2]=g[N-1]h[N-1]

§5.4.2 Circular Convolution To develop a convolution-like operation resulting in a length-N sequence yC[n] , we need to define a circular time-reversal, and then apply a circular time-shift Resulting operation, called a circular convolution, is defined by

§5.4.2 Circular Convolution Since the operation defined involves two length-N sequences, it is often referred to as an N-point circular convolution, denoted as N The circular convolution is commutative, i.e. N

§5.4.2 Circular Convolution Example – Determine the 4-point circular convolution of the two length-4 sequences: as sketched below

§5.4.2 Circular Convolution The result is a length-4 sequence yC[n] given by 4 From the above we observe

§5.4.2 Circular Convolution Likewise

§5.4.2 Circular Convolution and yC[n] The circular convolution can also be computed using a DFT-based approach as indicated in Table 5.3

§5.4.2 Circular Convolution Example – Consider the two length-4 sequences repeated below for convenience: The 4-point DFT G[k] of g[n] is given by G[k]= g[0]+g[1]e-j2πk/4 +g[2]e-j4πk/4 +g[3]e-j6πk/4 =1+2e-jπk/2 +e-j3πk/2 , 0≤k≤3

§5.4.2 Circular Convolution Therefore G[0]=1+2+1=4, G[1]=1-j2+j=1-j, G[2]=1-2-1=-2, G[3]= 1+j2-j=1+j Likewise, H[k]=h[0]+h[1]e-j2πk/4 +h[2]e-j4πk/4 +h[3]e-j6πk/4 =2+2e-jπk/2 +e-jπk +e-j3πk/2 , 0≤k≤3

§5.4.2 Circular Convolution Hence, H[0]=2+2+1+1=6, H [1]=2-j2-1+j=1-j, H [2]=2-2+1-1=0, H [3]=2+j2-1-j=1+j The two 4-point DFTs can also be computed using the matrix relation given earlier

§5.4.2 Circular Convolution D4 is the 4-point DFT matrix

§5.4.2 Circular Convolution If YC[k] denotes the 4-point DFT of yC[n] then from Table 3.5 we observe YC[k]= G[k] H[k] , 0≤k≤3 Thus

§5.4.2 Circular Convolution A 4-point IDFT of YC[k] yields

§5.4.2 Circular Convolution Example – Now let us extended the two length-4 sequences to length 7 by appending each with three zero-valued samples, i.e.

§5.4.2 Circular Convolution We next determine the 7-point circular convolution of ge[n] and he[n] : From the above y[0]=ge[0]he[0]+ge[1]he[6]+ge[3]he[4] +ge[4]he[3]+ge[5]he[2]+ge[6]he[1] =ge[0]he[0]=1×2=2

§5.4.2 Circular Convolution Continuing the process we arrive y[1]=g[0]h[1]+g[1]h[0]=(1×2)+(2×2)=6, y[2]=g[0]h[2]+g[2]h[0] =(1×2)+(2×2)+(0×2)=5, y[3]=g[0]h[3]+g[1]h[2]+g[2]h[1]+g[3]h[0] =(1×1)+(2×1)+(0×2)+(1×2)=5, y[4]=g[1]h[3]+g[2]h[2]+g[3]h[1] =(2×1)+(0×1)+(1×2)=4,

§5.4.2 Circular Convolution y[5]=g[2]h[3]+g[3]h[2]=(0×1)+(1×1)=1, y[6]=g[3]h[3]=(1×1)=1 As can be seen from the above that y[n] is precisely the sequence yL[n] obtained by a linear convolution of g[n] and h[n]

§5.4.2 Circular Convolution The N-point circular convolution can be written in matrix form as Note: The elements of each diagonal of the N×N matrix are equal Such a matrix is called a circulant matrix

§5.4.2 Circular Convolution Tabular Method We illustrate the method by an example Consider the evaluation of y[n]=h[n] g[n] where {g[n]} and {h[n]} are length-4 sequences * First, the samples of the two sequences are multiplied using the conventional multiplication method as shown on the next slide

§5.4.2 Circular Convolution The partial products generated in the 2nd, 3rd, and 4th rows are circularly shifted to the left as indicated above

§5.4.2 Circular Convolution The modified table after circular shifting is shown below The samples of the sequence { yc[n]} are obtained by adding the 4 partial products in the column above of each sample

§5.4.2 Circular Convolution Thus yc[0]=g[0]h[0]+ g[3]h[1]+ g[2]h[2]+ g[1]h[3] yc[1]=g[1]h[0]+ g[0]h[1]+ g[3]h[2]+ g[2]h[3] yc[2]=g[2]h[0]+ g[1]h[1]+ g[0]h[2]+ g[3]h[3] yc[3]=g[3]h[0]+ g[2]h[1]+ g[1]h[2]+ g[0]h[3]

§5.9 Computation of the DFT of Real Sequences In most practical applications, sequences of interest are real In such cases, the symmetry properties of the DFT given in Table 5.2 can be exploited to make the DFT computations more efficient

§5.9.1 N-Point DFTs of Two Length-N Real Sequences Let g[n] and h[n] be two length-N real sequences with G[k] and H[k] denoting their respective N-point DFTs These two N-point DFTs can be computed efficiently using a single N-point DFT Define a complex length-N sequence x[n]=g[n]+jh[n] Hence, g[n]=Re{x[n]} and h[n]=Im{x[n]}

§5.9.1 N-Point DFTs of Two Length-N Real Sequences Let X[k] denote the N-point DFT of x[n] Then, from Table 5.1 we arrive at Note that for 0≤k≤N-1,

§5.9.1 N-Point DFTs of Two Length-N Real Sequences Example – We compute the 4-point DFTs of the two real sequences g[n] and h[n] given below Then {x[n]}={g[n]}+j{h[n]} is given by

§5.9.1 N-Point DFTs of Two Length-N Real Sequences Its DTF X[k] is From the above X*[k]=[4-j6 2 -2 -j2] Hence X*[<4-k>4]=[4-j6 -j2 -2 2]

§5.9.1 N-Point DFTs of Two Length-N Real Sequences Therefore {G[k]}=[4 1-j -2 1+j] {G[k]}=[6 1-j 0 1+j] verifying the results derived earlier

§5.9.2 2N-Point DFT of a Real Sequence Using an N-point DFT Let v[n] be a length-2N real sequence with an 2N-point DFT V[k] Define two length-N real sequences g[n] and h[n] as follows: Let G[k] and H[k] denote their respective N- point DFTs

§5.9.2 2N-Point DFT of a Real Sequence Using an N-point DFT Define a length-N complex sequence {x[n]}={g[n]}+j{h[n]} with an N-point DFT X[k] Then as shown earlier

§5.9.2 2N-Point DFT of a Real Sequence Using an N-point DFT Now

§5.9.2 2N-Point DFT of a Real Sequence Using an N-point DFT i.e., Example – Let us determine the 8-point DFT V[k] of the length-8 real sequence We form two length-4 real sequences as follows

§5.9.2 2N-Point DFT of a Real Sequence Using an N-point DFT Now Substituting the values of the 4-point DFTs G[k] and H[k] computed earlier we get

§5.9.2 2N-Point DFT of a Real Sequence Using an N-point DFT

§5.9.2 2N-Point DFT of a Real Sequence Using an N-point DFT

§5.10 Linear Convolution Using the DFT Linear convolution is a key operation in many signal processing applications Since a DFT can be efficiently implemented using FFT algorithms, it is of interest to develop methods for the implementation of linear convolution using the DFT

§5.10.1 Linear Convolution of Two Finite-Length Sequences Let g[n] and h[n] be two finite-length sequences of length N and M, respectively Denote L=N+M-1 Define two length-L sequences

§5.10.1 Linear Convolution of Two Finite-Length Sequences Then L yL[n]=g[n] h[n]=yC[n]=ge[n] he[n] ﹡ The corresponding implementation scheme is illustrated below Zero-padding with (M-1) zeros (N-1) zeros (N+M-1) point DFT point IDFT g[n] h[n] ge[n] he[n] yL[n] Length-N Length-M Length-(N+M-1)

§5.10.2 Linear Convolution of a Finite- Length Sequence with an Infinite-Length Sequence We next consider the DFT-based implementation of where h[n] is a finite-length sequence of length M and x[n] is an infinite length (or a finite length sequence of length much greater than M)

§5.10.2 Overlap-Add Method We first segment x[n], assumed to be a causal sequence here without any loss of generality, into a set of contiguous finite-length subsequences xm [n] of length N each: where

§5.10.2 Overlap-Add Method ﹡ ﹡ ﹡ Thus we can write where Since h[n] is of length M and xm [n] is of length N, the linear convolution is of length N+M-1 ﹡

§5.10.2 Overlap-Add Method As a result, the desired linear convolution has been broken up into a sum of infinite number of short-length linear convolutions of length N+M-1 each: ﹡ Each of these short convolutions can be implemented using the DFT-based method discussed earlier, where now the DFTs (and the IDFT) are computed on the basis of N+M-1 points

§5.10.2 Overlap-Add Method There is one more subtlety to take care of before we can implement using the DFT-based approach Now the first convolution in the above sum, , is of length N+M-1 and is defined for 0≤ N+M-2 ﹡

§5.10.2 Overlap-Add Method ﹡ ﹡ The second short convolution , is also of length N+M-1 but is defined for N≤n≤2N+M-2 ﹡ There is an overlap of M-1samples between these two short linear convolutions Likewise, the third short convolution , is also of length N+M-1 but is defined for 2N≤n≤3N+M-2 ﹡

§5.10.2 Overlap-Add Method ﹡ ﹡ Thus there is an overlap of M-1 samples between h[n] x1[n] and h[n] x2[n] ﹡ In general, there will be an overlap of M-1 samples between the samples of the short convolutions h[n] xr-1[n] and h[n] xr [n] for (r-1)N≤n≤rN+M-2 ﹡ This process is illustrated in the figure on the next slide for M=5 and N=70

§5.10.2 Overlap-Add Method

§5.10.2 Overlap-Add Method

§5.10.2 Overlap-Add Method Therefore, y[n] obtained by a linear convolution of x[n] and h[n] is given by y[n]=y0[n], 0≤n≤6 y[n]=y0[n]+ y1[n-7], 7≤n≤10 y[n]=y1[n-7], 11≤n≤13 y[n]= y1[n-7]+ y2[n-14], 14≤n≤17 y[n]= y2[n-14], 18≤n≤20

§5.10.2 Overlap-Add Method The above procedure is called the overlap- add method since the results of the short linear convolutions overlap and the overlapped portions are added to get the correct final result The function fftfilt can be used to implement the above method

§5.10.2 Overlap-Add Method Program 5_5 illustrates the use of fftfilt in the filtering of a noise-corrupted signal using a length-3 moving average filter The plots generated by running this program is shown below

§5.10.2 Overlap-Save Method In implementing the overlap-add method using the DFT, we need to compute two (N+M-1)-point DFTs and one (N+M-1)-point IDFT since the overall linear convolution was expressed as a sum of short-length linear convolutions of length (N+M-1) each It is possible to implement the overall linear convolution by performing instead circular convolution of length shorter than (N+M-1)

§5.10.2 Overlap-Save Method To this end, it is necessary to segment x[n] into overlapping blocks xm[n], keep the terms of the circular convolution of h[n] with xm[n] that corresponds to the terms obtained by a linear convolution of h[n] and xm[n], and throw the other parts of the circular convoluition

§5.10.2 Overlap-Save Method To understand the correspondence between the linear and circular convolutions, consider a length-4 sequence x[n] and a length-3 sequence h[n] Let yL[n] denote the result of a linear convolution of x[n] with h[n] The six samples of yL[n] are given by

§5.10.2 Overlap-Save Method yL[0]=h[0]x[0] yL[1]=h[0]x[1]+h[1]x[0] yL[2]=h[0]x[2]+h[1]x[1]+h[2]x[0] yL[3]=h[0]x[3]+h[1]x[2]+h[2]x[1] yL[4]=h[1]x[3]+h[2]x[2] yL[5]=h[2]x[3]

§5.10.2 Overlap-Save Method If we append h[n] with a single zero-valued sample and convert it into a length-4 sequence he[n], the 4-point circular convolution yC[n] of he[n] and x[n] is given by yC[0]=h[0]x[0]+h[1]x[3]+h[2]x[2] yC[1]=h[0]x[1]+h[1]x[0]+h[2]x[3] yC[2]=h[0]x[2]+h[1]x[1]+h[2]x[0] yC[3]=h[0]x[3]+h[1]x[2]+h[2]x[1]

§5.10.2 Overlap-Save Method If we compare the expressions for the samples of yL[n] with the samples of yC[n], we observe that the first 2 terms of yC[n] do not correspond to the first 2 terms of yL[n], whereas the last 2 terms of yC[n] are precisely the same as the 3rd and 4th terms of yL[n], i.e., yL[0]≠yC[0], yL[1]≠yC[1] yL[2]≠yC[2], yL[3]≠yC[3]

§5.10.2 Overlap-Save Method General case: N-point circular convolution of a length-M sequence h[n] with a length-N sequence x[n] with N > M First M-1samples of the circular convolution are incorrect and are rejected Remaining N - M+1 samples correspond to the correct samples of the linear convolution of h[n] with x[n]

§5.10.2 Overlap-Save Method Now, consider an infinitely long or very long sequence x[n] Break it up as a collection of smaller length (length-4) overlapping sequences xm[n] as xm[n]= x [n+2m], 0≤n≤3, 0≤m≤∞ Next,form wm[n]=h[n] xm[n] 4

§5.10.2 Overlap-Save Method Or, equivalently, wm[0]=h[0]xm[0]+h[1]xm[3]+h[2]xm[2] wm[1]=h[0]xm[1]+h[1]xm[0]+h[2]xm[3] wm[2]=h[0]xm[2]+h[1]xm[1]+h[2]xm[0] wm[3]=h[0]xm[3]+h[1]xm[2]+h[2]xm[1] Computing the above for m = 0, 1, 2, 3, . . . , and substituting the values of xm[n] we arrive at

§5.10.2 Overlap-Save Method w0[0]=h[0]x[0]+h[1]x[3]+h[2]x[2] ← Reject w0[2]=h[0]x[2]+h[1]x[1]+h[2]x[0]=y[2]← Save w0[3]=h[0]x[3]+h[1]x[2]+h[2]x[1]=y[2]← Save w1[0]=h[0]x[2]+h[1]x[5]+h[2]x[4] ← Reject w1[1]=h[0]x[3]+h[1]x[2]+h[2]x[5] ← Reject w1[2]=h[0]x[4]+h[1]x[3]+h[2]x[2]=y[4]← Save w1[3]=h[0]x[5]+h[1]x[4]+h[2]x[3]=y[5]← Save

§5.10.2 Overlap-Save Method w2[0]=h[0]x[4]+h[1]x[5]+h[2]x[6] ← Reject w2[2]=h[0]x[6]+h[1]x[5]+h[2]x[4]=y[6]← Save w2[3]=h[0]x[7]+h[1]x[6]+h[2]x[5]=y[7]← Save

§5.10.2 Overlap-Save Method It should be noted that to determine y[0] and y[1], we need to form x-1[n] : x-1[0]=0, x-1[1]=0, x-1[2]=x[0], x-1[3]=x[1] 4 and compute for 0≤n≤3 reject w-1[0] and w-1[1] ,and save w-1[2]= y[0] and w-1[3]= y[1]

§5.10.2 Overlap-Save Method General Case: Let h[n] be a length-N sequence Let xm[n] denote the m-th section of an infinitely long sequence x[n] of length N and defined by xm[n]= x [n+m(N-m+1)], 0≤n≤N-1 with M<N

§5.10.2 Overlap-Save Method Let wm[n]=h[n] xm[n] Then, we reject the first M-1 samples of wm[n] and “abut” the remaining N-M+1 samples of wm[n] to form yL[n], the linear convolution of h[n] and x[n] If ym[n] denotes the saved portion of wm[n], i.e.

§5.10.2 Overlap-Save Method Then yL [n+m(N-M+1)]=ym[n] , M-1≤n≤N-1 The approach is called overlap-save method since the input is segmented into overlapping sections and parts of the results of the circular convolutions are saved and abutted to determine the linear convolution result

§5.10.2 Overlap-Save Method Process is illustrated next

§5.10.2 Overlap-Save Method