Consider the rectangular pulse given by pnl N lessthanorequa
Consider the rectangular pulse given by p(n)=l, -N lessthanorequalto n lessthanorequalto N, and 0 otherwise. Sketch its Fourier transform for -pi lessthanorequalto w lessthanorequalto pi when N = 5, 15, 25 and 100. Comment on the behavior of these plots as a function of N. What would happen when N rightarrow infinity?
Solution
The Fourier transform of rectangular Pulse=snc(w)
matlab code:
Fs=100; % Sampling frequency
t=-5:1/Fs:5;%N=5
y=zeros(size(t));
% Rectangular pulse
for n=1:length(t)% for N=5
if t(n)>-5 && t(n)<5
y(n)=1;
end
end
figure(1)
plot(t,y)
grid on,
L=length(y);
N=ceil(log2(L));
fy=fft(y,2^N)/(L/2);
f=(Fs/2^N)*(0:2^(N-1)-1);
figure(2)
plot(f,abs(fy(1:2^(N-1))));
G=sinc(pi*f);%Mathematicaly the Fourier transform of rectancular signal is sinc pulse
figure(2)
plot(f,G)
