Está en la página 1de 4

PRACTICA No4.

Tema: ALTERACIONES EN LAS SEALES DISTORSIN Y RUIDO

Objetivo:

Familiarizar al estudiante con las alteraciones que sufren las seales del tipo distorsin
(lineal y no lineal) y ruido (blanco gaussiano) en los sistemas de comunicaciones.
Aplicar MATLAB para analizar las alteraciones de las seales en el dominio del tiempo.
1. Elaborar un GUI en MATLAB que permita graficar en tres ventanas, la seal resultante
de la suma de tres seales senoidales de amplitud 1, 2 y 3 respectivamente a
distintas frecuencias en funcin del tiempo, en la otra ventana la seal resultante de
la suma de las mismas seales tras aplicar a la segunda una atenuacin/ganancia en
tensin de 1 y a la tercera de 2 ( debe ser mayor a 0), y en la ltima ventana la
resultante de las mismas seales, tras aplicar un retardo de fase (medida en radianes)
en la segunda seal de 1 respecto a la primera y de 2 respecto a la tercera. El
programa deber permitir ingresar amplitudes, frecuencias, 1, 2, 1 y 2. Adems,
en una grfica diferente mostrar el espectro de amplitud de las tres seales
resultantes y notar la variacin.

Cdigo
A1=str2double(get(handles.ampli1,'string'));
A2=str2double(get(handles.ampli2,'string'));
A3=str2double(get(handles.ampli3,'string'));
a1=str2double(get(handles.ate1,'string'));
a2=str2double(get(handles.ate2,'string'));
r1=str2double(get(handles.re1,'string'));
r2=str2double(get(handles.re2,'string'));
f1=str2double(get(handles.fre1,'string'));
f2=str2double(get(handles.fre2,'string'));
f3=str2double(get(handles.fre3,'string'));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
u1=max(f1,f2);
u2=max(f3,u1);
n=12; %numero de periodos
eje=n/u2;
fs=1000000;
r1=r1*(pi/180);
r2=r2*(pi/180);
t1=0:1/fs:n/u2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y1= A1*sin(2*pi*f1.*t1);
y2= A2*sin(2*pi*f2.*t1);
y3= A3*sin(2*pi*f3.*t1);
x1= y1+y2+y3;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%PRIMERA VENTANA
axes(handles.axes1);
plot(t1,x1);
grid on;
title('\bfSeal Sin resultante ');
xlim([0 eje])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%ESPECTRO
axes(handles.axes4);
L = length(x1);
NFFT = 2^nextpow2(L) % Next power of 2 from length of y
Y = fft(x1,NFFT)/L;
f = fs/2*linspace(0,1,NFFT/2+1);
modulo = 2*abs(Y(1:NFFT/2+1));
plot(f,modulo);
grid on;
title('\bfEspectro de potencia');
d=find(modulo>max(modulo)-max(modulo)*0.1);
xlim([0 f(d*2)]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%SEGUNDA VENTANA
x1= y1+(y2*a1)+(y3*a2);
axes(handles.axes2);
plot(t1,x1);
grid on
title('\bfSeal con atenuacion/ganancia ');
xlim([0 eje])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%ESPECTRO
axes(handles.axes5);
L = length(x1);
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(x1,NFFT)/L;
f = fs/2*linspace(0,1,NFFT/2+1);
modulo = 2*abs(Y(1:NFFT/2+1));
plot(f,modulo);
grid on;
title('\bfEspectro de potencia');
d=find(modulo>max(modulo)-max(modulo)*0.1);
xlim([0 f(d*2)]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%TERCERA VENTANA
y2= A2*sin((2*pi*f2.*t1)+r1);
y3= A3*sin((2*pi*f3.*t1)+(r1+r2));
x1= y1+y2+y3;
axes(handles.axes3);
plot(t1,x1);
grid on
title('\bfSeal con retardo');
xlim([0 eje])
%espectro
axes(handles.axes6);
L = length(x1);
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(x1,NFFT)/L;
f = fs/2*linspace(0,1,NFFT/2+1);
modulo = 2*abs(Y(1:NFFT/2+1));
plot(f,modulo);
grid on;
title('\bfEspectro de potencia');
d=find(modulo>max(modulo)-max(modulo)*0.1);
xlim([0 f(d*2)]);
2. Generar un archivo.m que permita graficar () y () en funcin del tiempo en dos
ventanas diferentes. Graficar el espectro de amplitud de las dos seales anteriores.
(Las cuatro ventanas en la misma figura). Notar las diferencias entre la seal de salida
y la original.
clc
close all;
clear all;
A=input('ingrese la amplitud:');
T= input('ingrese el periodo:');
f1=1/T;
fm1=200*f1;
t1=0:1/fm1:10/f1;
x= A*sin(2*pi*f1*t1);
subplot(2,2,1);
plot(t1,x);
title('X(t)');
grid on;

L = length(x);
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(x,NFFT)/L;
f = fm1/2*linspace(0,1,NFFT/2+1);
modulo = 2*abs(Y(1:NFFT/2+1));
subplot(2,2,3);
plot(f,modulo);
grid on;
title('\bfEspectro');
d=find(modulo>max(modulo)-max(modulo)*0.1);
xlim([0 f(d*2)]);

%seal y(t)
y=7*x+(x.^2);
subplot(2,2,2);
plot(t1,y);
title('Y(t)');
grid on;
L = length(y);
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(y,NFFT)/L;
f = fm1/2*linspace(0,1,NFFT/2+1);
modulo = 2*abs(Y(1:NFFT/2+1));
subplot(2,2,4);
plot(f,modulo);
grid on;
title('\bfEspectro');
d=find(modulo>max(modulo)-max(modulo)*0.1);
xlim([0 f(d*2)]);

También podría gustarte