Sei sulla pagina 1di 17

clc;

close all;
A=1;%Amplitude
t=0:0.001:0.5;

fm=10;
tm=1/fm;
n=0:tm:1;
P=A/2.*square(2*pi*fm*t)+(A/2);%Portadora

x=A.*sin(2*pi*fm*t);%señal

v=x.*P;

figure(1)
plot(t,x);
xlabel('Time');
ylabel('Amplitude');
title('SEÑAL');
grid on;

figure(2)
plot(t,P);
xlabel('Time');
ylabel('Amplitude');
title('PORTADORA');
grid on;

figure(3)
plot(t,v);
xlabel('Time');
ylabel('Amplitude');
title('BASK Signal');
grid on;

clc;
close all;
F1=input('Enter the frequency of inf=');
F2=input('Enter the frequency of portadora=');
A=1;%Amplitude
t=0:0.001:1;
x=A.*sin(2*pi*F1*t);%Carrier Sine wave
u=A/2.*square(2*pi*F2*t)+(A/2);%Square wave message
fm=100;
tm=1/fm;
n=0:tm:1;
x=A.*sin(2*pi*F1*t);%Carrier Sine wave
N=length(x);
y=fft(x,4096);
figure(1)
plot(2*pi*(0:4095)/4096, abs(y))
v=x.*u;
figure(2)

subplot(3,1,1);
plot(t,x);
xlabel('Time');
ylabel('Amplitude');
title('Carrier');
grid on;

figure(3)
subplot(3,1,2);
plot(t,u);
xlabel('Time');
ylabel('Amplitude');
title('Square Pulses');
grid on;

figure(4)
subplot(3,1,3);
plot(t,v);
xlabel('Time');
ylabel('Amplitude');
title('ASK Signal');
grid on;

Objetivo 1

Espectro

clc;

close all;

A=1;%Amplitude

t=0:0.001:1;

fm=100;

tm=1/fm;
n=0:tm:1;

x=A.*sin(2*pi*fm*t);%Carrier Sine wave

N=length(x);

y=fft(x,4096);

figure(1)

plot(2*pi*(0:4095)/4096, abs(y))

u=A/2.*square(2*pi*F2*t)+(A/2);%Square wave message

v=x.*u;

figure(2)

subplot(3,1,1);

plot(t,x);

xlabel('Time');

ylabel('Amplitude');

title('Carrier');

grid on;

figure(3)

subplot(3,1,2);

plot(t,u);

xlabel('Time');

ylabel('Amplitude');

title('Square Pulses');

grid on;

figure(4)

subplot(3,1,3);

plot(t,v);
xlabel('Time');

ylabel('Amplitude');

title('ASK Signal');

grid on;

clc;
close all;
A=1;%Amplitude
t=0:0.001:1;

fm=10;
tm=1/fm;
n=0:tm:1;
P=A/2.*square(2*pi*fm*t)+(A/2);%Square wave message
N=length(x);
y=fft(P,4096);
figure(1)
plot(2*pi*(0:4095)/4096, abs(y))

figure(2)
plot(u)
axis([0 1010 -0.5 1.5]);
grid on;
PRIMER CASO 4Hz

tm=1
Caso 2: 8Hz

Tm=1/2
sofia_981ra@hotmail.com

a)
f=16

F=30
F=50
B)

F=70
F=140
c)

f=100

t=0.25
d)
clc;
close all;
A=1;%Amplitude
t=0:0.001:1;

fm=8;
tm=1/fm;
n=0:tm:1;
P=A/2.*square(2*pi*fm*t)+(A/2);%Portadora
fx=700
x=A.*sin(2*pi*fx*t);%señal

v=x.*P;

figure(1)
plot(t,x);
xlabel('Tiempo');
ylabel('Amplitud');
title('SEÑAL DE ENTRADA');
grid on;

figure(2)
plot(t,P);
xlabel('Tiempo');
ylabel('Amplitude');
title('PORTADORA');
grid on;

figure(3)
plot(t,v);
xlabel('Tiempo');
ylabel('Amplitud');
title('SEÑAL BASK');
grid on;

Potrebbero piacerti anche