How can Overlap-add technique be done
조회 수: 12 (최근 30일)
이전 댓글 표시
Hi:), I would like to perform the overlap-add technique but it seems to have errors. any ideas
load handel
N=length(y);
L=8192;
b=[0.2];
a=[1 -0.8];
[hn,t]=impz(b,a);
M=length(hn);
Nx=floor((N+M-1-1))/(L)
H = fft(hn,N) %% (zero-padded FFT)
i = 1
while i <= Nx
il = min(i+L-1,Nx)
wt = ifft( fft(y(i:il),N) .* H, N);
k = min(i+N-1,Nx);
w(i:k) = w(i:k) + wt ; %%(add the overlapped output blocks)
i = i+L;
end
댓글 수: 2
Walter Roberson
2012년 12월 17일
What errors do you perceive?
Note: you might want to consider using "for" instead of "while"
채택된 답변
Walter Roberson
2012년 12월 17일
Initialize your matrix w, with
w = zeros(1,Nx);
before you start the loop.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!