% Sinc priodico pari
% Author: C. Prati
% 21-3-2025
clear
close all
% N dispari =11
N=11;
f=(-4.005:.01:4.005);
Y=sin(pi*N*f)./sin(pi*f);
figure(1)
subplot(211)
plot(f,Y)
ylim;
axis([-4 4 ylim])
title('Sinc periodico con N dispari')
pause
X=Y.^2;
figure(1)
subplot(212)
plot(f,X,'r')
ylim;
axis([-4 4 ylim])
grid
title('Sinc periodico al quadrato con N dispari')
pause
y=zeros(2*N-1,1);
y((N+1)/2:2*N-(N+1)/2)=1;
figure(2)
subplot(211)
stem((-(N-1):(N-1)),y,'filled')
pause
subplot(212)
yy=ones(N,1);
x=conv(yy,yy);
stem((-(N-1):(N-1)),x,'filled','r')
pause
% --------------------------------------------------------------------------
% Sinc pari
%---------------------------------------------------------------------------
clear
close all
% N spari =10
N=10;
f=(-4.005:.01:4.005);
Y=sin(pi*N*f)./sin(pi*f);
figure(1)
subplot(211)
plot(f,Y)
ylim;
axis([-4 4 ylim])
title('Sinc periodico con N pari')
pause
X=Y.^2;
figure(1)
subplot(212)
plot(f,X,'r')
ylim;
axis([-4 4 ylim])
grid
title('Sinc periodico al quadrato con N spari')
pause
M=2*N-1;
y=zeros(2*M-1,1);
y((M+1)/2:2:2*M-(M+1)/2)=1;
figure(2)
subplot(211)
stem((-(M-1):(M-1)),y,'filled')
pause
subplot(212)
yy=zeros(M,1);
yy(1:2:M)=1;
x=conv(yy,yy);
stem((-(M-1):(M-1)),x,'filled','r')
