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

ModulationPaper ACIQR-3

This laboratory activity demonstrates frequency shift keying (FSK) modulation and demodulation using MATLAB and Multisim. FSK encodes data by shifting the frequency of the carrier signal between two discrete frequencies corresponding to binary 1s and 0s. The MATLAB program generates FSK signals and demodulates them. The Multisim simulation builds a circuit to illustrate FSK modulation using LM555 timers to produce square wave inputs and a modulated FSK output signal.

Uploaded by

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

ModulationPaper ACIQR-3

This laboratory activity demonstrates frequency shift keying (FSK) modulation and demodulation using MATLAB and Multisim. FSK encodes data by shifting the frequency of the carrier signal between two discrete frequencies corresponding to binary 1s and 0s. The MATLAB program generates FSK signals and demodulates them. The Multisim simulation builds a circuit to illustrate FSK modulation using LM555 timers to produce square wave inputs and a modulated FSK output signal.

Uploaded by

Ryan Ancheta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 85

Pamantasan ng Lungsod ng Pasig

Alcalde Jose St., Kapasigan, 1600 Pasig City


College of Engineering

10
DIGITAL MODULATION
ASK, FSK, PSK, QPSK
QAM, PAM, PWM, PPM, PCM,8PSK
Communications 2:
Modulation and Coding Techniques
BSECE 3A

Submitted by:
Ancheta, Ryan L.
Cervo, Ira C.
Islanan, David Bien M.
Quilong Quilong, Jonnavel T.
Ramboyong, Jedida A.

Submitted to:
Dennis L. Molina PECE

Date:
Jan 5, 2020
LABORATORY
ACTIVITY #1
Amplitude Shift Keying
INTRODUCTION
Amplitude Shift Keying (ASK) - is a type of Amplitude Modulation which represents the
binary data in the form of variations in the amplitude of a signal. Any modulated signal has a high
frequency carrier. The binary signal when ASK modulated, gives a zero value for Low input while
it gives the carrier output for High input. ASK signal has a well defined envelope.

The waveforms of ASK are given below:

MATLAB
PROGRAM:
clc %for clearing the command window
close all %for closing all the window except command window
clear all %for deleting all the variables from the memory
fc=input('Enter the freq of Sine Wave carrier:');
fp=input('Enter the freq of Periodic Binary pulse (Message):');
amp=input('Enter the amplitude (For Carrier & Binary Pulse Message):');
t=0:0.001:1; % For setting the sampling interval
c=amp.*sin(2*pi*fc*t);% For Generating Carrier Sine wave
subplot(3,1,1) %For Plotting The Carrier wave
plot(t,c)
xlabel('Time')
ylabel('Amplitude')
title('Carrier Wave')
m=amp/2.*square(2*pi*fp*t)+(amp/2);%For Generating Square wave message
subplot(3,1,2) %For Plotting The Square Binary Pulse (Message)
plot(t,m)
xlabel('Time')
ylabel('Amplitude')
title('Binary Message Pulses')
w=c.*m; % The Shift Keyed Wave
subplot(3,1,3) %For Plotting The Amplitude Shift Keyed Wave
plot(t,w)
xlabel('Time')
ylabel('Amplitude')
title('Amplitude Shift Keyed Signal')

We make sure that we input the codes properly in order to have an accurate output of ASK
signal.
MATLAB
OUTPUT WAVEFORM:

The program for ASK modulation has been simulated in MATLAB and necessary graphs are
plotted.

DISCUSSION
This type of modulation comes under Digital Modulation schemes. Keying is indicating
the transmission of digital signal over the channel. By the amplitude shift keying theory, we can
understand the process of ASK technique. In ASK, the input binary signal is multiplied with the
carrier signal along with its time intervals. Between the first time interval of input binary signal
multiplied with the first time interval of carrier signal voltage and the same process continues for
all time intervals. If the input binary signal is logic HIGH for certain time interval, then the same
should be delivered at the output ports with increment in voltage level. So, the main aim of the
amplitude shift keying modulation is to changing or improving the voltage characteristics of the
input binary signal concerning the carrier signal.
MATERIALS
MATLAB environment behaves like a super-complex calculator. You can enter commands
at the >> command prompt. MATLAB is an interpreted environment. In other words, you give a
command and MATLAB executes it right away.

RESULT:
In amplitude shift keying, the carrier wave amplitude is changed between discrete levels (usually
two) in accordance with the digital data. The modulated waveform consists of bursts of a sinusoid.
MULTISIM
SCHEMATIC DIAGRAM:

INTRODUCTION
In RF digital modulation, a baseband digital signal modulates a single radio frequency (RF)
carrier, which creates two instantaneous related shifts in amplitudes, phase or frequency of the RF
carrier.

We make sure that we input the electronic components properly in order to have an accurate
output of ASK signal.
MULTISIM
OUTPUT WAVEFORM:

The program for ASK modulation has been simulated in MULTISIM and necessary graphs are
plotted.
RESULT
In ASK, each binary information shifts the amplitude of the RF carrier to one of the two possible
amplitudes in its data intervals.

DISCUSSION
There are sharp discontinuities shown at the transition points. These result in the signal
having an unnecessarily wide bandwidth. Bandlimiting is generally introduced before transmission,
in which case these discontinuities would be 'rounded off' . The bandlimiting may be applied to
the digital message, or the modulated signal itself. The data rate is often made a sub-multiple of
the carrier frequency. This has been done in the waveform below. One of the disadvantages of
ASK, compared with FSK and PSK, for example, is that it has not got a constant envelope. This
makes its processing (eg, power amplification) more difficult, since linearity becomes an important
factor.

MATERIALS
NI Multisim (formerly MultiSIM) - is an electronic schematic capture and simulation program
which is part of a suite of circuit design programs, along with NI Ultiboard. Multisim is widely
used in academia and industry for circuits education, electronic schematic design and SPICE
simulation.
Alternating Current (AC) - is a type of electrical current, in which the direction of the flow of
electrons switches back and forth at regular intervals or cycles. Current flowing in power lines
and normal household electricity that comes from a wall outlet is alternating current.
Resistor - In electronic circuits, resistors are used to reduce current flow, adjust signal levels, to
divide voltages, bias active elements, and terminate transmission lines, among other uses.
BD139 is a Bipolar NPN transistor - it is mounted in the SOT-32 plastic package. It is designed
for audio amplifier and driver utilizing complementary circuits. ... BD139 is used in different
industrial projects such as RF amplifier and Switching Circuits.
Oscilloscope (XSC1) - is a laboratory instrument commonly used to display and analyze the
waveform of electronic signals. In effect, the device draws a graph of the instantaneous signal
voltage as a function of time.
LABORATORY
ACTIVITY #2
Frequency Shift Keying
INTRODUCTION

This experiment includes a matlab program and a multisim simulation of frequency shift
keying. Before we proceed to the explanation of the actual experiment we will first try to define
the what frequency shift keying is.

In FSK, the frequency of a carrier signal is modified in a discrete manner depending on the
value of a modulating symbol. Binary FSK is the most common form of FSK where a pair of
discrete frequencies are used to transmit binary information.

Notice that the FSK signal switches between two frequencies. The frequency of the signal that
corresponds with logic-0s in the digital data (called the space frequency) is usually lower than the
modulator's nominal carrier frequency. The frequency of the signal that corresponds with logic-1s
in the digital data (called the mark frequency) is usually higher than the modulator's nominal carrier
frequency. The modulator doesn't output a signal at the carrier frequency, hence the reference here
to it as being the "nominal" carrier frequency.

FSK generation can be handled by conventional FM modulator circuits and the voltage-
controlled oscillator (VCO) is commonly used. Similarly, FSK demodulation can be handled by
conventional FM demodulators such as the zero-crossing detector and the phase-locked loop.
Alternatively, if the FSK signal is passed through a sufficiently selective filter, the two sine waves
that make it up can be individually picked out. Considered on their own, each signal is an ASK
signal and so the data can be recovered by passing either one of them through an envelope detector.
DISCUSSION

MATLAB
PROGRAM
FSK modulation
1. Generate two carriers signal.
2. Start FOR loop
3. Generate binary data, message signal and inverted message signal
4. Multiply carrier 1 with message signal and carrier 2 with inverted message signal
5. Perform addition to get the FSK modulated signal
6. Plot message signal and FSK modulated signal.
7. End FOR loop.
8. Plot the binary data and carriers.

FSK demodulation
1. Start FOR loop
2. Perform correlation of FSK modulated signal with carrier 1 and carrier 2 to get two decision
variables x1 and x2.
3. Make decisionon x = x1-x2 to get demodulated binary data. If x>0, choose ‘1’ else choose ‘0’.
4. Plot the demodulated binary data.

Multisim Simulation
We made a circuit that will illustrate how FSK modulated wave can be generated. It is build
using LM555CM. Square pulses are given as input to represent bit 1 and bit 0, and as an output
LM555CM. generates FSK modulated wave. To generate square pulses one more LM555CM. is
used.
FSK plays a vital role in a wide range of applications in the communication field and it
was treated as an efficient one for wireless modems in data transmission. The above circuit is
capable of producing an FSK signal with respect to the given input signal. The R4, R5 and C1 in
the circuit determine the frequency of the FSK modulated signal in the mode of Astable.
The output frequency of the signal was based on the input digital signal given to the base
terminal of the transistor and IC works in the Astable mode. Here the resistors R4, R5 & C1 was
chosen in such a way to get output frequency of 1070Hz. When the input was high, then it is
written by the following equation

f = 1.45/(Ra + 2Rb) C

Here R3 value added in addition to the R5 value, R4 and contribute to donate the working
of the IC. This makes the charging and discharging faster, resulting in high-frequency waves as
output. The resistors and capacitor values were selected in such a way to get an output frequency
of 1270 Hz. This was given by the following equation.
F = 1.45/(( Ra || Rc ) + 2Rb ) C

Therefore, the output of an FSK will give 1070Hz frequency when input is high & 1270
frequencies when an input is low. So by this technique, the FSK signal was gained using NE555.

MATERIALS
LM555CM - Used in a variety of timer, delay, pulse generation, and oscillator applications.
Function Generator - Voltage source that supplies sinusoidal, triangular or square waves.
Resistors and Capacitor - Helps determine the frequency of the FSK modulated signal in the
mode of Astable.
Oscilloscope - Provides a graph of one or two signals over time, or allow comparison of one
waveform to another.
Ground
MATLAB
PROGRAM:
MULTISIM
SCHEMATIC DIAGRAM:
LABORATORY
ACTIVITY #3
Phase Shift Keying
Phase Shift Keying
Phase Shift Keying is a digital modulation technique which the sine and cosine inputs
varies with respect to time where the phase of the carrier signal is changed. PSK modulation
technique is often used in wireless LANs, bio-metric, contactless operations, Radio-frequency
Identification (RFID) and Bluetooth communications. It is suited to the growing area of data
communications.
Binary Phase Shift Keying
Binary Phase Shift Keying is the basic form of Phase Shift Keying. It has two possible
outputs. One is a reversal at 0° and the other is at 180°. It can be simply explain in the block
diagram.
On the block diagram above, the Balance Modulator contains both the carrier wave
generator and the binary sequence which is the data.
MULTISIM
SCHEMATIC DIAGRAM:
MATLAB
PROGRAM:
MATERIALS
LM555CM
One of the materials that was used in this circuit is the LM555CM. 555 timer IC is
an integrated circuit used in a variety of timer, delay, pulse generation, and oscillator applications.
Derivatives provide two (556) or four (558) timing circuits in one package. It was commercialized
in 1972 by Signetics and it was reported to still be in wide use as of 2013. In 2017, it was said over
a billion 555 timers are produced annually by some estimates, and "probably the most popular
integrated circuit ever made."
BC547
Is a general-purpose NPN bipolar junction transistor commonly used in European and
American electronic equipment. It is notably often the first type of bipolar transistor hobbyists
encounter and is often featured in designs in hobby electronics magazines where a general-purpose
transistor is required. The BC548 is low in cost and widely available.
UA741
UA 741 is basically a general-purpose operational amplifier. It is considered to be ideal for the
voltage follower applications because it has a High Common Mode Input Voltage Range (HCMIVR). It is
a high-performance operational amplifier made up of single silicon chip. Due to the internal frequency
compensation, it is stable without using external components and safe from the short circuiting. In order
to cancel the effect of offset voltages we can use a small valued potentiometer/resistor. It can operate in a
temperature ranging from 0 degrees celsius to 70 degrees celsius.
Function Generator
A function generator is an electronic equipment used to test and generate different types of
electrical waveforms over a range of frequencies. Various waveforms can be produced by the function
generator which are the sine wave, square wave, triangular wave and sawtooth shapes.
Oscilloscope
An oscilloscope is a laboratory instrument used to display and analyze the waveform of electronic
signals. The device draws a graph of the instantaneous signal voltage as a function of time.

Discussion:
In the circuit that we made in the Phase Shift Keying Modulation technique, we have used
several electronic components. First is the function generator. We used two function generators to
generate a square wave and at the same time to generate a sine wave. The square wave generated
passed through a resistor and a transistor which went to an operational amplifier. The operational
amplifier has 2 inputs, one is the signal which came from a function generator that generates a sine
wave. And one which generated square waves. The output was then connected to an oscilloscope.
There were 3 signal waves present. The red signal waves represent the sine wave coming from the
function generator 1. The green signal wave represent the square waves coming from the function
generator 2. The blue signal waves represent the output of a Phase Shift Keying Modulator.
INTRODUCTION
In this study, we are going to learn what BPSK (Binary Phase Shift Keying) is, by using
MATHLAB and MULTISIM. Digital modulation techniques are use to have a better quality and
efficient communication, BPSK (also sometimes called PRK, phase reversal keying, or 2PSK) is
the simplest form of phase shift keying (PSK). It uses two phases which are separated by 180° and
so can also be termed 2-PSK.
DISCUSSION
In creating BPSK waveform we need to know how to access MATHLAB and MULTSIM.
We will see what BPSK waveform will look like after we use MATHLAB and MULTISIM. Now
we will proceed by showing you the result of the circuit and code that we have. components and
codes will be like this;
A. Creating BPSK waveform using MATHLAB
a. Open MATHLAB and enter the code for BPSK
a. Run the code for BPSK

b. Run the code for BPSK


A. Creating BPSK waveform using MULTISIM
a. Open MULTISIM and create the circuit for BPSK

b. Run the circuit


c. Check the waveform @ 0 %

d. Outputs @ 100% and @ 0%

@ 82%
@ 0%
MATERIALS
We use MATHLAB and MULTISIM to create a waveform for Binary Phase-Shift Keying,
one of the simplest form of PSK (Phase-Shift Keying) Modulation technique that we used, now
that we are done in modeling and simulations we can now see what BPSK waveform is. Here we
will talk about the materials that we use during our modeling and simulations, the code and the
circuit to create the BPSK waveform.
This is the code that we use in MATHLAB to create BPSK waveform.
MATLAB
PROGRAM:
BPSK CODE SOURCE
% BPSK modulation
clc;
clear all;
close all;
%GENERATE CARRIER SIGNAL
Tb=1;
t=0:Tb/100:Tb;
fc=2;
c=sqrt(2/Tb)*sin(2*pi*fc*t);
%generate message signal
N=8;
m=rand(1,N);
t1=0;t2=Tb
for i=1:N
t=[t1:.01:t2]
if m(i)>0.5
m(i)=1;
m_s=ones(1,length(t));
else
m(i)=0;
m_s=-1*ones(1,length(t));
end
message(i,:)=m_s;
%product of carrier and message signal
bpsk_sig(i,:)=c.*m_s;
%Plot the message and BPSK modulated signal
subplot(5,1,2);axis([0 N -2 2]);plot(t,message(i,:),'r');
title('message signal(POLAR form)');xlabel('t--->');ylabel('m(t)');
grid on; hold on;
subplot(5,1,4);plot(t,bpsk_sig(i,:));
title('BPSK signal');xlabel('t--->');ylabel('s(t)');
grid on; hold on;
t1=t1+1.01; t2=t2+1.01;
end
hold off
%plot the input binary data and carrier signal
subplot(5,1,1);stem(m);
title('binary data bits');xlabel('n--->');ylabel('b(n)');
grid on;
subplot(5,1,3);plot(t,c);
title('carrier signal');xlabel('t--->');ylabel('c(t)');
grid on;
7
% BPSK Demodulation
t1=0;t2=Tb
for i=1:N
t=[t1:.01:t2]
%correlator
x=sum(c.*bpsk_sig(i,:));
%decision device
if x>0
demod(i)=1;
else
demod(i)=0;
end
t1=t1+1.01;
t2=t2+1.01;
end
%plot the demodulated data bits
subplot(5,1,5);stem(demod);
title('demodulated data');xlabel('n--->');ylabel('b(n)');
grid on
Now for the waveform created in MULTISIM, we need to have a circuit. It consists of the
following;

10 Resistors ,one is a variable resistor


1 Capacitors
1 BJT NPN
1 Diode
1 Inverter
1 BJT PNP
3 Op-Amps
2 Function generator

Connect each component and it will give us the BPSK waveform that we are expecting.
BPSK IN MATHLAB
BPSK IN MATHLAB
BPSK IN MULTISIM
LABORATORY
ACTIVITY #4
Frequency Shift Keying
INTRODUCTION

In the world of wired electronics, analog signals exhibit continuous variations whereas digital
signals assume (ideally) one of two discrete states. This distinction can be extended to systems that
transmit data via electromagnetic radiation instead of electric current traveling through wires.

When used for analog signals, frequency modulation and amplitude modulation lead to
continuous variations in the frequency or amplitude of a carrier wave. When modulation
techniques are used for digital communication, the variations applied to the carrier are restricted
according to the discrete information being transmitted.

Examples of common digital modulation types are OOK (on/off keying), ASK (amplitude
shift keying), and FSK (frequency shift keying). These schemes cause the carrier to assume one of
two possible states depending on whether the system must transmit a binary 1 or a binary 0; each
discrete carrier state is referred to as a symbol.

Quadrature phase shift keying (QPSK) is another modulation technique, and it’s a particularly
interesting one because it actually transmits two bits per symbol. In other words, a QPSK symbol
doesn’t represent 0 or 1—it represents 00, 01, 10, or 11.

This two-bits-per-symbol performance is possible because the carrier variations are not
limited to two states. In ASK, for example, the carrier amplitude is either amplitude option A
(representing a 1) or amplitude option B (representing a 0). In QPSK, the carrier varies in terms of
phase, not frequency, and there are four possible phase shifts.

We can intuitively determine what these four possible phase shifts should be: First we recall
that modulation is only the beginning of the communication process; the receiver needs to be able
to extract the original information from the modulated signal. Next, it makes sense to seek
maximum separation between the four phase options, so that the receiver has less difficulty
distinguishing one state from another. We have 360° of phase to work with and four phase states,
and thus the separation should be 360°/4 = 90°. So our four QPSK phase shifts are 45°, 135°, 225°,
and 315°.
MATLAB
PROGRAM:
MULTISIM
SCHEMATIC DIAGRAM:
DISCUSSION

Matlab Program
QPSK modulation
1. Generate quadrature carriers.
2. Start FOR loop
3. Generate binary data, message signal(bipolar form)
4. Multiply carrier 1 with odd bits of message signal and carrier 2 with even bits of message
signal
5. Perform addition of odd and even modulated signals to get the QPSK modulated signal
6. Plot QPSK modulated signal.
7. End FOR loop.
8. Plot the binary data and carriers
QPSK demodulation
1. Start FOR loop
2. Perform correlation of QPSK modulated signal with quadrature carriers to get two decision
variables x1 and x2.
3. Make decision on x1 and x2 and multiplex to get demodulated binary data.
If x1>0and x2>0, choose ‘11’. If x1>0and x2<0, choose ‘10’. If x1<0and x2>0, choose ‘01. If
x1<0and x2<0, choose ‘00’.
4. End FOR loop
5. Plot demodulated data

Multisim Simulation
Two BPSK signals add to form a QPSK signal. The different QPSK symbols generated by using
different combinations of cos and sin we get i.e. + cos + sin,
+ cos - sin, - cos + sin and - cos - sin.
This method is based on the fact that
- Addition of two BASK signals result in a BPSK
- Addition of two BPSK signal result in a QPSK

The basic circuit includes 4 BASK modulators that gives rise to two BPSK modulators which
finally result in a QPSK Modulator.

MATERIALS
741 Op-Amp - summing
AC Power Source - sine/cosine waves carrier
BJT NPN - switch
LABORATORY
ACTIVITY #5
Quadrature Amplitude Modulation
INTRODUCTION
Quadrature Amplitude Modulation is about the transmission of digital information between
two points. It enables an analog signal to transmit digital information efficiently. It increases the
bandwidth which provides the means by which an operator transmits more bits in the same period
of time. QAM is a modulation techniq0ue which transmits data by changing the amplitude, or
power level, of two signals: first in-phase with the incoming data and the second 90 degrees out
of phase.
Quadrature Amplitude Modulation is used in different applications. In the cable television
industry, QAM systems are used by multi-system operators (MSO) and other network operators
to deliver video, voice and data services. Network operators are experiencing an ever-increasing
need for more QAM channels driven by the explosive demand by consumers for high-speed data,
high-definition television, video-on-demand, network personal video recording, Internet Protocol
cable television and digital phone service.
QAM has its advantages and disadvantages. QAM appears to be efficient in transmission
of data by utilizing both amplitude and phase variations. But some of its disadvantage came from
having external noise due to its point to point transmission. Also, linear amplifiers are still
necessary which is both inefficient in cost and in the system.
Here is an example of Quadrature Amplitude Modulation.
MULTISIM
SCHEMATIC DIAGRAM:
MATLAB
PROGRAM:
MATERIALS
2N222
It is a common NPN bipolar junction transistor (BJT) used for general purpose low-
power amplifying or switching applications. It is designed for low to medium current,
low power, medium voltage, and can operate at moderately high speeds. It is considered a very
common transistor, and is used as an exemplar of an NPN transistor. It is frequently used as a
small-signal transistor, and it remains a small general-purpose transistor of enduring popularity.
TL084ACN
TL084 is a JFET input Op-Amp with high input impedance and low offset current and
offset voltage making it ideal of amplifier applications. It has high noise immunity and better
offset characteristics than TL074.
1N4002
A diode is a device which allows current flow through only one direction. That is the
current should always flow from the Anode to cathode. The cathode terminal can be identified by
using a grey bar as shown in the picture above.

For 1N4002 Diode, the maximum current carrying capacity is 1A it withstand peaks up to
30A. Hence, we can use this in circuits that are designed for less than 1A. The reverse current is
5uA which is negligible. It can withstand reverse voltage peak up to 100V.
Function Generator
A function generator is an electronic equipment used to test and generate different types of
electrical waveforms over a range of frequencies. Various waveforms can be produced by the
function generator which are the sine wave, square wave, triangular wave and sawtooth shapes.
Oscilloscope
An oscilloscope is a laboratory instrument used to display and analyze the waveform of
electronic signals. The device draws a graph of the instantaneous signal voltage as a function of
time.
Discussion:
In this circuit, two function generators were used. The first function generator generates
sine waves. The second function generator generates square waves. After producing the waves,
they passed through resistors and the 2N2222 transistor powered by 5 V power source. Then they
entered the TL084ACN operational amplifier which afterwards passed through capacitor and
another set of operational amplifiers.
LABORATORY
ACTIVITY #6
Pulse Amplitude Modulation
INTRODUCTION
It is the simplest form of Pulse Modulation. In this type of modulation, each sample is
made proportional to the amplitude of the signal at the instant of sampling. The PAM signal
follows the amplitude of the original signal, as the signal traces out the path of the whole wave.
Here a signal which is sampled at Nyquist rate can be reconstructed by passing it through an
efficient Low Pass Filter (LPF) with exact cutoff frequency. It is very easy to generate and
demodulate PAM. This technique transmits the data by encoding in the amplitude of a series of
signal pulses.
MATLAB
PROGRAM:
MULTISIM
SCHEMATIC DIAGRAM:
DISCUSSION
In simulating Pulse-Amplitude Modulation or PAM in both matlab and multisim are
different because in matlab you will input codes or syntax while in multisim you will input
electronic components to create a circuit. In matlab, we searched codes in the internet that will
result as PAM signal if we input in the said software. It is not easy to find matlab codes because
there are codes that the outputs are not PAM signal but, in the end, we finally found the right
matlab code that the result or output is PAM signal (see second picture). In multisim, we also
searched in the internet but this time it is not codes but a circuit that we can plot in the said software.
The same in the matlab, it is also not easy to find the right circuit that the output will be PAM
signal. There are circuits that the outputs will either straight line or only a sine wave. We found a
circuit that at first the output is not PAM signal but when we change the value of the AC source
the output is finally a PAM signal (see fourth picture). The result of both matlab and multisim
simulation are the same because that was our goal, to make a different software the same base on
their result or output. The output or PAM signal is a form of signal modulation where the message
information is encoded in the amplitude of a series of signal pulses. It is an analog pulse modulation
scheme in which the amplitudes of a train of carrier pulses are varied according to the sample value
of the message signal.

MATERIALS
AC Source (V) – is a type of electrical current, in which the direction of the flow of electrons
switches back and forth at regular intervals or cycles.
N-channel MOSFET (2N7000) – are power electronic switches just like transistors, but with a
higher current and voltage rating.
Function Generator (XFG1) - is a voltage source that supplies sinusoidal, triangular or square
waves. It provides a convenient and realistic way to supply stimulus signals to a circuit. The
waveform can be changed and its frequency, amplitude, duty cycle and DC offset can be
controlled. The frequency range is great enough to produce conventional AC as well as audio-
and radio-frequency signals.
Resistor (R) – it limits or regulates the flow of electrical current. Resistors can also be used to
provide a specific voltage for an active device such as transistor.
Oscilloscope (XSC1) - is a laboratory instrument commonly used to display and analyze the
waveform of electronic signals. In effect, the device draws a graph of the instantaneous signal
voltage as a function of time.
LABORATORY
ACTIVITY #7
Pulse Width Modulation
OBJECTIVE
• To generate PWM waveform using MATHLAB and MULTISIM
• To understand the basic principle of digital modulation techniques: PWM through
modeling and simulations.
• To gain experience in using MATHLAB and MULTISIM

INTRODUCTION
In this study, we are going to understand the basic principle of digital modulation by
performing the Pulse Width Modulation in MATHLAB and MULTISIM. Digital modulation
techniques are use to have a better quality and efficient communication, Pulse-width modulation
(PWM) it is a method of decreasing the average power delivered by an electrical signal, by
effectively chopping it up into discrete parts. The average value of voltage (and current) fed to the
load is controlled by turning the switch between supply and load on and off at a fast rate.
DISCUSSION
In creating PWM waveform we need to know how to use MATHLAB and MULTSIM first
after that we need to find a circuit and a code that will give us the right waveform for ASK
modulation. Now that we already know how to use it we just need to put in the circuit and the code
that we have. For our circuit, the components and codes will be like this;
B. Creating PWM waveform using MATHLAB
a. Open MATHLAB and enter the code for PWM
NOTE: For generated PWM signal Inputs and Observation, the message frequency is 1
and the carrier saw tooth frequency is 10

a. Run the code for PWM

b. Analyze the figure


C. Creating PWM waveform using MULTISIM
a. Open MULTISIM and create the circuit for PWM

b. Run the circuit


c. Check the waveform @ 0 %

d. Outputs @ 100% and @ 0%

@ 100%
@ 0%
MATERIALS

We use MATHLAB and MULTISIM to create a waveform for Pulse width modulation,
one of the digital modulation techniques that we wish to understand, now that we are done in
modeling and simulations we can now see what PWM waveform looks like. Here we will talk
about the materials that we use during our modeling and simulations; MATHLAB, we use the code
and enter it in MATHLAB, after running it we are able to create PWM waveform as we expected.
This is the code that we use in MATHLAB to create PWM waveform.
PWM MATHLAB CODE SOURCE m=0.75*A.*sin(2*pi*F2*t);%Message
clc; amplitude must be less than Sawtooth
clear all; subplot(3,1,2);
close all; plot(t,m);
F2=input('Message frequency='); xlabel('Time');
F1=input('Carrier Sawtooth frequency='); ylabel('Amplitude');
A=5; title('Message Signal');
t=0:0.001:1; grid on;
c=A.*sawtooth(2*pi*F1*t);%Carrier
sawtooth n=length(c);%Length of carrier sawtooth is
subplot(3,1,1); stored to 'n'
plot(t,c); for i=1:n%Comparing Message and
xlabel('time'); Sawtooth amplitudes
ylabel('Amplitude'); if (m(i)>=c(i))
title('Carrier sawtooth wave'); pwm(i)=1;
grid on; else
pwm(i)=0;
end ylabel('Amplitude');
end title('plot of PWM');
subplot(3,1,3); axis([0 1 0 2]);%X-Axis varies from 0 to 1
plot(t,pwm); & Y-Axis from 0 to 2
xlabel('Time'); grid on;

NOTE: In this case we use message frequency = 1 and the carrier saw tooth frequency = 10.
Now for the waveform created in MULTISIM, we need to have a circuit. It consists of the
following;

➢ 3 Resistors ,one is a variable resistor


➢ 2 Capacitors
➢ 555 timer Integrated circuit
➢ LED
➢ DC voltage source
Connect each component and it will give us the PWM waveform that we are expecting.
MATLAB PROGRAM:
PWM IN MATHLAB

PWM
IN

MULTISIM
LABORATORY
ACTIVITY #8
Pulse Position Modulation
INTRODUCTION
Pulse Position Modulation (PPM) is an analog modulating technique in which the
position of each pulse changes but keeps the same amplitude and width of the pulses according to
a particular pulse of the message signal being sampled.
To keep the transmitter in synchronism, it has to send synchronizing pulses. These sync
pulses help maintain the position of the pulses.

Here a single pulse is transmitted with the required number of phase shifts. So we can say
that pulse position modulation is an analogue modulation scheme where the amplitude and width
of the pulse are kept constant, while the position of the pulse with respect to the position of a
reference pulse is varied according to the instantaneous value of message signal.

PPM can be obtained from PWM. This is done by getting rid of leading-edge and bodies
of PWM pulses. The main advantage of pulse position modulation is that it requires constant
transmitter power output while the major disadvantage is that it depends upon transmitter-receiver
synchronization.

The waveforms of PPM are given below:


Here is another example which shows the sampled pulses:

MULTISIM SCHEMATIC DIAGRAM:


MATLAB PROGRAM:
DISCUSSION
In simulating Pulse-Position Modulation or PPM in Multisim, first, we select
the components of AC power and Triangular Voltage and then drag or position it
based on the circuit that we searched. The two power and voltage sources were
connected to a TL08ACN operational amplifier. After which, it was again connected
to another TL08ACN, both powered by a 12 voltage DC source. The output was then
connected to LM555CM, connected with a couple of capacitors. The output of this,
still does not show a Pulse-Position Modulation. A circuit which is known as
monostable multi-vibrator should be added. Therefore, it was the circuit with another
LM555CM was added in the end to show the Pulse-Position Modulation needed.

MATERIALS
Function Generator (XFG1) – is a voltage source that supplies sinusoidal,
triangular or square waves. It provides a convenient and realistic way to supply
stimulus signals to a circuit. The waveform can be changed and its frequency,
amplitude, duty cycle and DC offset can be controlled. The frequency range is great
enough to produce conventional AC as well as audio- and radio-frequency signals.
Resistor (R) – it limits or regulates the flow of electrical current. Resistors can
also be used to provide a specific voltage for an active device such as transistor.
LM555CM – is a highly stable device for generating accurate time delays or
oscillation. Additional terminals are provided for triggering or resetting if desired.
In the time delay mode of operation, the time is precisely controlled by one external
resistor and capacitor. For a stable operation as an oscillator, the free running
frequency and duty cycle are accurately controlled with two external resistors and
one capacitor.
Capacitor (C) – is a device to store an electric charge for a short period of time that
consists of two metallic plates separated by a dielectric.
Voltage Common Collector (VCC) – is the higher voltage with respect to ground.
VCC is the power input of a device. It may be positive or negative respect to ground.
Oscilloscope (XSC1) - is a laboratory instrument commonly used to display and
analyze the waveform of electronic signals. In effect, the device draws a graph of
the instantaneous signal voltage as a function of time.
Spectrum Analyzer (XSA1) – measures the magnitude of an input signal versus
frequency within the full frequency range of the instrument. The primary use is to
measure the power of the spectrum of known and unknown signals.
LABORATORY
ACTIVITY #9
Pulse Code Modulation
INTRODUCTION
Pulse Code Modulation (PCM) - is a type of source coding. A PCM stream is a digital
representation of an analog signal, in which the magnitude of the analogue signal is sampled
regularly at uniform intervals, with each sample being quantized to the nearest value within a range
of digital steps. A PCM stream has two basic properties that determine the stream's fidelity to the
original analog signal: the sampling rate, which is the number of times per second that samples are
taken; and the bit depth, which determines the number of possible digital values that can be used
to represent each sample.
The waveforms of PCM are given below:

MATLAB
PROGRAM:
PCM (PULSE CODE MODULATION) CODE:
%PCM
%Analog Signal (Sinusoidal)
f=2;%Maximum frequency of the input signal
fs=20*f;%Nyquist sampling rate
t=0:1/fs:1;%Time
a=2;%Amplitude
x=a*sin(2*pi*f*t);
%Level Shifting
x1=x+a;
%Quantinization
q_op=round(x1);
%Decimal to binary
enco=de2bi(q_op,'left-msb');
%PCM Receiver
deco=bi2de(enco,'left-msb');
%Shifting the amplitude level to the original value
xr=deco-a;
%Plotting
plot(t,x,'r-',t,xr,'k+-');
xlabel('time');
ylabel('Amplitude');
legend('Original Signal','Reconstructed Signal')

We make sure that we input the codes properly, we also check the colon because its
important in order to have an output.
MATLAB
OUTPUT WAVEFORM:

The program for Pulse Code Modulation has been simulated in MATLAB and necessary
graphs are plotted.
MULTISIM
SCHEMATIC DIAGRAM: 1st Circuit
MULTISIM
SCHEMATIC DIAGRAM: 2nd Circuit
DISCUSSION
A signal is pulse code modulated to convert its analog information into a binary sequence,
especially in 1s and 0s. The output of a PCM will resemble a binary sequence. The following figure
shows an example of PCM output with respect to instantaneous values of a given sine wave.
Instead of a pulse train, PCM produces a series of numbers or digits, and hence this process is
called as digital. Each one of these digits, though in binary code, represent the approximate
amplitude of the signal sample at that instant.

MATERIALS
MATLAB environment behaves like a super-complex calculator. You can enter commands
at the >> command prompt. MATLAB is an interpreted environment. In other words, you give a
command and MATLAB executes it right away.
LABORATORY
ACTIVITY #10
8 Phase Shift Keying
INTRODUCTION
In this study, we are going to learn what 8PSK (8 Phase Shift Keying) is, by using
MATHLAB and MULTISIM. Digital modulation techniques are use to have a better quality and
efficient communication, 8PSK or Multilevel PSK. This study will describe 8-PSK modulation
basics or multilevel PSK modulation which is a type of digital modulation based on carrier phase
change. In Phase Shift keying modulation or PSK modulation phase of carrier is changed according
to the digital data.
DISCUSSION
In creating 8PSK waveform we need to know how to access MATHLAB and MULTSIM.
We will see what 8PSK waveform will look like after we use MATHLAB and MULTISIM. Now
we will proceed by showing you the result of the circuit and code that we have.
A. Creating 8PSK waveform using MATHLAB
a. Open MATHLAB and enter the code for 8PSK
c. Run the code for 8PSK

d. Analyze the figure

B. Creating 8PSK waveform using MULTISIM


a. Open MULTISIM and create the circuit for 8PSK

b. Run the circuit


c. Check the waveform

MATERIALS
We use MATHLAB and MULTISIM to create a waveform for 8 Phase-Shift Keying, one of the
multi levels of PSK (Phase-Shift Keying) Modulation technique that we used, now that we are
done in modeling and simulations we can now see what 8PSK waveform is. Here we will talk
about the materials that we use during our modeling and simulations, the code and the circuit to
create the 8PSK waveform.
This is the code that we use in MATHLAB to create 8PSK waveform.

8PSK MATHLAB CODE SOURCE

% Modulation 8PSK
% Encoded by - Ryan L. Ancheta
% Example of the input message:
% Enter Message Input of Eight Elements (between 0&7): [ 0 1 4 5 3 7 6 2]
% Enter the frequency of carrier= 16

clc
close all
clear all
x1=zeros(1,100);
x2=ones(1,100);
y=[]; %Square Input Wave
y3=1:800;
y2=1:800;
y1=1:800;
z=1:800; %output Signal
m=input('Enter Message Input of Eight Elements (between 0&7): ');
for i=1:8
if(m(i)==0)
y=[y x1 x1 x1];
elseif(m(i)==1)
y=[y x1 x1 x2];
elseif(m(i)==2)
y=[y x1 x2 x1];
elseif(m(i)==3)
y=[y x1 x2 x2];
elseif(m(i)==4)
y=[y x2 x1 x1];
elseif(m(i)==5)
y=[y x2 x1 x2];
elseif(m(i)==6)
y=[y x2 x2 x1];
elseif(m(i)==7)
y=[y x2 x2 x2];
end
end
j=0;
for k=1:300:2400
for i=1:100
y3(i+j)=y(k); %First Pulse Bit
y2(i+j)=y(k+100); %Second Pulse Bit
y1(i+j)=y(k+200); %Third Pulse Bit
end
j=j+100;
end
t=0:0.00125:0.9988; %Sampling Interval
A=4; %Amplitude
f=input('Enter the frequency of carrier='); %Carrier Frequency
for i=1:800
if(y3(i)==0 && y2(i)==0 && y1(i)==0)
phid=0;
elseif(y3(i)==0 && y2(i)==0 && y1(i)==1)
phid=45;
elseif(y3(i)==0 && y2(i)==1 && y1(i)==0)
phid=90;
elseif(y3(i)==0 && y2(i)==1 && y1(i)==1)
phid=135;
elseif(y3(i)==1 && y2(i)==0 && y1(i)==0)
phid=180;
elseif(y3(i)==1 && y2(i)==0 && y1(i)==1)
phid=225;
elseif(y3(i)==1 && y2(i)==1 && y1(i)==0)
phid=270;
elseif(y3(i)==1 && y2(i)==1 && y1(i)==1)
phid=315;
end
phir=phid*(pi/180);
z(i)=A*sin(2*pi*t(i)*f+phir);
end
t1=0:0.0004166:0.99958; %Output Interval
t2=0:0.00125:0.9988; %Output Interval
%Plot Square Input Signal
figure('name','8PSK MODULATION','numbertitle','off');
subplot(5,1,1);
plot(t1,y,'g','linewidth',3);
xlabel('Time');
ylabel('Amplitude');
title('Square Pulses');
grid on;
axis([0 1 -2 2]);
subplot(5,1,2);
plot(t2,y1,'m','linewidth',3);
xlabel('Time');
ylabel('Amplitude');
title('Square Pulses 1');
grid on;
axis([0 1 -2 2]);
subplot(5,1,3);
plot(t2,y2,'c','linewidth',3);
xlabel('Time');
ylabel('Amplitude');
title('Square Pulses 2');
grid on;
axis([0 1 -2 2]);
subplot(5,1,4);
plot(t2,y3,'r','linewidth',3);
xlabel('Time');
ylabel('Amplitude');
title('Square Pulses 3');
grid on;
axis([0 1 -2 2]);
subplot(5,1,5);
plot(t2,z,'linewidth',3);
xlabel('Time');
ylabel('Amplitude');
title('8PSK Signal');
grid on;
axis([0 1 -5 5]);

Now for the waveform created in MULTISIM. It consists of the following;

5 Resistors
1 Op-Amps
2 Function generator
2 DC source

Connect each component and it will give us the 8PSK waveform that we are expecting.
SCHEMATIC DIAGRAM
BPSK IN MATHLAB

BPSK IN MULTISIM

You might also like