LABORATORIO DE INTRODUCCION A LAS TELECOMUNICACIONES
PRACTICA N 2
TEMA 1: DESARROLLO DE LA SERIE DE FOURIER
Alumno: Libia Benacir Romero Escobedo
Cdigo: 11190110
Horario: Lunes 10-1 pm
I. OBJETIVO:
Haciendo uso de MATLAB, verificar la serie trigonomtrica y exponencial de Fourier y desarrollar los ejercicios propuestos en el cuestionario:
II. PROCEDIMIENTO:
1. Desarrolle la serie trigonomtrica de Fourier de la funcin:
() = {, 0
, 2
Grafique la serie de Fourier f(t), en MATLAB:
SOLUCION
La funcin f(t) es una funcin impar cuya serie trigonomtrica de Fourier es:
() = (4
) [sin + (
1
3) sin 3 + (
1
5) sin 5 + ]
Fs=1000;
t=(1:100)/Fs;
w=2*pi*10;
f=(8/pi)*(sin(w*t)+(1/3)
*sin(3*w*t)+(1/5)*sin(5*w*t)+(1/7)
*sin(7*w*t)+(1/9)*sin(9*w*t));
plot(t,f)
grid
2. Desarrolle la siguiente serie trigonomtrica de Fourier, para:
() = {, /2 /2
, /2 3/2
SOLUCION:
Dado que f(t) = funcin par cuya serie trigonomtrica de Fourier est dada por:
() = (4
) [cos (
1
3) cos 3 + (
1
5) cos 5 (
1
7) cos 7 + (1/9)cos (9)]
Fs=1000; t=(1:100)/Fs; w=2*pi*10; f=(8/pi)*(cos(w*t)-(1/3)*cos(3*w*t)+(1/5)*cos(5*w*t)-(1/7)*cos(7*w*t)+(1/9)*cos(9*w*t)-(1/11)*cos(11*w*t)-(1/13)*cos(13*w*t)); plot(t,f) grid
3. De acuerdo al problema 2, la expresin general de la serie trigonomtrica de Fourier para funcin f(t) par, esta dado por:
() = (4
) (
1
) sin (
2) cos
Desarrolle mediante la instruccin de control de flujo FOR del Matlab:
SOLUCION:
Fs=100; t=(-100:100)/Fs;
w=2*pi; A=2; f=0; for n=1:1000;
f=f+(4*A/(n*pi))*(sin(n*0.5*pi))*cos(n*w*t); end; plot(t,f) xlabel('t(seg)') ylabel('AMPLITUD') title('FUNCION PAR ONDA CUADRADA') grid
CUESTIONARIO FINAL TEMA 1
1. Dada la expresin de la serie de Fourier trigonomtrica, desarrolle la grfica de f(t). Usando el criterio del problema 3.
Dada la serie:
() =
2 (
1
) sin(0) . () = (0,1).
Fs=100; t=Fs\(-100:100); w=1; A=2; f=0 for n=1:1000; f=f+2\A-((n\1)*sin(n*w*t)); end; plot(t,f) xlabel('t(seg)') ylabel('AMPLITUD') title('FUNCIN') grid
2. Desarrolle la exponencial de Fourier, si () = sin() en el intervalo (0,1). Grafique la S.E.F.
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1998
998.5
999
999.5
1000
1000.5
1001
1001.5
1002
t(seg)
AM
PLIT
UD
S.T.F de la funcion impar
fs=100; t=(0:100)/fs; w=2*pi; A=4; f=(A/(2*j))*(exp(j*pi*t)); plot(t,f); xlabel('tiempo(seg)') ylabel('ampitud') title('Forma exponencial de la funcin Seno')
3. Programa en Matlab la siguiente serie trigonomtrica.
() = (4
()2) cos() ; =
Fs=100; t=Fs\(-100:100); w=1; A=2; f=0 for n=0:1000;
f=f+((((2*n+1)*pi)^2)\(4*A)*cos(n*w*t)); end; plot(t,f) xlabel('t(seg)') ylabel('AMPLITUD') title('FUNCIN DE ONDA TRIANGULAR') grid
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
tiempo(seg)
am
plit
ud
Forma exponencial de la funcin Seno
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 10.82
0.84
0.86
0.88
0.9
0.92
0.94
0.96
0.98
1
t(seg)
AM
PLIT
UD
FUNCIN DE ONDA TRIANGULAR
4. Grafique la serie exponencial de Fourier de la funcin () = . 2 en t
[0,1].
Fs=100; t=(-100:100)/Fs; w=2*pi; A=1; f=0; for n=-300:300;
f=f+(A/(2*pi*n*j+2))*0.865*exp(2*pi*n*t*j); end; plot(t,f) xlabel('tiempo (seg)') ylabel('Amplitud') title('Serie exponencial de Fourier de la funcin')
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 10.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
tiempo (seg)
Am
plit
ud
Serie exponencial de Fourier de la funcin
TEMA 2: DESARROLLO DE LA TRASFORMADA RAPIDA DE FOURIER
I. OBJETIVO:
Haciendo uso de MATLAB, desarrollar la transformada de funciones no peridicas y la transformada rpida de Fourier FFT de seales muestreadas y mostrar las grficas correspondientes en el dominio del tiempo y la frecuencia.
II. PROCEDIMIENTO:
1. Desarrolle la transformada de Fourier usando Matlab cuya expresin es:
N=128; t=linspace(0,3,N); f=2*exp(-20*t); figure(1) plot(t,f) xlabel('Time,seg'), ylabel('f(t)'), grid axis([0 0.3 0 2]); Ts=(2)-t(1);
Ws=2*pi/Ts; F=fft(f); Fp=F(1:N/2+1)*Ts; W=Ws*(0:N/2)/N; figure(2) plot(W,abs(Fp),'+') xlabel('frequency,Rad/s'), ylabel('|F(W)|')
2. Desarrolle la grfica de la transformada de Fourier desarrollada:
N=128; t=linspace(0,3,N); Ts=t(2)-t(1); Ws=2*pi/Ts; W=Ws*(0:N/2)/N; Fa=2./(20+j*W); figure(3) plot(W,abs(Fa)) xlabel('frequency,Rad/s'), ylabel('|F(W)|')
3. Desarrolle la transformada rpida de Fourier de una seal muestreada
() = () (
2
4) = 0,1,2,3,
Cuyo desarrollo est dado por el siguiente programa:
m=[0,1,2,3,4,5]; Xn=[1,2,3,4,5,6]; Xk=fft(Xn); Xmag=abs(Xk); Xphase=angle(Xk); figure(1) plot(m,Xmag),axis([0 5 0 23]); figure(2) Stem(m,Xmag) figure(3) Stem(m,Xphase)
4. Para la suma de dos seales senoidales contaminado con ruido desarrolle la grfica en el dominio del tiempo y su respectiva grafica de Fourier.
t=0:0.001:0.6; x=sin(2*pi*50*t)-sin(2*pi*120*t); y=x+2*randn(size(t)); figure(4) plot(y(1:50)) Y=fft(y,512); Pyy=Y.*conj(Y)/512; f=1000*(0:255)/512; figure(5) plot(f,Pyy(1:256))
5. Desarrolle la transformada de Fourier de la suma de tres seales senoidales:
Fs=100; t=(1:100)/Fs;
s1=5*sin(2*pi*t*5);s2=10*sin(2*pi*t*15);s3=7*sin(2*pi*t*30) s=s1+s2+s3; figure(1) plot(t,s); S=fft(s,512); w=(0:255)/256*(Fs/2); figure(2) plot(w,abs([S(1:256)]));
6. Desarrolle la grafica de la transformada de la funcin de muestreo Sa(x):
fplot('6*sin(x)./x',[-30 30 -.2 6]) title('fplot of f(x)=5.sin(x)/x') xlabel('x') ylabel('f(x)')
CUESTIONARIO FINAL TEMA 2
1. Desarrolle la transformada rpida de Fourier de la funcin Sa(t).
N=1000; t=linspace(-30,30,N); f=sin(t)./t; figure(1) plot(t,f) axis([-30 30 0 1.5]) title('Funcion
Sampling');xlabel('time(seg)'),ylabel('amplitud'),grid grid Ts=t(2)-t(1); Ws=2*pi/Ts; F=fft(f); Fp=F(1:N/2+1)*Ts; W=Ws*(0:N/2)/N; figure(2) plot(W,abs(Fp)) axis([0 3 0 3.5]); xlabel('Frequency'),ylabel('|F(W)|');
2. Si () = ( + )/2 . Determine su
transformada rpida de Fourier.
t=0:0.01:3; w=2*pi; A=5; f=A*cos(w*t); figure (1) plot(t,f) title('Funcin cosenoidal en funcin del tiempo') xlabel('tiempo (seg)')
-30 -20 -10 0 10 20 300
0.5
1
1.5Funcion Sampling
time(seg)
am
plit
ud
0 0.5 1 1.5 2 2.5 30
0.5
1
1.5
2
2.5
3
3.5
Frequency
|F(W
)|
0 0.5 1 1.5 2 2.5 3-5
-4
-3
-2
-1
0
1
2
3
4
5Funcin cosenoidal en funcin del tiempo
tiempo (seg)
f(t)
ylabel('f(t)') L=length(f); NFFT = 2^nextpow2(L); Y = fft(f,NFFT)/L; f = Fs/2*linspace(0,1,NFFT/2+1); figure (2) plot(f,2*abs(Y(1:NFFT/2+1))) title('Y en funcin de w') xlabel('Frecuencia (rad por seg)') ylabel('|Y(f)|')
3. Dado () = sin . Desarrolle su transformada rpida de Fourier.
t=0:0.01:3; w=2*pi; A=5; f=A*sin(w*t); figure (1) plot(t,f) title('Funcin senoidal en funcin del tiempo') xlabel('tiempo (seg)') ylabel('f(t)') L=length(f); NFFT = 2^nextpow2(L);
Y = fft(f,NFFT)/L; f = Fs/2*linspace(0,1,NFFT/2+1); figure (2) plot(f,2*abs(Y(1:NFFT/2+1))) title('Y en funcin de w') xlabel('Frecuencia (rad por seg)') ylabel('|Y(f)|')
4. Desarrolle la transformada de Fourier de la seal muestreada m=[0,1,2,3] y Xm=[2,3,4,5].
m=[0,1,2,3];
0 0.5 1 1.5 2 2.5 3-5
-4
-3
-2
-1
0
1
2
3
4
5Funcin sinusoidal en funcion del tiempo
tiempo (seg)
f(t)
0 5 10 15 20 25 30 35 40 45 500
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5Y en funcin de w
Frecuencia (rad por seg)
|Y(f
)|
0 5 10 15 20 25 30 35 40 45 500
1
2
3
4
5
6Y en funcin de w
Frecuencia (rad por seg)
|Y(f
)|
Xm=[2,3,4,5]; Xk=fft(Xm); Xmag=abs(Xk); Xphase=angle(Xk); figure(1) plot(m,Xmag) xlabel('tiempo (seg)') ylabel('magnitud') title('Seal de Magnitud vs tiempo continuo') axis([0,5,0,23]); figure(2) stem(m,Xmag) xlabel('tiempo (seg)') ylabel('magnitud') title('Seal de Magnitud vs tiempo discreto') figure (3) stem(m,Xphase) xlabel('tiempo (seg)') ylabel('fase') title('Seal de Fase vs tiempo')
0 0.5 1 1.5 2 2.5 30
2
4
6
8
10
12
14
tiempo (seg)
magnitud
Seal de Magnitud vs tiempo discreto
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50
5
10
15
20
tiempo (seg)
magnitud
Seal de Magnitud vs tiempo continuo
0 0.5 1 1.5 2 2.5 3-3
-2
-1
0
1
2
3
4
tiempo (seg)
fase
Seal de Fase vs tiempo