02.10.2019 Views

UploadFile_6417

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The Fast Fourier Transform 199<br />

computing platform used to execute the MATLAB script. The plot in Figure 5.22<br />

was obtained on a 33 MHz 486 computer. It shows that for low values of L<br />

the linear convolution is faster. The crossover point appears to be L = 50,<br />

beyond which the linear convolution time increases exponentially, while the<br />

high-speed convolution time increases fairly linearly. Note that since N =2 ν ,<br />

the high-speed convolution time is constant over a range on L.<br />

□<br />

5.6.5 HIGH-SPEED BLOCK CONVOLUTIONS<br />

Earlier we discussed a block convolution algorithm called the overlap-andsave<br />

method (and its companion the overlap-and-add method), which is<br />

used to convolve a very large sequence with a relatively smaller sequence.<br />

The MATLAB function ovrlpsav developed in that section uses the DFT<br />

to implement the linear convolution. We can now replace the DFT by the<br />

radix-2 FFT algorithm to obtain a high-speed overlap-and-save algorithm.<br />

To further reduce the computations, the FFT of the shorter (fixed) sequence<br />

can be computed only once. The following hsolpsav function<br />

shows this algorithm.<br />

function [y] = hsolpsav(x,h,N)<br />

% High-speed Overlap-Save method of block convolutions using FFT<br />

% --------------------------------------------------------------<br />

% [y] = hsolpsav(x,h,N)<br />

% y = output sequence<br />

% x = input sequence<br />

% h = impulse response<br />

% N = block length (must be a power of two)<br />

%<br />

N = 2^(ceil(log10(N)/log10(2));<br />

Lenx = length(x); M = length(h);<br />

M1 = M-1; L = N-M1; h = fft(h,N);<br />

%<br />

x = [zeros(1,M1), x, zeros(1,N-1)];<br />

K = floor((Lenx+M1-1)/(L)); % # of blocks<br />

Y = zeros(K+1,N);<br />

for k=0:K<br />

xk = fft(x(k*L+1:k*L+N));<br />

Y(k+1,:) = real(ifft(xk.*h));<br />

end<br />

Y = Y(:,M:N)’; y = (Y(:))’;<br />

A similar modification can be done to the overlap-and-add algorithm.<br />

MATLAB also provides the function fftfilt to implement the overlapand-add<br />

algorithm.<br />

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).<br />

Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!