You are on page 1of 7

Question 2: - Write a MATLAB program to determine the free space path loss and power

received by antenna.

Ans: - The free space path loss, FSPL, is used in many areas for predicting radio signal strengths
that may be expected in a radio system.

Although the free space path loss does not hold for most terrestrial situations because of other
effects from the ground, objects in the path and the like, there are still very many situations in
which it can be used. It is also useful as the basis for understanding many real life radio
propagation situations.

Accordingly, the free space path loss, FSPL, is an essential basic parameter for many RF
calculations. It can often be used as a first approximation for many short range calculations.
Alternatively it can be used as a first approximation for a number of areas where there are few
obstructions. As such it is a valuable tool for many people dealing with radio communications
systems.

Free space path loss formula: -


The free space path loss formula or free space path loss equation is quite simple to use. Not only
is the path loss proportional to the square of the distance between the transmitter and receiver,
but the signal level is also proportional to the square of the frequency in use for other reasons
explained in a section below.
Where:
FSPL is the Free space path loss
d is the distance of the receiver from the transmitter (metres)
is the signal wavelength (metres)
f is the signal frequency (Hertz)
c is the speed of light in a vacuum (meters per second)

Free space loss formula frequency dependency


Although the free space loss equation given above seems to indicate that the loss is frequency
dependent. The attenuation provided by the distance travelled in space is not dependent upon the
frequency. This is constant.
The reason for the frequency dependence is that the equation contains two effects:

1. The first results from the spreading out of the energy as the sphere over which the energy
is spread increases in area. This is described by the inverse square law.
2. The second effect results from the antenna aperture change. This affects the way in which
any antenna can pick up signals and this term is frequency dependent.

MATLAB code: -

clc; %to clear the screen


clear all; %clear all previous value
close all; %close all previous open window
D=0:0.1:10 %Input frequency in Mhz
F=input('Frequancy in MHz'); %Input frequency of transmitted signal
Pi= input('Transmitted signal power'); % Input transmitted power in decibels
Gt= input('Gain of the transmitted antena'); % Input transmitted gain in
decibels
Gr= input('Gain of the receiver antena'); % Input received gain in decibels
FSPL= 20*log(D)+20*log(F)+32.44 %Formula to calculate FSPL
Pr= Pi+Gt+Gr-FSPL %Formula to calculate recieved power
plot(D,Pr) %For plotting graph
xlabel('Distance')
ylabel('Power of receiver')

MATLAB RESULT: -
CONCLUSION: -

After entering all the required data in the matlab, it can be clearly stated that the obtained graph
is non linear and the value of the power in the receiver decreases with the increase in distance.
Question 3: - Write a MATLAB code for ASK & FSK digital modulation schemes.

Amplitude Shift Keying:

t is a form of amplitude modulation that represents digital data as variations in the amplitude of a
carrier wave. Binary symbol 1 is represented by transmitting carrier wave of fixed amplitude and
fixed frequency for the bit duration T seconds. ASK refers to a type of amplitude modulation that
assigns bit values to discrete amplitude levels. The carrier signal is then modulated among the
members of a set of discrete values to transmit information. Values are represented by different
amplitudes of carrier wave. Usually, one amplitude is zero, i.e., presence and absence of carrier is
used. Used over optical fiber. The equation of the wave generated by the ASK is given by the
following waveform:

Frequency Shift Keying:

Frequency-shift keying (FSK) is a method of transmitting digital signals.The two binary states,
logic 0 (low) and 1 (high), are each represented by an analog waveform. Logic 0 is represented
by a wave at a specific frequency, and logic 1 is represented by a wave at a different frequency. A
modem converts the binary data from a computer to FSK for transmission over telephone lines,
cables, optical fiber, or wireless media. The modem also converts incoming FSK signals to
digital low and high states, which the computer can "understand."

MATLAB CODE: -

FSK

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
fc1=input('Enter the freq of 1st Sine Wave carrier:');
fc2=input('Enter the freq of 2nd Sine Wave carrier:');
fp=input('Enter the freq of Periodic Binary pulse (Message):');
amp=input('Enter the amplitude (For Both Carrier & Binary Pulse Message):');
amp=amp/2;
t=0:0.001:1; % For setting the sampling interval
c1=amp.*sin(2*pi*fc1*t);% For Generating 1st Carrier Sine wave
c2=amp.*sin(2*pi*fc2*t);% For Generating 2nd Carrier Sine wave
subplot(4,1,1); %For Plotting The Carrier wave
plot(t,c1)
xlabel('Time')
ylabel('Amplitude')
title('Carrier 1 Wave')
subplot(4,1,2) %For Plotting The Carrier wave
plot(t,c2)
xlabel('Time')
ylabel('Amplitude')
title('Carrier 2 Wave')
m=amp.*square(2*pi*fp*t)+amp;%For Generating Square wave message
subplot(4,1,3) %For Plotting The Square Binary Pulse (Message)
plot(t,m)
xlabel('Time')
ylabel('Amplitude')
title('Binary Message Pulses')
for i=0:1000 %here we are generating the modulated wave
if m(i+1)==0
mm(i+1)=c2(i+1);
else
mm(i+1)=c1(i+1);
end
end
subplot(4,1,4) %For Plotting The Modulated wave
plot(t,mm)
xlabel('Time')
ylabel('Amplitude')
title('Modulated Wave')

ASK

clc
clear all
close all
F1=input('enter carrier frequency')
F2=input('enter input frequency')
A=4;
t=0:0.0001:1;
x=A*sin(2*pi*F1*t)
subplot(3,1,1)
plot(t,x)
M=A/2*square(2*pi*F2*t)+(A/2);
subplot(3,1,2)
plot(t,M)
u=x.*M
subplot(3,1,3)
plot(t,u)

MATLAB RESULT: -

Graph for ASK modulation schemes.


4

-2

-4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

20

10

-10

-20
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Figure 1: Graph for ASK modulation schemes.

Graph for FSK modulation schemes.

Carrier 1 Wave
5
Amplitude

-5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time
Carrier 2 Wave
5
Amplitude

-5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time
Binary Message Pulses
10
Amplitude

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time
Modulated Wave
5
Amplitude

-5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time

Figure 2: Graph for FSK digital modulation schemes.

Conclusion: -
After entering the value of the carrier frequency for different signals and the value of the
amplitude , it can be clearly seen from the obtained graph that both the carrier wave and the
message signal gets modulated to give the desired output for the minimum loss and maximum
distance transmitting character of the wave for the purpose of communication.

You might also like