Anda di halaman 1dari 31

Simulación de Sistemas de

Comunicaciones Analógicos
Cesar A. Azurdia Meza.
Principios de Comunicaciones EL4005
Esquema de la Presentación
 Introducción

 Conocimientos Básicos

 Simulación de un sistema de comunicación


analógico: Amplitud Modulada (AM)
Esquema de la Presentación
 Introducción

 Conocimientos Básicos

 Simulación de un sistema de comunicación


analógico: Amplitud Modulada (AM)
Introducción
 Luego de la catedra se espera que el
estudiante sea capaz de:
• Modelar un sistema de comunicación haciendo
uso de Matlab/C/Java

• Diseñar un enlace de comunicación analógico.


Esquema de la Presentación
 Introducción

 Conocimientos Básicos

 Simulación de un sistema de comunicación


analógico: Amplitud Modulada (AM)
Conocimientos Básicos
 Se asume que el estudiante tiene los siguientes conocimientos
básicos

o Basic MATLAB OPERATIONS


 Funciones, matrices, etc.

o Principios básicos de los componentes de un sistema de


comunicación
Transmisor AM
Sistema de Comunicación Analógico
Sistema de Comunicación Analógico

 Produces message signal … e.g. a simple Sine wave


Simulación de una Fuente
Generate message signal (simple sine wave)
mt   Vm sin 2f mt 
 Define time instants (1000 sample points)
tmin = 0; tmax = 10^(-3); step = (tmax-tmin)/1000;
t = tmin:step:tmax;

 Define amplitude and frequency (initial phase is zero)


Vm = 1; % Amplitude
fm = 2*10^3; % Frequency

 Construct the Signal


m = Vm*sin(2*pi*fm*t);

 View the Signal


plot(t,m,'r');
Simulación de una Fuente
Simulación de una Fuente
 ¿Qué sucede si existe una fase inicial en la señal?
tmin = 0; tmax = 10^(-3); step = (tmax-tmin)/1000;
t = tmin:step:tmax;
fm = 2*10^3;
Vm = 1;
phi_deg = 45;
phi_rad = phi_deg*pi/180;
m = Vm*sin(2*pi*fm*t+phi_rad);

 ¿Qué sucede si la señal no es sinusoidal?


tmin = 0; tmax = 1; step = (tmax-tmin)/1000;
t = tmin:step:tmax;
f = 2;
m = sawtooth(2*pi*f*t);
plot(t,m,'r');
Simulación: Modulador/Demodulador

Source Modulator

Channel

Destination Demodulator

 Built-in functions are available (ammod, amdemod etc.)


Esquema de la Presentación
 Introducción

 Conocimientos Básicos

 Simulación de un sistema de comunicación


analógico: Amplitud Modulada (AM)
Simulación: Amplitude Modulation
 Simulación con funciones ya existentes MATLAB
fs = 8000; % Sampling rate is 8000 samples
%per second
fc = 300; % Carrier frequency in Hz
t = [0:0.1*fs]'/fs; % Sampling times for 0.1 second
m = sin(20*pi*t); % Representation of the signal
v = ammod(m,fc,fs); % Modulate m to produce v

figure(1)
subplot(2,1,1); plot(t,m); % Plot m on top
subplot(2,1,2); plot(t,v); % Plot v below

mr = amdemod(v,fc,fs); % Demodulate v to produce m

figure(2);
subplot(2,1,1); plot(t,m); % Plot m on top
subplot(2,1,2); plot(t,mr); % Plot mr below
Simulación: Amplitude Modulation
Simulación: Amplitude Modulation
Simulación: Amplitude Modulation
 Sin emplear funciones de MATLAB
 Generación del mensaje mt   Vm sin 2f mt 
tmin = 0; tmax = 10^(-3); step = (tmax-tmin)/1000;
t = tmin:step:tmax;
Vm = 1;
fm = 2*10^3;
m = Vm*sin(2*pi*fm*t);

 Definir la portadora
Vc = 2; % Amplitude
fc = 10^4; % Frequency
c = Vc*sin(2*pi*fc*t); % Carrier signal
Simulación: Amplitude Modulation
 Modulación de la señal  Vm 
vt   Vc 1  sin 2f mt  sin 2f ct 
 Vc 
v = (1+m/Vc).*c; % DSB-FC modulation

 Señal modulada
plot(t,v); % Modulated Wave
hold on;
plot(t,Vc*(1+m/Vc),'r:'); % Upper
Envelope
hold on;
plot(t,-Vc*(1+m/Vc),'r:'); % Lower
Envelope
hold off ;
Amplitude Modulation
Simulación: Amplitude Modulation
 Código completo

clear all; close all; clc;


tmin = 0; tmax = 10^(-3); step = (tmax-tmin)/1000;
t = tmin:step:tmax; % Time
Vm = 1; Vc = 2; % Amplitude
fm = 2*10^3; fc = 10^4; % Frequency

m = Vm*sin(2*pi*fm*t); % Message
c = Vc*sin(2*pi*fc*t); % Carrier
v = (1+m/Vc).*c; % Modulated Wave

plot(t,v); hold on;


plot(t,Vc*(1+m/Vc),'r:'); hold on; % Upper Envelope
plot(t,-Vc*(1+m/Vc),'r:'); hold off % Lower Envelope
Simulación: Amplitude Modulation
Índice de Modulación AM
tmin = 0; tmax = 10^(-3); step = (tmax-
tmin)/1000;
t = tmin:step:tmax;
Vm = 1; mu = 1.5; Vc = Vm/mu;
fm = 2*10^3; fc = 10^4;

m = Vm*sin(2*pi*fm*t);
c = Vc*sin(2*pi*fc*t);
v = (1+m/Vc).*c;

plot(t,v); hold on;


plot(t,Vc*(1+m/Vc),'r:'); hold on;
plot(t,-Vc*(1+m/Vc),'r:'); hold off
Índice de Modulación AM
10

 Vc = 5 8
1.5
Vc = 0.5
6

4 1

2
0.5
0

-2 0

-4

-6 -0.5

-8
-1
-10
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-3
x 10 -1.5

 Vc = 3 6
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
-3
x 10
1

-2

-4

-6
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-3
x 10
Simulación: Amplitude Modulation
 DSB-SC AM
tmin = 0; tmax = 10^(-3); 2
step = (tmax-
tmin)/1000;
t = tmin:step:tmax; 1.5

Vm = 2; Vc = 1; 1

fm = 2*10^3; fc = 10^4; 0.5


0
m = Vm*sin(2*pi*fm*t);
-0.5
c = Vc*sin(2*pi*fc*t);
v = m.*c; -1

-1.5

plot(t,v); hold on;


-2
plot(t,m,'r:'); hold on; 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-3
x 10
plot(t,-m,'r:'); hold off
Simulación: Amplitude Modulation
 DSB-SC Demodulation (Empleando un Filtro Butter)
clear all; close all; clc;
tmin = 0; tmax = 1; step = (tmax-tmin)/(10^3);
t = tmin:step:tmax;
Vm = 2; Vc = 1;
fm = 2; fc = 10^2;

m = Vm*sin(2*pi*fm*t);
c = Vc*sin(2*pi*fc*t);
v = m.*c;

r = v.*c;
[b a] = butter(1,0.01);
mr = filter(b,a,r);

figure(1)
subplot(2,1,1); plot(t,m);
subplot(2,1,2); plot(t,mr);
Circuito Demodulador
 Un detector de envolvente es empleado para demodular la
señal
Simulación: Amplitude Modulation
 RUIDO EN EL CANAL

Source Modulator

Channel

Destination Demodulator

 El canal introduce ruido… Additive White Gaussian


Noise (AWGN)
Simulación: Amplitude Modulation
 Introducción de ruido AWGN al sistema
fs = 10^5; N = 10^5;
t = 1/fs:1/fs:N/fs;
fm = 2; fc = 10^3;
m = sin(2*pi*fm*t);
c = sin(2*pi*fc*t);
v = m.*c;

SNRdB = 10; SNR = 10^(SNRdB/10); %GENERACION RUIDO AWGN


vn = var(v)/SNR;
n = sqrt(vn)*randn(1,N);
v = v + n;

r=zeros(1,N); n=fs/fc;
for k=1:fc
mr((k-1)*n+1:k*n)=2*v((k-1)*n+1:k*n)*c((k-1)*n+1:k*n)'/n;
end

figure(1)
subplot(2,1,1); plot(t,m);
subplot(2,1,2); plot(t,mr); axis([0 1 -1 1])
Simulación: Amplitude Modulation

 Señal sin ruido

 Señal + AGWN
FORMULACIÓN DE TAREA

¿DUDAS?

Anda mungkin juga menyukai