Professional Documents
Culture Documents
Lab 6
Lab 6
Lab task 6
Delay distortion:
Change in shape of a signal
Take any 3 components of a square wave in task 1
and do it manually
compare it will be different
y1=(4*A/pi)*sin(2*pi**f*t);
Y2=(4*A/(3*pi))*sin(2*pi*3*f*t+pi/4);
Y3=(4*A/(5*pi))*sin(2*pi*5*f*t-pi/6);
Y=y1+y2+y3;
Subplot(2,1,2);
Plot(t,y)
Lab task 7:
Matlab codes that circulates amount of attenuation if
signal amplitude is reduced to ½ of original amplitude.
Some commands before performing this lab to
understand it.
4sin(wt)(p1)……………..its half is 2sin(wt)(p2)
Attenuation=10log(p2/p1)
P=1/N∑(n=0 to N=1) |x[n]|^2
Now how to insert it in Matlab?
=sum(x.*xconj(x)/length(x))
Let x=[1 2 3]
X^2=]1 4 9]
x.*x=element to element multiplication
sum(x)=summation=6
x.*x=[1 4 9]
let x= 2+5j
x*conj(x)=2^2+5^2
Now coming to our programe:
t=linespace(0,4*pi,1000);
f=0.1;
x=4*sin(2*pi*f*t);
p1=sum(x.*xconj(x)/length(x));
x2=2sin(2*pi*f*t);
p2=sum(x2.*x2conj(x2))/length(x2));
att=10log(p2/p1);
power will be negative
if A varies ¼ p=-6db
A=1/8 p=-9db