Professional Documents
Culture Documents
Register Number: Expt. No.: Name: Date: Slot: L49+50: All All
Register Number: Expt. No.: Name: Date: Slot: L49+50: All All
:
Name: Date:
Slot: L49+50
GENERATION OF SIGNALS
AIM:
APPARATUS REQUIRED:
MATLAB PROGRAM:
n=-20:20;
u=[zeros(1,20),1,ones(1,20)];
stem(n,u);
3. RAMP SIGNAL
n=-10:10;
z=[zeros(1,11),1:10];
axis([-10 10 0 11]);
title('ramp');
n=0:10;
a=2;
x=a.^n;
stem(n,x);
n=0:10;
a=0.5;
x=a.^n;
stem(n,x);
6. SINUSOIDAL SIGNAL
t=0:0.1:20;
x=3*sin(t);
7. TRIANGULAR SIGNAL
a=2;
x1=1-abs(t)/a;
x2=0;
x=x1.*(abs(t)<=a)+ x2.*(abs(t)>a);
a=2;
x=exp(-a.*(t.^2));
9. PARABOLIC SIGNAL
a=0.4;
x1=(a*(t.^2))/2;
x2=0;
x=x1.*(t>=0)+ x2.*(t<0);
RESULT:
INFERENCE:
REFERENCES:
OUTPUT:
CONVOLUTION OF SIGNALS
AIM:
To write a program for performing linear and circular convolutions of two signals using
MATLAB R2017b.
APPARATUS REQUIRED:
LINEAR CONVOLUTION:
MATLAB PROGRAM:
LINEAR CONVOLUTION
clc;
clear all;
close all;
x=input('samples of x(n)');
h=input('samples of h(n)');
xlen= length(x);
hlen=length(h);
k=0;
for i=1:xlen;
for j=1:hlen;
y(i,j+k) = x(i)*h(j);
end
k=k+1;
end;
disp('conv');
z=sum(y);
stem(z);
RESULT:
INFERENCE:
REFERENCES:
OUTPUT:
CORRELATION OF SIGNALS
AIM:
To write a program for performing correlation of two signals using MATLAB R2017b.
APPARATUS REQUIRED:
AUTO-CORRELATION:
CROSS-CORRELATION:
2. Generate the output sequence of the given two input signals using ‘corr’ command.
MATLAB PROGRAM:
CROSS CORRELATION:
clc;
clear all;
x=input('enter samples of x');
h=input('enter samples of h');
xlen=length(x);
hlen=length(h);
for i=1:xlen;
for j=1:xlen;
y(i,i+j-1)=x(i)*h(hlen-j+1);
end
end
z=sum(y);
disp('output');z
disp('output sequence');y
stem(x,y);
AUTO CORRELATION:
INFERENCE:
REFERENCES:
OUTPUT: