0% found this document useful (0 votes)
320 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
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
320 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
We take content rights seriously. If you suspect this is your content, claim it here.
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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy