ISLAMIC UNIVERSITY OF TECHNOLOGY (IUT)
ORGANISATION OF ISLAMIC COOPERATION (OIC)
DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING (EEE)
COURSE: EEE 4404 (COMMUNICATION ENGINEERING I LAB.)
EXPERIMENT NO. 04
FREQUENCY SHIFT KEYING (FSK)
PART-A: HARDWARE
OBJECTIVE:
1. To examine the frequency shift keying (FSK) modulation.
2. To modulate data using frequency shift keying.
.
INTRODUCTION:
The three main types of digital modulation are Frequency Shift Keying (FSK), Phase Shift Keying (PSK) and
Amplitude Shift Keying (ASK). If we wish to send any digital signals from one place to another, we have to choose a
method of transmission. Digital data transmission is possible over simple wire without any modulation. There are some
situations (like long distance) where the simple wire would not be satisfactory connections.
When the direct wire connection is not acceptable, we often use radio transmission. It is not possible to send
the logic levels directly by means of a radio transmitter-it just would not work. The problem is that in order to make the
radio work, we have to use very high frequencies, often much higher than the rate at which we send logic signals. It is
needed to combine two different signals-one to carry the data, we call it a carrier and the digital data that we wish to
send. The process of combining frequencies is called modulation. At the receiver end, we have to separate the two
signals by a process called demodulation. We finish up with the high frequency ‘carrier’ signal which we discard and
the digital information, which we keep. Modulation with carriers is also used in telephone networks. It allows many
different data streams to be transmitted down the same cable. The modulation and demodulation processes are exactly
the same as for a radio link.
FSK Modulation
The Frequency Shift Keying modulation is simple like as ASK. We have seen how the ASK modulation used the logic
levels in the data to control the amplitude of the carrier wave.
Now, we look at another system, FSK, in which we use the logic levels to control the frequency of the carrier.
Lab Sheet Revised by: Hasan Jamil Apon, Lecturer, EEE Department, IUT Page 1 of 7
Fig. 4(a): Waveform Diagram of FSK Modulation.
There are many different ways of generating an FSK waveform. One way is to treat it as the combination of two
different ASK waves. Let us assume that we apply the above data stream to an ASK modulator using the higher
frequency as the carrier.
Fig. 4(b): Block Diagram of FSK Modulator.
Lab Sheet Revised by: Hasan Jamil Apon, Lecturer, EEE Department, IUT Page 2 of 7
This is the resulting output:
Fig. 4(c): ASK of original data.
We now invert the original data stream.
Original Data: 0 1 1 0 0 0 1 0 1 1
Inverted Data: 1 0 0 1 1 1 0 1 0 0
If we now apply the inverted data to an ASK modulator using a lower frequency for the carrier, we will get the original
data 0 periods filled with a lower frequency carrier.
Fig. 4(d): ASK of inverted data.
The last stage in generating an FSK waveform is very simple – we just have to add the two waveforms together.
Here is the final waveform:
Fig. 4(e): Final FSK waveform.
Lab Sheet Revised by: Hasan Jamil Apon, Lecturer, EEE Department, IUT Page 3 of 7
Frequency Shift Keying Demodulation
The demodulation of frequency shift keying performed by phase locked loop (PLL). A PLL is a circuit which can
convert a change of frequency into a change in DC voltage level. This is just what we want. The original dada generated
two different frequencies to be transmitted. At the receiver the PLL can be used to recover the two different voltage
levels contained in the data stream.
The output still contains components of the two carrier frequencies which are removed by a low pass filter and the
resultant rounded waveform is squared up by a comparator. These last two steps are exactly the same as in the ASK
demodulator.
EQUIPMENT:
1. MODICOM 3/1 board,
2. MODICOM 5/1 board,
3. Power supply (IC Power 60),
4. Oscilloscope, and
5. Connecting Wires.
KNOWLEDGE PROFILE AND APPLICATION:
1. Digital Modulation,
2. FSK Modulation & Demodulation, and
3. MATLAB Coding.
EXPERIMENT PROCEDURE:
1. Before making any electrical connection, ensure that all of the electrical equipment in is initially switched off.
2. Set up the MODICOM 3/1 board as follows:
• Mode switch set to fast.
• Sync Code Generator switched OFF.
• Error Check Code Generator switches to A = 0 and B = 0.
• Switch Faults – all switched OFF.
3. On the MODICOM 5/1 board, check that the Mode switch is set to position 1.
Fig. 4(f): Electrical Connection Diagram.
Lab Sheet Revised by: Hasan Jamil Apon, Lecturer, EEE Department, IUT Page 4 of 7
4. Connect power supply to MODICOM 3/1 and MODICOM 5/1 according to the figure shown in Fig. 4(f).
Make the following two connections:
• MODICOM 3/1 Tx Clock Output (tp3) to MODICOM 5/1 Tx Clock Input
• MODICOM 3/1 Tx Data Output (tp44) to MODICOM 5/1 Tx Data Input
5. On MODICOM 3/1, connect the DC1 output on the function generator block to the Channel 0 (CH.0) input
tp10 and then connect a wire from this point (CH.0) to Channel 1 (CH.1) input tp12.
6. Now switch ON the power supply. We are now able to supply the same DC voltage level to each of the
channels. Remember that the two channels are going to be multiplexed together by TDM.
7. Adjust the DC1 preset until the A/D Converter LEDs show the value:
D6 D5 D4 D3 D2 D1 D0
0 1 0 0 0 1 1
8. Connect the oscilloscope’s external trigger input to MODICOM 3/1’s Tx To Output signal at tp4 and switch
the oscilloscope to external, negative edge triggering.
9. Use oscilloscope to observe the Data Clock output at tp4 in MODICOM 5/1’s Data Conditioning block up in
the top left of the board.
10. Adjust the oscilloscope’s time base and X-position controls until each rising edge of the data clock coincide
with one of the oscilloscope’s vertical lines. The square clock pulse train which is going to be used for timing
purposes in all the data conditioning processes. By aligning it with the graticule lines each main division on the
oscilloscope's horizontal axis is now equal to one data bit time and will be a convenient reference against which
to observe the waveforms. It may be necessary to adjust the oscilloscope’s trigger level manually to obtain a
stable trace.
11. Now make the following connection on MODICOM 5/1:
• NRZ (L) output tp5 to ASK Modulator input tp29
• Modulation input tp29 to Data Inverter input tp19
• Modulator output tp30 to Summing Amplifier input tp34
• 1.44MHz Carrier tp25 to Carrier input tp28
• Data Inverter output tp20 to Modulation input of Modulator 2 tp32
• 950kHz(I) Clock tp26 to Modulator 2 Carrier input tp31
• Modulator 2 output tp33 to Summing Amplifier input tp35
12. Use one oscilloscope channel to observe NRZ (L) data at tp5 of MODICOM 5/1 and use another channel of
oscilloscope to observe modulated FSK waveform at tp36. Keep both the channels of oscilloscope ON. Now
compare the modulated FSK signal to data input signal.
13. On your workbook, draw (in pencil) the clock pulses and the whole waveforms that you observed on
oscilloscope trace.
14. Switch OFF the power supply and disconnect all electrical connections.
REPORT QUESTIONS:
• What are the differences between FM and FSK modulation?
• Which modulation technique is better: ASK or FSK? Explain why.
• What are the similarities between ASK demodulator and FSK demodulator?
REFERENCES:
This lab sheet has been prepared based upon the Curriculum Manual CT05 of the MODICOM Board, LJ Technical
Systems.
Lab Sheet Revised by: Hasan Jamil Apon, Lecturer, EEE Department, IUT Page 5 of 7
PART-B: SOFTWARE
FSK Modulation & Demodulation using MATLAB
Line MATLAB Program: FSK Modulation & Demodulation.
1 clc; clear all; close all;
2
3 x=[1 0 0 1 1 0 1]; % Binary Information
4 bp=.000001; % bit period
5 disp('Binary information at Transmitter :');
6 disp(x);
7 %representation of transmitting binary information as digital signal
8 bit=[];
9 for n=1:1:length(x)
10 if x(n)==1;
11 se=ones(1,100);
12 else x(n)==0;
13 se=zeros(1,100);
14 end
15 bit=[bit se];
16 end
17 t1=bp/100:bp/100:100*length(x)*(bp/100);
18 subplot(3,1,1);
19 plot(t1,bit,'b','lineWidth',2.5);
20 grid on;
21 axis([ 0 bp*length(x) -.5 1.5]);
22 ylabel('amplitude(volt)');
23 xlabel('time (sec)');
24 title('transmitting information as digital signal');
25
26 %% FSK modulation
27 A=5; % Amplitude of carrier signal
28 br=1/bp; % bit rate
29 f1=br*8; % carrier frequency for information as 1
30 f2=br*2; % carrier frequency for information as 0
31 t2=bp/99:bp/99:bp;
32 ss=length(t2); m=[];
33 for (i=1:1:length(x))
34 if (x(i)==1)
35 y=A*cos(2*pi*f1*t2);
36 else
37 y=A*cos(2*pi*f2*t2);
38 end
39 m=[m y];
40 end
41 t3=bp/99:bp/99:bp*length(x);
42 subplot(3,1,2);
43 plot(t3,m,'c','linewidth',2.5);
44 xlabel('time (sec)');
45 ylabel('amplitude(volt)');
46 title('FSK modulated waveform');
47
48 %% FSK demodulation
49 mn=[];
50 for n=ss:ss:length(m)
51 t=bp/99:bp/99:bp;
52 y1=cos(2*pi*f1*t); % carrier signal for information 1
53 y2=cos(2*pi*f2*t); % carrier signal for information 0
54 mm=y1.*m((n-(ss-1)):n);
mmm=y2.*m((n-(ss-1)):n);
55
56
t4=bp/99:bp/99:bp;
Lab Sheet Revised by: Hasan Jamil Apon, Lecturer, EEE Department, IUT Page 6 of 7
57 z1=trapz(t4,mm) % integration
58 z2=trapz(t4,mmm) % integration
59 zz1=round(2*z1/bp)
60 zz2= round(2*z2/bp)
61 if(zz1>A/2) % logic lavel= (0+A)/2 or (A+0)/2 or 2.5 ( in this case)
62 a=1;
63 else(zz2>A/2)
64 a=0;
65 end
66 mn=[mn a];
67 end
68 disp('Binary information at Reciever:'); disp(mn);
69
70 %% Representation of binary information as digital signal which achieved
71 %after demodulation
72 bit=[];
73 for n=1:length(mn);
74 if mn(n)==1;
75 se=ones(1,100);
76 else mn(n)==0;
77 se=zeros(1,100);
78 end
79 bit=[bit se];
80 end
81 t4=bp/100:bp/100:100*length(mn)*(bp/100);
82 subplot(3,1,3)
83 plot(t4,bit,'g','Linewidth',2.5);
84 grid on;
85 axis([ 0 bp*length(mn) -.5 1.5]);
86 ylabel('amplitude(volt)');
87 xlabel('time (sec)');
88 title('FSK demodulated waveform');
ASSIGNMENT:
• Copy the previous code and paste it in MATLAB Editor. Attach all the results and waveshapes in your lab
report. Now, describe the code line by line by your own sentence (hand written form). Do not copy from your
friends. If you face any problem understanding any of the line, you can directly ask me.
Lab Sheet Revised by: Hasan Jamil Apon, Lecturer, EEE Department, IUT Page 7 of 7