Você está na página 1de 4

16/9/2014 t3

file:///D:/lab%20eletronica/html/t3.html 1/4
Contents
Inicializa
Frequencia
Periodo
Sinal
Plots e Analises de Fourier
Sinais no tempo
Sinais em frequencia
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Felipe Alves Figueir %
% Int. Sistemas Comunicaes %
% Jeferson Jan Dalmonte %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Inicializa
close all; clear all; clc;
Frequencia
fc = 500e3; %500kHz - Sinal de sincronismo
fm = 2e3; %2kHz - Sinal Mensagem
fs = 2*fc; %1MHz - Frequencia amostragem (2xfc)
ac = 4; %Amplitude de 4 V
N = 512; %Constante computacional
Periodo
T = 1/fs;
t = [0:T*256:1/10]; %Periodo ajustado
Sinal
m = (2*cos(2*pi*fm*t))+cos(4*pi*fm*t);%Mensagem do sinal
mh = hilbert(m); %Hilbert do sinal (adiciona complex)
c = ac*cos(2*pi*fc*t); %Sincronismo
r = m.*c; %Mixer sinal e sincronismo
k = hilbert(c).*mh; %Mixer m hilbert e sinc hilbert
sLSB = r + k; %Sada para LSB
sUSB = r - k; %Sada para USB
xc1= 1/2 .* sLSB; %Sada para LSB ajustado o ganho 0.5
xc2= 1/2 .* sUSB; %Sada para USB ajustado o ganho 0.5
Plots e Analises de Fourier
Sinais no tempo
16/9/2014 t3
file:///D:/lab%20eletronica/html/t3.html 2/4
fig = figure(1);
set(fig,'name','Sinais no tempo: m(t), mh(t), r(t) e k(t)','numbertitle','off')
subplot(4,1,1);plot(t,m);
title('m(t)');
subplot(4,1,2);plot(t,mh);
title('mh(t)');
subplot(4,1,3);plot(t,r);
title('r(t)');
subplot(4,1,4);plot(t,k);
title('k(t)');
fig1 = figure(2);
set(fig1,'name','Sinais no tempo: s(t) e xc(t)','numbertitle','off')
subplot(2,1,1);
plot(t,sLSB,'r'); hold on
plot(t,sUSB); hold off
title('s(t)');
legend('r(t) + k(t)','r(t) - k(t)')
subplot(2,1,2);
plot(t,xc1,'r'); hold on
plot(t,xc2); hold off
title('xc(t)');
legend('r(t) + k(t)','r(t) - k(t)')
Warning: Imaginary parts of complex X and/or Y arguments ignored
Warning: Imaginary parts of complex X and/or Y arguments ignored
Warning: Imaginary parts of complex X and/or Y arguments ignored
Warning: Imaginary parts of complex X and/or Y arguments ignored
Warning: Imaginary parts of complex X and/or Y arguments ignored
Warning: Imaginary parts of complex X and/or Y arguments ignored

16/9/2014 t3
file:///D:/lab%20eletronica/html/t3.html 3/4
Sinais em frequencia
fig2 = figure(3);
set(fig2,'name','Espectros de frequencia: m(t), mh(t), r(t) e k(t)','numbertitle','off')
Y = fft(m); P = Y.*conj(Y); f = fm*2*(0:N/2)/N;
subplot(4,1,1);plot(f,fftshift(abs(P(1:257))));
title('FFT m(t)');
Y1 = fft(mh); P1 = Y1.*conj(Y1); f1 = fc*2*(0:N/2)/N;
subplot(4,1,2);plot(f1,fftshift(abs(P1(1:257))));
title('FFT mh(t)');
Y2 = fft(r); P2 = Y2.*conj(Y2);
subplot(4,1,3);plot(f1,fftshift(abs(P2(1:257))));
title('FFT r(t)');
Y3 = fft(k); P3 = Y3.*conj(Y3);
subplot(4,1,4);plot(f1,fftshift(abs(P3(1:257))));
title('FFT k(t)');
fig3 = figure(4);
set(fig3,'name','Espectros de frequencia','numbertitle','off')
subplot(2,1,1)
Y4 = fft(sLSB); P4 = Y4.*conj(Y4);
plot(f1,fftshift(abs(P4(1:257))));hold on
Y5 = fft(sUSB); P5 = Y5.*conj(Y5);
plot(f1,fftshift(abs(P5(1:257))),'r');hold off
title('FFT s(t)');
legend('LSB','USB')
subplot(2,1,2)
Y6 = fft(xc1); P6 = Y6.*conj(Y6);
plot(f1,fftshift(abs(P6(1:257))));hold on
Y7 = fft(xc2); P7 = Y7.*conj(Y7);
plot(f1,fftshift(abs(P7(1:257))),'r');hold off
title('FFT xc(t)');
legend('LSB','USB')
16/9/2014 t3
file:///D:/lab%20eletronica/html/t3.html 4/4

Published with MATLAB R2013a

Você também pode gostar