OBJECTIVES:
To verify the principles of amplitude modulation (AM) and demodulation.
EQUIPMENT:
Laptop Matlab 6.xx
BACKGROUND:
Things you should know... You should understand what is meant by the following terms before undertaking this lab. Some of the terms are explained below but others you will need to look up for yourself. bandwidth bandpass baseband modulation envelope Why do we modulate signals for transmission? In general, we use modulation to give the transmitted signal properties which are best suited to the transmission channel or environment. Specifically, modulation is the process of imparting the source information onto a bandpass signal with a carrier frequency, fc, by the introduction of amplitude or phase perturbations or both. This bandpass signal is called the modulated signal and the baseband source signal is called the modulating signal. At the receiver a means to translate the higher frequencies back to the audio range is implemented and this is demodulation.
Amplitude Demodulation
There are a number of available techniques for demodulating AM signals. We will be using two techniques in this laboratory. The first technique we shall use in this laboratory is envelope detection. The advantage of an envelope detector is its simplicity. In terms of hardware the envelope detector consists of a diode and a low pass filter. The second technique is synchronous or coherent detection (also called product detection, and depends crucially on the carrier sinusoid in the receiver being as close as possible in frequency (within 10Hz or so) to the original carrier. If the two sinusoids are too different distortion will be heard in the demodulated signal. In this technique the message signal is recovered in two stages. In the first stage intermediary signal with a baseband component and a high frequency component is obtained by multiplying the received signal by a sinusoid of the same frequency as the original carrier (see the trigonometric identities). In the second stage a low pass filter is used to remove the non-audio (high frequency) component of the intermediary signal. Thus the resulting output signal is a reconstruction of the audio frequency message signal.
Creating M-files
What is an m-file?
An m-file, or script file, is a simple text file where you can place Matlab commands. When the file is run, Matlab reads the commands and executes them exactly as it would if you had typed each command sequentially at the Matlab prompt. All m-file names must end with the extension '.m' (e.g. plot.m). If you create a new m-file with the same name as an existing m-file, Matlab will choose the one which appears first in the path order (help path for more information). To make life easier, choose a name for your m-file which doesn't already exist. To see if a filename.m exists, type help filename at the Matlab prompt.
Exercise 1:
1- Create a new M-file. 2- Enter the following clear [y,fs,n]=wavread('hugo'); fs n disp('paused. Press any key to play the wave file'); pause; sound(y); 3- Save the file as Test.m. 4- At Matlab command prompt enter 'test'.
PROCEDURE:
Amplitude Modulation
In Amplitude modulation the following complex envelope is used.
g (t ) = Ac [1 + m(t )]
c = 2f c
Create an M-file name it AM.m. Type the following. fs = 2000; d = 0.05; n = fs * d; t = (1:n) / fs; % this is the sampling frequency % the duration of the signal. % total number of samples %time vector
First we create our signal. It will be a sinusoidal signal with frequency mf= 100hz mf = 100; m = cos(2 * pi * mf * t); plot(t,m); Save you file and type AM at Matlab commend prompt Now create the carrier. Create another sinusoidal signal c(t) with cf =1000hz. Call it c And plot it. What are the peak values (min and max) for m(t)?
What would be the % modulation, %positive modulation and %negative modulation for this m(t) given Ac=1? Now it is time for the modulation. Ac=1; s = Ac*(1+m) .* c; plot(s); now, plot the AM signal. What happen if you multiply m by 0.5.. what is the %modulation in this case? use .* to multiply vectors elements
What happen if you multiply m by 1.5.. what is the %modulation in this case? Create a M-file and plot 4 figures, one for your signal m(t), one for carrier c(t), one for the modulated signal s(t), and the last one for the spectrum for s(t). Hint: use subplot to divide your figure.
s = Ac * m. * m. * c
Using Simulink
Simulink is an extension to Matlab. It allows us to use icons and block to represent our processes. Instead of writing codes for our process we can use a graphical interface where we drag and drop out block into the working space. And link the blocks to gather. Then we run it. This is a simple example of Simulink to multiply two numbers. You got a big library from which you can select your input.
To start Simulink, first start Matlab then type 'simulink' you will got two windows one for the library of blocks
Where m(t) is a sinusoidal function. So we got four inputs. AC and 1 which are constants, and two sinusoidals for our message and carrier. 1- From our library browser we go to Simulink > Sources, we drag two constants and two sine waves. And name them with appropriate names.
2- Double click on the Signal wave. Change the Frequency to 5 (rad/sec) and change sample time to 1/100. 3- Do the same for the carrier but with Frequency =1000. Now we are done with the input. Let's link them to gather. We will need some math operation so from the library browser. 4- Go to Simulink > Math Operations. Drag one Product block and one Sum block.
5- Now link the Signal and the Constant 1 to the Sum operation inputs. 6- Double click in the Product block. Make the number of inputs 3 instead of two so we can multiply 3 blocks in one process. 7- Now link the Carrier, the AC constant and the output of Sum to the input of the Product block. Now wee need to add a block to show the output 8- Go to Simulink > Sinks. Drag one Scope.
9- Link the output of the Product to the Scope. 10Now run your model and double click one the scope. You will see your modulated signal.
This is a modified version of our system I've added a scope to see our original signal and spectrum scope to see the spectrum of our modulated signal.
Assignment i. Simulation 1
The below Figure, shows the implementation of a DSB-SC signal. The Signals are at 1kHz and 10kHz. Implement and simulate this modulation.
1. Visualize the spectrum output (BFFT). It can be seen that the output consists of just two side bands at 9 kHz and 11 kHz why?
ii.
Simulation 2
The figure below show the experiment of an amplitude modulation for modulation index a = 1 and 0.5. The equation of this AM is given by:
s (t ) = k m [1 + a.m(t )] cos( wc )
c = 2 (10000 ) Represent the signal s(t) in both time-domain and frequency domain when k m=1 for a=1 and a=0.5.
and