Professional Documents
Culture Documents
MATLAB nos permite analizar seales analgicas. Esto se debe a que la forma natural
de representar una seal en MATLAB es definir una secuencia finita de valores mediante
un vector fila. Por tanto, siendo estrictos, en MATLAB toda seal es discreta en tiempo,
mientras que en amplitud puede ser discreta (cuantizada) o contina (aunque limitada por
la precisin de los tipos numricos). No obstante, si los intervalos temporales entre
valores son suficientemente pequeos y el rango temporal en el que se define la seal es
suficientemente amplio, la secuencia de valores empleada para representar la seal y las
operaciones realizadas para su anlisis proporcionan una buena aproximacin a los
resultados tericos. En el caso ms simple y frecuente, los valores se toman en instantes
equiespaciados, intervalo que no debe confundirse con el periodo de muestreo.
A partir de la serie de Fourier, es posible reconstruir una seal peridica. Cuanto mayor
sea el nmero de armnicos utilizado en el desarrollo en serie, mejor ser la
reconstruccin. Un parmetro importante en la reconstruccin de seales es la velocidad
de convergencia, o lo que es lo mismo, la velocidad con la que los coeficientes de Fourier
tienden a 0.
MATLAB est equipado con funciones especiales que nos van a permitir realizar un
anlisis de Fourier de funciones definidas por un conjunto de valores discretos. Por
ejemplo, el comando fft() nos permite obtener la transformada rpida de Fourier (fast
Fourier Transform) de una secuencia de nmeros definida por el vector x.
Por ejemplo:
>> X=fft(x);
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>> X=fft(x,N);
>> X=fftshift(X);
>> x=ifft(X)
IV. PROCEDIMIENTO
= + + + +
DETERMINE LAS RACES DEL POLINOMIO P MEDIANTE:
INFORME FINAL 2
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>> v=polyval(p,x);
>> plot(x,v),title('x^3+4x^2-7x-10'),xlabel('x')
INFORME FINAL 3
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>> y=sin(x);
>> plot(x,y)
INFORME FINAL 4
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
z=cos(x);
>> plot(x,z,x,y)
plot(x,y,x,y,'*')
plot(y,z)
plot(x,y,x,2*y.*z,'--')
INFORME FINAL 5
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>> grid
>> xlabel('Variable
independiente x')
>> title('2sen(x)cos(x)sen(2x)')
>> plot3(y,z,x),grid
La idea es multiplicar aquellos valores en un array que desea mantener por unos, y
multiplicar los otros valores por ceros.
x=linspace(0,16,100);
>> y=sin(x);
>> z=(y>=0).*y;
>> z=z+0.5*(y<0);
>> z=(x<=14).*z;
>> plot(x,z)
>>xlabel('x'),ylabel('z=f(x)')
>>title('Seal Discontinua')
x=linspace(0.6*pi,60);
>> y=sin(x);
>> z=cos(x);
>> plot(x,y)
>> hold on
>> plot(x,z,'m')
INFORME FINAL 6
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>>x=linspace(0,4*pi,60);
>>y=sin(x);
>>z=cos(x);
>>a=2*sin(x).*cos(x);
>>b=sin(x)./(cos(x)+eps);
>>subplot(2,2,1)
>>subplot(2,2,2)
>>subplot(2,2,3)
>>subplot(2,2,4)
V. CUESTIONARIO
GRAFICA DE FUNCIONES
TRIGONOMTRICAS
a)>> x=linspace(0,4*pi,60);
>> y=cos(x);
>> figure(1)
>> plot(x,y)
>> z=sin(x);
>> figure(2)
>> plot(x,z,x,y)
>> figure(3)
>> plot(x,y,x,y,'*')
INFORME FINAL 7
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>> plot3(y,z,x),grid
>> figure(4)
>> y=tan(x);
>> figure(1)
>> plot(x,y)
>> figure(5)
>> plot(x,y,x,2*y.*z,'--')
>> z=acos(x);
>> figure(2)
>> plot(x,z,x,y)
>> grid
>> title('2sen(x)cos(x)sen(2x)')
INFORME FINAL 8
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>> plot3(y,z,x),grid
>> figure(4)
a)>> x=linspace(0,20,200);
>> y=cos(x);
>> z=(y>=0).*y;
>> z=z+0.6*(y<0);
>> z=(x<=20).*z;
>> plot(x,z)
>> figure(5)
>> plot(x,y,x,2*y.*z,'--')
>> xlabel('x'),ylabel('z=f(x)')
b)>> x=linspace(0,10,150);
>> y=sin(x);
INFORME FINAL 9
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
b)x=linspace(0,8*pi,75);
>> y=sin(x);
>> z=cos(x);
>> plot(x,y)
>> hold on
>> plot(x,z,'m')
>> xlabel('x'),ylabel('z=f(x)')
MANIPULACIN DE GRFICOS:
a)>> x=linspace(0,7*pi,70);
>> y=cos(x);
>> z=sin(x);
>> plot(x,y)
>> plot(x,z,'m')
>> hold on
>> plot(x,z,'m')
SUBDIVISIN DE VENTANA DE
GRAFICAS (M,N,P)
a)>> X=linspace(0,5*pi,70);
>> y=sin(x);
>> z=cos(x);
>> a=2*sin(x).*cos(x);
>> b=sin(x)./(cos(x)+eps);
>> subplot(2,2,1)
INFORME FINAL 10
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>> subplot(2,2,4)
>> subplot(2,2,2)
>> subplot(2,2,3)
b)>> X=linspace(0,9*pi,90);
>> y=sin(x);
>> z=cos(x);
>> a=2*sin(x).*cos(x);
INFORME FINAL 11
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>> subplot(2,2,4)
>> subplot(2,2,2)
>> subplot(2,2,3)
INFORME FINAL 12
2. Explique las funciones de cada una de las principales instrucciones y
comandos utilizados en los ejercicios anteriores.
VI. CONCLUSIONES
Hemos comprendido que en matlab podemos trabajar con nmeros reales, as como
tambin se puede trabajar en funcin de nmeros complejos lo que es un gran
beneficio, ya que las seales reales se aproximan a valores con nmeros complejos
en gran parte.
II. PROCEDIMIENTO
, 0
() = {
, 2
SOLUCION
La funcin f(t) es una funcin impar cuya serie trigonomtrica de Fourier es:
4 1 1
() = ( ) [sin + ( ) sin 3 + ( ) sin 5 + ]
3 5
Programando para mostrar la grfica de la serie de Fourier:
>>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
INFORME FINAL 14
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
, /2 /2
() = {
, /2 3/2
SOLUCION:
Dado que f(t) = funcin par cuya serie trigonomtrica de Fourier est dada por:
4 1 1 1
() = ( ) [cos ( ) cos 3 + ( ) cos 5 ( ) cos 7 + (1/9)cos(9)]
3 5 7
Cuyo programa en Matlab es:
>>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));
>>plot(t,f)
>>grid
4 1
() = ( ) ( ) sin ( ) cos
2
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);
INFORME FINAL 15
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>>end;
>>plot(t,f)
>>xlabel('t(seg)')
>>ylabel('AMPLITUD')
>>grid
INFORME FINAL 16
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
DESARROLLO DE LA TRANSFORMADA
RPIDA DE FOURIER
I. OBJETIVOS
II. PROCEDIMIENTO
>>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)|')
INFORME FINAL 17
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>>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)|')
>>n=[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)
INFORME FINAL 18
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>>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))
INFORME FINAL 19
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>>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)]));
INFORME FINAL 20
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
INFORME FINAL 21
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>>t=-0.25:0.001:0.25;
>>w=2*pi;
>>f=(exp(j*w*t)+exp(-
j*w*t))/2;
>>figure(1)
>>plot(t,f)
>>N=128;
>>axis([0 0.2 0 2]);
>>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),'+')
>> xlabel('Frequency,Rad/s')
,ylabel('|F(W)|')
a).function directa
>> N=128;
>> A=2;
>> w=2*pi;
>> f=A*sin(w*t);
>> figure(1)
INFORME FINAL 22
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
>> plot(t,f)
>> xlabel('Time,seg')
,ylabel('f(t)'),grid
b) Transformada de furrier
>> t=-0.25:0.001:0.25;
>> A=2;
w=2*pi;
f=A*sin(w*t);
subplot(2,1,1);
plot(t,f);
F=fft(f);
Fp=F(1:N/2+1)*Ts;
W=Ws*(0:N/2)/N;
figure(3)
plot(W,abs(Fp),'+')
xlabel('Frecueny,rad/s'),ylabel('|F(W)|')
m=[0,1,2,3];
Xm=[2,3,4,5];
Xk=fft(Xm);
Xmag=abs(Xk);
Xphase=angle(Xk);
figure(1)
INFORME FINAL 23
LAB. N01 LAB. INTRODUCCIN A LAS TELECOMUNICACIONES
plot(m,Xmag),axis([0 5 0 25]);
figure(2)
stem(m,Xmag)
figure(3)
stem(m,Xphase)
IV. Conclusions
Hemos sincronizada las diferentes funciones a travs del tiempo, teniendo en cuenta
seales peridicas que se generan a travs del Matlab.
INFORME FINAL 24