You are on page 1of 9

I.

MODULACION AM Y FILTROS
PASABAJO PASOALTO
Descripcin:
El programa consiste en la captura de una seal de audio mediante un micrfono,
una vez capturada esa seal se modula dos veces (y1, y2) y se suman ambas
modulaciones.
A la suma de las seales moduladas se le aplican dos filtros: el pasobajo y
pasobanda.
De cada seal obtenida se obtienen sus filtros.
En Matlab:
Para modular una seal en AM:
- y=ammod(x,Fc,Fs)

Donde x es la seal a modular, Fc es la frecuencia de modulacin y Fs
es la frecuencia de muestreo.
Observacin: tener en cuenta la la frmula que se para halla Fc:
Fs > 2(Fc + BW)

Para filtro
En matlab existen tres tipos de filtros: Butterworth, Chebyshev y el Eliptico.
El empleado en el programa es el Butterworth.

- Filtro pasobajo

Fe=Fs/2;
Wp=6200/Fe;
Ws=7500/Fe;
Rp=3;
Rs=20;
[n,Wn]=buttord(Wp,Ws,Rp,Rs);
[b,a]=butter(n,Wn);
[h,fpb]=freqz(b,a,length(suma)/2,Fs);
filtrada1=filter(b,a,suma);


- Filtro pasobanda
Fe=Fs/2;
Wp=[10000 15000]/Fe;
Ws=[200 15200]/Fe;
Rp=3;
Rs=10;
[n,Wn]=buttord(Wp,Ws,Rp,Rs);
[b,a]=butter(n,Wn);
[h1,fpb]=freqz(b,a,length(suma)/2,Fs);
filtrada2=filter(b,a,suma);



Programa:
%MODULACION DE SEAL DE VOZ Y FILTROS PASABAJO, PASABANDA
clear all
ti=0;
tiempo=4;
Fs=44100;
t=ti:1/Fs:tiempo-1/Fs;
disp('hable');
r=audiorecorder(Fs,16,1);
recordblocking(r,tiempo);
x=getaudiodata(r);
sound(x,Fs);
x=x';
X=abs(fft(x));
f=linspace(0,Fs/2,length(x)/2);


%modulacion uno
Fc1=8000;
y1=ammod(x,Fc1,Fs);
Y1=abs(fft(y1));
f1=linspace(0,Fs/2,length(y1)/2);


%modulacion dos
Fc2=17000;
y2=ammod(x,Fc2,Fs);
Y2=abs(fft(y2));
f2=linspace(0,Fs/2,length(y2)/2);

%suma de seales
suma=y1+y2;
SUMA=abs(fft(suma));
fsuma=linspace(0,Fs/2,length(suma)/2);

figure(1)
subplot(4,2,1);
plot(t,x);
title('SEAL DE VOZ')
grid;

subplot(4,2,2);
plot(f,X(1:length(X)/2));
title('ESPECTRO DE SEAL')
grid;

subplot(4,2,3);
plot(t,y1);
title('MODULACION DE SEAL A 11000')
grid;

subplot(4,2,4);
plot(f1,Y1(1:length(Y1)/2));
title('ESPECTRO DE SEAL (MODULACION A 11000)')
grid;

subplot(4,2,5);
plot(t,y2);
title('MODULACION DE SEAL A 15000')
grid;

subplot(4,2,6);
plot(f2,Y2(1:length(Y2)/2));
title('ESPECTRO DE SEAL (MODULACION A 15000)')
grid;

subplot(4,2,7);
plot(t,suma);
title('SUMA DE SEALES')
grid;

subplot(4,2,8);
plot(fsuma,SUMA(1:length(SUMA)/2));
title('ESPECTRO DE LA SUMA DE SEALES')
grid;

%FILTROS
%FILTRO BUTTERWORTH PASOBAJO

Fe=Fs/2;
Wp=6200/Fe;%inicio
Ws=7500/Fe;%fin
Rp=3;
Rs=20;
[n,Wn]=buttord(Wp,Ws,Rp,Rs);
[b,a]=butter(n,Wn);
[h,fpb]=freqz(b,a,length(suma)/2,Fs);
filtrada1=filter(b,a,suma);
FILTRADA1=abs(fft(filtrada1));

figure(2)
subplot(4,1,1);
plot(t,suma);
title('SUMA DE SEALES')
grid;

subplot(4,1,2);
plot(fsuma,SUMA(1:length(SUMA)/2));
title('ESPECTRO DE LA SUMA DE SEALES')
grid;

subplot(4,1,3);
plot(fpb,abs(h));
title('FILTRO BUTTERWORTH PASOBAJO')
grid;

subplot(4,1,4);
plot(fsuma,FILTRADA1(1:length(FILTRADA1)/2));
title('ESPECTRO DE FILTRO PASOBAJO')
grid;

%FILTRO BUTTERWORTH PASOBANDA

Fe=Fs/2;
Wp=[10000 15000]/Fe;%inicio
Ws=[200 15200]/Fe;%fin
Rp=3;
Rs=15;
[n,Wn]=buttord(Wp,Ws,Rp,Rs);
[b,a]=butter(n,Wn);
[h1,fpb]=freqz(b,a,length(suma)/2,Fs);
filtrada2=filter(b,a,suma);
FILTRADA2=abs(fft(filtrada2));

figure(3)
subplot(4,1,1);
plot(t,suma);
title('SUMA DE SEALES')
grid;

subplot(4,1,2);
plot(fsuma,SUMA(1:length(SUMA)/2));
title('ESPECTRO DE LA SUMA DE SEALES')
grid;

subplot(4,1,3);
plot(fpb,abs(h1));
title('FILTRO BUTTERWORTH PASOBANDA')
grid;

subplot(4,1,4);
plot(fsuma,FILTRADA2(1:length(FILTRADA2)/2));
title('ESPECTRO DE FILTRO PASOBANDA')
grid;



figure(4)
subplot(3,2,1);
plot(t,suma);
title('SUMA DE SEALES')
grid;

subplot(3,2,2);
plot(fsuma,SUMA(1:length(SUMA)/2));
title('ESPECTRO DE LA SUMA DE SEALES')
grid;

subplot(3,2,3);
plot(fpb,abs(h));
title('FILTRO BUTTERWORTH PASOBAJO')
grid;

subplot(3,2,4);
plot(fsuma,FILTRADA1(1:length(FILTRADA1)/2));
title('ESPECTRO DE FILTRO PASOBAJO')
grid;

subplot(3,2,5);
plot(fpb,abs(h1));
title('FILTRO BUTTERWORTH PASOBANDA')
grid;

subplot(3,2,6);
plot(fsuma,FILTRADA2(1:length(FILTRADA2)/2));
title('ESPECTRO DE FILTRO PASOBANDA')
grid;

Graficas:
1. La seal, ambas modulaciones, la suma de las modulaciones y sus
espectros respectivos









2. La suma de las seales moduladas y el filtro Butterworth pasobajo
con sus espectros













3. La suma de las seales moduladas y el filtro Butterworth pasobanda
con sus espectros











4. La suma de las seales moduladas y el filtro Butterworth pasobajo y
pasobanda con sus espectros

You might also like