MATLAB: Remove zeros from sinc function

removing zeros from the sinc function

Hi there,
I am trying to observe the behaviour of the fourier trasform of the sinc function if some of its zeros will be removed. Normally, the sinc function will lead us to rectanglular function in fourier domain, but when I am trying to remove the zeros at 'pi' it is not showing anything due to NaN or infinite. May I request you to pls tell me how to deal with such problem?
Fs=42;Ts=1/Fs;
t=-1:Ts:40*Ts-Ts;
f=5;
y=sinc(t*f)/(1-5*t/(0.9)*pi);
figure;
plot(t,y);
xlabel('x');
ylabel(' magnitude');
fy=fft(y);%figure;
% plot(fy)
fy = fftshift(fy);figure;
plot([abs(fy)])%;angle(fy);real(fy);imag(fy)]','*')

Best Answer

clearvars; close all
Fs=42;Ts=1/Fs;
t=-1:Ts:1;
f=5;
y=sinc(t*f)./(1-5*t/(0.9)*pi);
figure;
plot(t,y), xlabel('t'), ylabel(' y(t)'); title('Time domain analysis ')
L = length(t); Nblock = 256;
Y = fft(y, Nblock)/L;
f = Fs/2*linspace(0,2, Nblock/2+1);
figure;
plot(f, 2*abs(Y(1:Nblock/2+1))), title('Discrete FFT')
fY = fftshift(Y);figure;
plot(f, 2*abs(fY(1:Nblock/2+1))), title('Shift zero frequency')
figure, plot([angle(fY);real(fY);imag(fY)]','*')
title('Phase angle, Real & Imag components of Shift zero frequency')