0% found this document useful (0 votes)
85 views

Bask

The document contains MATLAB code to generate and plot different types of signals including a carrier sine wave, square wave message, and amplitude-shift keying (ASK) signal. It takes the sine wave carrier and multiplies it by the square wave message to generate the ASK signal. It then plots the individual signals and the combined ASK signal over time to visualize the modulation.

Uploaded by

Raul Mexicano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views

Bask

The document contains MATLAB code to generate and plot different types of signals including a carrier sine wave, square wave message, and amplitude-shift keying (ASK) signal. It takes the sine wave carrier and multiplies it by the square wave message to generate the ASK signal. It then plots the individual signals and the combined ASK signal over time to visualize the modulation.

Uploaded by

Raul Mexicano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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
[email protected]

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;

You might also like