clc;
clear all;
close all;

% Parameters
f1=300;
f2=300;
N=128;
n=0:N-1;
A=1;
fs=1000;

y1=A*sin(2*pi*f1*n/fs);
y2=A*cos(2*pi*f2*n/fs);

figure;

subplot(2,1,1);
stem(n,y1);
xlabel('n');
ylabel('Amplitude');
title('Discrete Time Sinusoidal Signal');
grid on;

subplot(2,1,2);
stem(n,y2);
xlabel('n');
ylabel('Amplitude');
title('Discrete Time Cosine Signal');
grid on;

% Invisible axes for heading
axes('Position',[0 0 1 1],'Visible','off');
text(0.5,0.98,'Student Name & Roll No: M. Pavan Kumar (24A51A04T8)',...
    'HorizontalAlignment','center','FontWeight','bold','FontSize',10);

text(0.5,0.95,'Experiment: Generation of Discrete-Time Sinusoidal and Cosine Signals',...
    'HorizontalAlignment','center','FontWeight','bold','FontSize',10);

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: