$30
Exercise 1: FM Modulator
In FM modulation, information about the message signal is contained in the frequency of the modulated carrier waveform. The generalized function for FM signal is:
π(π) = π¨π ππ¨π¬(ππ
πππ + π½π(π)),
where
π½π(π) = ππ
π€π ∫ππ π(π)ππ,
π(π) is the message signal, and π€π represents the frequency sensitivity. The instantaneous frequency is:
ππ = ππ + π€ππ(π)
In particular, we will use the following equivalent form for the FM signal:
π(π) = π¨π ππ¨π¬(ππ
πππ)ππ¨π¬ (π½π(π)) − π¨π π¬π’π§(ππ
πππ)π¬π’π§ (π½π(π))
In the following figure, you can see an example of a message signal on the left and an FM modulated waveform on the right. Note the change in the frequency of the modulated signal in time.
The frequency deviation is defined as π«π = ππππ, where ππ = πππ|π(π)|, and the modulation index
(i.e., deviation ratio) is defined as
π«π
π = ,
π© where π© is the message bandwidth. Instructions:
1. Create a new project called “Lab 3” and a new module called “FM_Modulator.gvi”.
2. In “FM_Modulator.gvi”, generate a single tone message signal, and then using the “Waveform Properties”, “Integral x(t)”, “Sine and Cosine”, and “Build waveform” modules, create the FM signal using the equation above.
3. Create indicators for the message signal and the output FM signal in time and frequency domains.
4. Create a sub-VI including the necessary inputs and outputs.
Tasks:
Set the parameters as in the following table and observe the changes in the modulated signal.
Message signal frequency
1 kHz
Carrier signal frequency
10 kHz
Sample rate
200k
Samples
1k
kπ
[500,2000,5000]
Message signal amplitude
1
Carrier signal amplitude
1
Explain the resulting changes in the FM signal and its PSD as you change Δπ. Add the graphs of the FM signal and its PSD to your logbook for different Δπ. Include the block diagram of your FM_Modulator.gvi in your logbook.
Exercise 2: FM Demodulator
One way of demodulating the FM signal is by means of the so-called frequency discrimination, which is obtained by:
1. Transferring the changes in instantaneous frequency into changes in the amplitude of the output signal, by differentiating the FM signal. The output of the differentiator is an AM+FM modulated signal.
2. Demodulate the AM+FM signal by using an envelope detector (as in Exercise 1b of Lab 2).
Instructions:
1. Create a new VI and name it “FMDemodulator.gvi”.
2. Apply the Derivative x(t) found in the function palette on the FM signal.
3. After the differentiation, the remaining process is very similar to envelope detection in AM demodulation. Use exactly the same modules, and you will obtain the message signal. Remember to scale the amplitude appropriately.
4. Create a sub-VI and produce two outputs: demodulated signal in time, and demodulated signal PSD. Tasks:
Explain briefly the mathematical theory behind this demodulation technique.
Add the block diagram to your logbook.
Exercise 3: FM Simulation
In this part all the sub-VI’s that you have prepared will be used in a single VI, and you will be able to observe the entire process of FM modulation and demodulation.
Instructions:
1. Create a new file and name it “FMTopLevel.gvi”.
2. Add all the necessary VIs, and make the necessary connections.
3. Include all the setup in a while loop, and add a stop button.
4. Use the following values:
Message signal frequency
1kHz
Carrier signal frequency
10kHz
Sample frequency
200kHz
Samples
1k
Butterworth low-pass filters
Order: 5
Cut-off frequency: 1400Hz
Message signal amplitude
2
Carrier signal amplitude
2
kπ
1000
Tasks:
Add the block diagram to your logbook.
Set the parameters as in the above table. Observe the demodulated signal and attach the plots of the FM signal and the demodulated signal with their corresponding PSDs to your logbook (for the demodulated signal, you should also provide a zoomed version, without the initial transient, so that it is easy to observe the amplitude of the message).
Exercise 4: FM Communications via USRP
In this exercise, FM communication via USRP will be implemented. Instead of building the code yourself, you are given a file “FM-TxRx.gvi”. The code in the file should look familiar, but with only a slight difference: you only have one VI this time. This is no big deal since you could have also combined the AM communication VIs into a single one. LabView has the ability to execute two (or more) while loops simultaneously; and thus there is no difference between the two approaches.
Instructions:
1. Have a detailed look at the code and compare it with the FM receiver/transmitter developed in the previous exercises. Run the VI, adjusting the parameters to reasonable values, and make sure you are able to transmit and receive successfully.
Exercise 4a: Carson’s rule
The bandwidth of an FM signal is difficult to calculate analytically. In the 1920s J.R. Carson provided a rule of thumb for approximating the bandwidth:
π΅πΉπ ≅ 2(Δπ + π΅),
where π΅πΉπ is the bandwidth of the FM signal, Δπ is the frequency deviation of the signal, and π΅ is the message bandwidth.
Instructions:
1. The spectrum shown in the “FM spectrum” graph is identical to the power spectrum of the actual transmitted FM signal, except that the carrier will appear at 0 Hz, with the lower sideband on the negative-frequency side, and the upper sideband on the positive-frequency side.
2. To obtain the classic textbook FM spectrum, set the message as a single tone at 1 kHz. Run the transmitter and obtain power spectra of the transmitted signal for frequency deviations of 1 kHz, 5 kHz, and 30 kHz.
Task:
Add the power spectrum graph for each of these cases into your logbook. Be sure to scale the horizontal axis so that each spectrum is visible clearly. Annotate your spectra to show the FM signal bandwidth (Carson’s rule).
Exercise 5: Listening to FM Radio Using USRP (Bonus)
In this step you are expected to detect and listen to local radio stations through your USRP.
Detecting stations:
1. Open Find Radio Station.gvi file provided. This basic code reveals the power densities of frequencies around the carrier frequency that is entered.
2. Set the carrier frequency to 90 M and the IQ rate to 20M. Examine the Frequency plot obtained. The center of the graph (0) represents the chosen carrier frequency (90M) and the bandwidth is proportional to the chosen IQ Rate (+/- 10M in this case).
Task: Capture the data of the plot to explore it. Zoom in and try to find peaks on the graph. Each peak represents an FM signal detected by the USRP antenna. Change the parameters in Step 2 if necessary, and copy the obtained graph together with the chosen values to your logbook. According to your graph which FM station has the strongest signal?
Figure 3: Example of a peak detected from spectrum analysis.
Hint: If you are unable to see peaks in the plotted data, try to increase the gain to 10, 25 and 30. The signal for FM radio stations can be weak inside the laboratory.
Hint: If you get the ‘overflow errors’ message when running the VI, try to decrease the number of samples.
Instructions:
1. From the analysis of the spectrum, choose an FM frequency that seems to have a strong signal. If the previous step failed, try 98.8 MHz – BBC 1.
2. Open FM Music.gvi. Look at the code, and observe that a module is added to play the demodulated waveform.
3. Input the chosen carrier frequency and a coherent bandwidth (IQ Rate) to tune into an FM radio station.
Task:
Plug-in an earphone into the computer, turn the volume up and (hopefully!) enjoy the music!