Overlap–add method: Difference between revisions

Content deleted Content added
Line 56:
 
'''Algorithm 1''' (''OA for linear convolution'')
Evaluate the best value of N and L (L>0, N = M+L-1 nearest to power of 2).
Nx = length(x);
H = FFT(h,N) <span style="color:green;">(''zero-padded FFT'')</span>
i = 1
y = zeros(1, M+Nx-1)
'''while''' i <= Nx <span style="color:green;">(''Nx: the last index of x[n]'')</span>
il = min(i+L-1,Nx)
yt = IFFT( FFT(x(i:il),N) * H, N)
k = min(i+N-1,M+Nx-1)
y(i:k) = y(i:k) + yt(1:k-i+1) <span style="color:green;">(''add the overlapped output blocks'')</span>
i = i+L