Upload
maryelle-tulod
View
3
Download
0
Tags:
Embed Size (px)
DESCRIPTION
dsp
Citation preview
Yrureta, Rodney Gian R. [email protected] [email protected]
Tulod, Maryelle [email protected]
26
ECE107L-B12
Here is PDS for Expt. 2. Submit report on Tuesday. Thanks!
Drill 2
1. Aa. Fs=8000;
t=[0:127]/Fs;y=0.8*sin(2*pi*2000*t);figure(1);plot(t,y)
0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
b. Fs2=6000;t2=[0:127]/Fs2;y2=0.8*sin(2*pi*2000*t2);figure(2);plot(t2,y2);
0 0.005 0.01 0.015 0.02 0.025-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
Fs3=4050;t3=[0:127]/Fs3;y3=0.8*sin(2*pi*2000*t3);figure(3);plot(t3,y3);
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
Fs4=3900;t4=[0:127]/Fs4;y4=0.8*sin(2*pi*2000*t4);figure(4);plot(t4,y4);
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
Is there a change in the output waveform? __YES____
Explain:
By changing the sampling frequency resulted in a change in the value of the period of the output waveform.
c. fs=1000; t=[0:1/fs:0.249]; y=exp(-t/0.050); figure(6);plot(t,y);
0 0.05 0.1 0.15 0.2 0.250
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
fs = 8000;t = [0:127]/fs;y = 0.8*sin(2*pi*2000*t);length(y);fs2=1000t=[0:1/fs2:0.249];y2 = exp(-t/0.05);length(y2)y(1,250) = 0;yt = y.*y2;figure(7); plot(t,yt);
0 0.05 0.1 0.15 0.2 0.25-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
Describe:Combining the sinusoidal signal in 1a and the decaying signal in 1c resulted on the mixed signal decaying until it reaches zero (0).
% Incomplete description
2.a. FS=8000;
T=[0:299]/FS;Y=2*sin(2*pi*75*T);figure(7);plot(T,Y);
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
b. Y2=2*(1/2)*sin(2*pi*75*T*2); Y3=2*(1/3)*sin(2*pi*75*T*3); Y4=2*(1/4)*sin(2*pi*75*T*4); Y5=2*(1/5)*sin(2*pi*75*T*5); Y6=2*(1/6)*sin(2*pi*75*T*6);Y7=2*(1/7)*sin(2*pi*75*T*7); Y8=2*(1/8)*sin(2*pi*75*T*8);Y9=2*(1/9)*sin(2*pi*75*T*9); Y10=2*(1/10)*sin(2*pi*75*T*10);i=Y+Y2+Y3+Y4+Y5+Y6+Y7+Y8+Y9+Y10; figure(8);plot(T,i);
% Incomplete Output for the no. of signals added
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04-4
-3
-2
-1
0
1
2
3
4
Describe:The waveform looks like a triangular waveform but it is made up of sinusoids
c. Y11=2*(1/11)*sin(2*pi*75*T*11);>> k=13;>> Y13=2*(1/k)*sin(2*pi*75*T*k);>> k=15;>> Y15=2*(1/k)*sin(2*pi*75*T*k);>> k=17;>> Y17=2*(1/k)*sin(2*pi*75*T*k);>> k=19;>> Y19=2*(1/k)*sin(2*pi*75*T*k);>> j=Y+Y3+Y5+Y7+Y9+Y11+Y13+Y15+Y17+Y19;>> figure(9);plot(T,j);
% Incomplete Output for the no. of signals added
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
Describe:The peak of the larger sinusoid looks like it also has a sinusoid in it.
d. k=1;m=((k-1)/2)^2;Y=(((-1)^m)/k^2)*2*sin(2*pi*75*T*k);
k=3;m=((k-1)/2)^2;Y3=(((-1)^m)/k^2)*2*sin(2*pi*75*T*k);k=5;m=((k-1)/2)^2;Y5=(((-1)^m)/k^2)*2*sin(2*pi*75*T*k);k=7;m=((k-1)/2)^2;Y7=(((-1)^m)/k^2)*2*sin(2*pi*75*T*k); k=9;m=((k-1)/2)^2;Y9=(((-1)^m)/k^2)*2*sin(2*pi*75*T*k);k=11;m=((k-1)/2)^2;Y11=(((-1)^m)/k^2)*2*sin(2*pi*75*T*k); k=13;m=((k-1)/2)^2;Y13=(((-1)^m)/k^2)*2*sin(2*pi*75*T*k);k=15;m=((k-1)/2)^2;Y15=(((-1)^m)/k^2)*2*sin(2*pi*75*T*k); k=17;m=((k-1)/2)^2;Y17=(((-1)^m)/k^2)*2*sin(2*pi*75*T*k);k=19;m=((k-1)/2)^2;Y19=(((-1)^m)/k^2)*2*sin(2*pi*75*T*k);o=Y+Y3+Y5+Y7+Y9+Y11+Y13+Y15+Y17+Y19;figure(10);plot(T,o);
% Incomplete Output for the no. of signals added
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04-2.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
2.5
Describe:The waveform is a triangular waveform.
3.a. [x,y]=meshgrid(-3*pi:0.1:3*pi);
r=sqrt(x.^2+y.^2);z=(sin(r))./r;plot3(x,y,z);
-10-5
05
10
-10
-5
0
5
10-0.5
0
0.5
1
Describe:The waveform looks like a steep mountain that has a valley surrounding it.
b. contour3(x,y,z,30);
-5
05
-5
0
5
-0.5
0
0.5
1
Describe:The waveform kind of looks like a sombrero hat of the mexican people.
c.i. z=cplxgrid(30);
x=(z.^5).^(1/8); cplxmap(z,x);
-1-0.5
00.5
1
-1
-0.5
0
0.5
10
0.2
0.4
0.6
0.8
1
Describe:The waveform looks like a funnel or a burrito wrapper of the Mexican people.
ii. x=atan(2*z);