Zero-Padding Position for FFT
이전 댓글 표시
Hi,
I have a time-domain signal x with 5000 samples with period T, and it spans from -0.5*T to +0.5*T.
I want to compute an 8000-point FFT and I am confused about where I should add the zero-padding. Which of the following two methods is correct?
First:
x = [x; zeros(1, 3000)];
X = fftshift( fft( fftshift(x), 8000) );
Second:
x = [zeros(1, 1500); x; zeros(1, 1500)];
X = fftshift( fft( fftshift(x), 8000) );
Thanks!
채택된 답변
추가 답변 (1개)
If you only care about the amplitude spectrum the shifts don't really matter, but otherwise, you would do,
n=floor(numel(x)/2)+1; %location of the signal origin
x(end+1:8000)=0; %zero pad to 8000
xs=circshift(x, 1-n); %shift so that signal origin is at xs(1)
X = fftshift( fft( xs ) ); %transform
카테고리
도움말 센터 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!










