Fast Convolution using the FFT

6
1/6 Fast Convolution using the FFT Dr. Reza Shahidi July 29, 2014

Transcript of Fast Convolution using the FFT

Page 1: Fast Convolution using the FFT

1 / 6

Fast Convolution using the FFT

Dr. Reza Shahidi

July 29, 2014

Page 2: Fast Convolution using the FFT

The DFT and Convolution

The DFT andConvolution

Fast ConvolutionThe overlap-savemethodOverlap-and-savemethodOverlap-and-savemethod

2 / 6

■ By the convolution theorem, convolution intime is same as multiplication in frequency.

■ Can use the FFT to perform fast convolutions:

Page 3: Fast Convolution using the FFT

Fast Convolution

The DFT andConvolution

Fast ConvolutionThe overlap-savemethodOverlap-and-savemethodOverlap-and-savemethod

3 / 6

■ Remember that in general if we are convolvinga signal h[k] of length Q with another signalx[n] of length P , then the length of the signaly[n] resulting from convolution of these twosignals is L = P + Q − 1.

■ To ensure that our results are valid using theFFT to perform the convolution, the numberof points in the FFT must be at least L.

■ There are two main FFT-basedblock-convolution algorithms: theoverlap-and-save method and theoverlap-and-add method, where the input x[n]is very long and must be processed in blocks.

Page 4: Fast Convolution using the FFT

The overlap-save method

The DFT andConvolution

Fast ConvolutionThe overlap-savemethodOverlap-and-savemethodOverlap-and-savemethod

4 / 6

■ The overlap-and-save method can berepresented by the following diagram:

Page 5: Fast Convolution using the FFT

Overlap-and-save method

The DFT andConvolution

Fast ConvolutionThe overlap-savemethodOverlap-and-savemethodOverlap-and-savemethod

5 / 6

■ We can describe the algorithm shown in theprevious diagram by the following steps:

1. Choose the size of the FFT to be N ≈ 4Q.2. Zero-pad h[k] to length N and perform FFT.3. Calculate M = N − (Q − 1).4. Take the first M samples of x[n] and insert

Q − 1 zeros before them to create x1[n].5. Perform an N -point FFT on x1[n] and

multiply by the N -point FFT of h[k]calculated in step 2. Discard the first Q − 1samples of the inverse FFT of the product toform the first output block y1[n].

Page 6: Fast Convolution using the FFT

Overlap-and-save method

The DFT andConvolution

Fast ConvolutionThe overlap-savemethodOverlap-and-savemethodOverlap-and-savemethod

6 / 6

6. Then attach the last Q − 1 samples of x1[n]to the beginning of the next block of lengthM of the original x[n] sequence to create anew N -point FFT input sequence x2[n].

7. Take the N -point FFT of x2[n], and multiplyby the N -point FFT of h[n]. Take the inverseFFT of the resulting product, and discard thefirst Q − 1 samples of this inverse FFT toobtain the next M -point output block y2[n].

8. Repeat steps 6 and 7 until we have gonethrough all of x[n].

9. Concatenate y1[n], y2[n], ... to form the finaloutput y[n].