please let me know reference of this MATLAB code.
please explain this code line by line.
.
.
N=256; %% sampling number
n=linspace(0,1,N);
fs=1/(n(2)-n(1));
x=5*(sin((2*pi*10*n))); %% create signal
N=length(x);
f=[-fs/2:fs/N:fs/2-fs/N];
subplot(211)
plot(f,fftshift(abs(fft(x))));
title('|G(f)|');grid;
xlabel('frequency');
ylabel('|G(f)|');
%Zero padding
xx=[zeros(1,128) x zeros(1,128)];
N=length(xx);
f=[-fs/2:fs/N:fs/2-fs/N];
subplot(212)
plot(f,fftshift(abs(fft(xx))));
title('|Gz(f)|');grid;
xlabel('frequency');
ylabel('|Gz(f)|');