Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
233 views

Matlab Program For ASK

This Matlab code generates an Amplitude Shift Keying (ASK) signal. It defines the carrier frequency and pulse frequency, sets the amplitude, defines the time vector, generates the carrier sine wave and square wave message signals, and multiplies them to produce the ASK signal. Plots of the carrier, message, and ASK signals are displayed.

Uploaded by

Loganathan Rm
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
233 views

Matlab Program For ASK

This Matlab code generates an Amplitude Shift Keying (ASK) signal. It defines the carrier frequency and pulse frequency, sets the amplitude, defines the time vector, generates the carrier sine wave and square wave message signals, and multiplies them to produce the ASK signal. Plots of the carrier, message, and ASK signals are displayed.

Uploaded by

Loganathan Rm
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Matlab Program for ASK

[cc lang=”Matlab”]clear all;


clc;
close all;
F1=input(‘Enter the frequency of carrier=’);
F2=input(‘Enter the frequency of pulse=’);
A=3;%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
v=x.*u;
subplot(3,1,1);
plot(t,x);
xlabel(‘Time’);
ylabel(‘Amplitude’);
title(‘Carrier’);
grid on;
subplot(3,1,2);
plot(t,u);
xlabel(‘Time’);
ylabel(‘Amplitude’);
title(‘Square Pulses’);
grid on;subplot(3,1,3);
plot(t,v);
xlabel(‘Time’);
ylabel(‘Amplitude’);
title(‘ASK Signal’);
grid on;
[/cc]

Generated ASK Signal


Matlab Program for PSK
[cc lang=”Matlab”]
clear all;
clc;
close all;
set(0,’defaultlinelinewidth’,2);
A=5;
t=0:.001:1;
f1=input(‘Carrier Sine wave frequency =’);
f2=input(‘Message frequency =’);
x=A.*sin(2*pi*f1*t);%Carrier Sine
subplot(3,1,1);
plot(t,x);
xlabel(‘time’);
ylabel(‘Amplitude’);
title(‘Carrier’);
grid on;
u=square(2*pi*f2*t);%Message signal
subplot(3,1,2);
plot(t,u);
xlabel(‘time’);
ylabel(‘Amplitude’);
title(‘Message Signal’);
grid on;

v=x.*u;%Sine wave multiplied with square wave


subplot(3,1,3);
plot(t,v);
axis([0 1 -6 6]);
xlabel(‘t’);
ylabel(‘y’);
title(‘PSK’);
grid on;

[/cc]

Generated PSK Signal


Carrier Sine wave frequency =10
Message frequency =2

You might also like