Zero Padding Problem with FFT Square Wave Pulse

조회 수: 6 (최근 30일)
Matt
Matt 2012년 6월 28일
Hi,
I'm trying to smoothen out the sinc pulse response that I get from the fft of a rectangular pulse. I thought that zero padding should help me to do this but I still end up with a sharp/pointy pulse after everything. Any help would be greatly appreciated.
Lamda1 = .003;
N = 8*pi./Lamda1;
Step1 = .05;
A1 = [-N/2:Step1:(N/2)-Step1];
R1 = zeros(size(A1));
R1(A1>(-N/4)& A1<(N/4)-Step1) = 1;
figure (1); plot(A1,R1)
FD1 =fft(R1)/N;
figure (2); plot(abs(FD1))
figure (3); plot(abs(fftshift(FD1)))
  댓글 수: 2
Honglei Chen
Honglei Chen 2012년 6월 28일
Could you clarify a little more? I don't know what you mean by smoothen out the sinc pulse response. The reason you see a pulse is because your sample rate is very high. You can try to increase Step1 and decrease Lamda1 and see if that's what you want.
Matt
Matt 2012년 6월 29일
I create the square pulse. No problems there.
The problem occurs when I look at the fft outputs. When I zoom in on Figure (3), the sinc pulse doesn't have the typical sinusoidal curvature. It is pointy, slightly triangular...
I think I need to pad the R1 with more zeros, I just don't know how to do that... I can't really change the limits of A1.
Do you know if the R1 = zeros ((size (A1)); function is correct?
Thanks.

댓글을 달려면 로그인하십시오.

답변 (1개)

Honglei Chen
Honglei Chen 2012년 6월 29일
R1 is correct. If all you want is to do zero padding and then FFT, you can do it by specifying the number of FFT points in fft() function. For example
FD1 = fft(R1,nextpow2(numel(R1)))

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by