Exp 1 212
Exp 1 212
PROGRAM:
clc;
close all;
t=0:0.01:1;
y=sin(2*pi*t);
subplot(2,1,1);
plot(y);
axis tight;
xlabel('Angle');
ylabel('Amplitude');
title('SINE WAVE');
grid on;
subplot(2,1,2);
stem(y);
axis tight;
xlabel('Angle');
ylabel('Amplitude');
title('SINE SEQUENCE');
grid on;
OUTPUT:
2)GENERATION OF COSINE WAVE
PROGRAM:
clc;
close all;
t=0:0.01:1;
y=cos(2*pi*t);
subplot(2,1,1);
plot(y);
axis tight;
xlabel('Angle');
ylabel('Amplitude');
title('COSINE WAVE');
grid on;
subplot(2,1,2);
stem(y);
axis tight;
xlabel('Angle');
ylabel('Amplitude');
title('COSINE SEQUENCE');
grid on;
OUTPUT:
PROGRAM:
clc;
close all;
t=0:1:8;
y=t.*(t>=0);
subplot(2,1,1);
plot(t,y);
axis tight;
xlabel('time');
ylabel('Amplitude');
title('RAMP SIGNAL');
grid on;
subplot(2,1,2);
plot(t,y);
stem(t,y);
axis tight;
xlabel('Angle');
ylabel('Amplitude');
title('RAMP SEQUENCE');
grid on;
OUTPUT:
PROGRAM:
clc;
close all;
n=0:0.01:8;
y=square(2*pi*n);
plot(y);
axis tight;
xlabel('n,.....>');
ylabel('Amplitude');
title('Square sequence');
grid on;
OUTPUT:
PROGRAM:
clc;
clear ;
close all;
t=0:1:10;
a=0.5;
y1=exp(a*t);
subplot(2,1,1);
plot(t,y1);
axis tight;
xlabel('time');
ylabel('Amplitude');
title('EXPONENTIAL SIGNAL');
grid on;
subplot(2,1,2);
stem(t,y1);
axis tight;
xlabel('time');
ylabel('Amplitude');
title('EXPONENTIAL SEQUENCE');
grid on;
OUTPUT:
PROGRAM:
clc;
close all;
t=-1:1:6;
y1=(t>=0);
subplot(2,1,1);
plot(t,y1);
axis tight;
xlabel('time');
ylabel('Amplitude');
title('unit step');
grid on;
subplot(2,1,2);
stem(t,y1);
axis tight;
xlabel('time');
ylabel('Amplitude');
title('unit step sequence');
grid on;
OUTPUT:
PROGRAM:
clc;
close all;
t=-1:0.05:1;
y=(t==0);
subplot(2,1,1);
plot(t,y);
ylabel("Amplitude");
xlabel("Time");
title("UNIT IMPULSE SIGNAL");
subplot(2,1,2);
stem(t,y);
ylabel("Amplitude");
xlabel("n");
title("UNIT IMPULSE SEQUENCE");
OUTPUT:
EXPERIMENT 2
BASIC OPERATIONS ON SIGNALS AND SEQUENCE
1)PROGRAM FOR ADDITION AND MULTIPLICATION
clc;
clear;
close all;
t=0:0.01:5;
x1=t.*(t>=0);
x2=square(2*pi*t);
subplot(2,2,1);
plot(t,x1);
xlabel('time');
ylabel('amplitude');
title('input signal 1');
subplot(2,2,2);
plot(t,x2);
xlabel('time');
ylabel('amplitude');
title('input signal 2');
% ADDITION
y1=x1+x2;
subplot(2,2,3);
plot(t,y1);
xlabel('time');
ylabel('amplitude');
title('Addition of signals');
grid on;
% MULTIPLICATION
y2=x1.*x2;
subplot(2,2,4);
plot(t,y2);
xlabel('time');
ylabel('amplitude');
title('Multiplication of signals');
grid on;
OUTPUT:
OUTPUT: