Fs = 150; % Sampling frequency
t = 0:1/Fs:1; % Time vector of 1 second
f = 5; % Create a sine wave of f Hz.
x = sin(2*pi*t*f);
y = sin(2*pi*t*f);
nfft = 1024; % Length of FFT
X = fft(x,nfft);
Y = fft(y,nfft);
Z= CCONV(X,Y,size(X,2));
X = X(1:nfft/2);
Y = Y(1:nfft/2);
Z= Z(1:nfft/2);
mx = abs(X);
my = abs(Y);
mz=abs(Z);
f = (0:nfft/2-1)*Fs/nfft;
figure(1);
plot(t,x);
figure(2);
plot(t,y);
% plotting both sine waves of 5KHz
figure(3);
plot(f,mx);
figure(4);
plot(f,my);
figure (5);
plot(f,mz);
%plotting their spectrum