clc;
clear all;
close all;

% Generation of Sine Wave 1
N = 101;
n = 0:N-1;
xout1 = sin(0.02*pi*n);

figure;

subplot(3,1,1);
plot(n,xout1,'b','LineWidth',1.5);
grid on;
ylabel('xout1(n)');
title('Sine Wave 1');

% Generation of Sine Wave 2
xout2 = sin(0.04*pi*n);

subplot(3,1,2);
plot(n,xout2,'r','LineWidth',1.5);
grid on;
ylabel('xout2(n)');
title('Sine Wave 2');

% Generation of Sum of Sine Waves
xout = xout1 + xout2;

subplot(3,1,3);
plot(n,xout,'k','LineWidth',1.5);
grid on;
xlabel('n');
ylabel('xout(n)');
title('Sum of Signals');

% Student Details Annotation
annotation('textbox',[0.15 0.94 0.8 0.05],...
    'String',{'Student Name & Roll No: M. Pavan Kumar (24A51A04T8)',...
              'Experiment: Generation of Sum of Sine Waves'},...
    'EdgeColor','none',...
    'HorizontalAlignment','center',...
    'FontSize',10,...
    'FontWeight','bold');

Embed on website

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