Beruflich Dokumente
Kultur Dokumente
Input signal
Transmitter
Modulator
Demodulator
Receiver
Noise
Brief Introduction to Matlab The Matlab software was initially developed to be a matrix laboratory. It is gradually evolved to be an interactive programming language for scientific and engineering computation. The basic
units of operation in Matlab are matrices. A matrix is a set of numbers arranged in one or more rows. Each element within the matrix can be referred to by its location in a row and column. For example the element anm is located in the nth row and mth column of the matrix A shown below,
(1)
Matlab enables matrices to be easily manipulated, for example they can be added, subtracted, multiplied, divided, transposed, etc. Matlab has numerous toolboxes, which facilitate complex scientific and engineering mathematical operations to be carried out with a minimum amount of programming. Matlab programming language is developed in such a way that it can be learnt with ease [2]. The order in which the statements are executed in Matlab can be controlled by the use of flow control characters such as IF, FOR and WHILE. In order to demonstrate the simplicity of Matlab programming, a simple Matlab program it shown below. The comments appear after the % sign and they are included for documentation purposes. The program asks for a value for the radius of a circle. If the entered value is a negative number, an error massage is printed and a new value is requested. When a positive number is entered the area of the circle is computed and is displayed on the screen. Matlab can produce both planer and 3 dimensional plots. A simple Matlab program
% Program to calculate the area of a circle r = input (Enter a value for radius : ) % check for correct value for radius while r < 0 fprintf(Note: Radius should be positive) r = input (Enter another value for radius : ) end % calculate area area = pi * r .^2
Modulation
Modulation is an essential process in telecommunication since it enables multiple signals to be transmitted simultaneously over a common medium or communication channel. The process involves transferring the information from the signal to be transmitted (i.e. the modulating signal) to a high-frequency signal known as the carrier. For a sinusoidal carrier, the amplitude, frequency or phase can be varied by the modulating signal. When the amplitude of the carrier signal is varied in accordance with the modulating signal, the form of modulation is known as amplitude modulation. On the other hand if the frequency or phase of the carrier signal is varied, the result is frequency or phase modulation, respectively.
Amplitude modulation (AM) is used in applications such as radio and television Broadcasting. An amplitude modulated carrier signal; e(t) can be expressed as [Young, 1990],
e(t ) = E c [1 + M cos(2f m t )]cos(2f c t )
(2)
Where, Ec and fc are the amplitude and frequency of the carrier signal, respectively, M = EC/EM is the modulation index, and Em and fm are the amplitude and frequency the modulating signal, respectively. The essential Matlab code segments for simulating AM are shown below. AM simulation codes.
%generate modulating signal fm=1.0e+4;% frequency (Hz) m=0.5; %modulation index t=0:0.4e-3/10000:0.4e-3; %time vector, xm=cos(2*pi*fm*t);%modulating signal %generate carrier signal fc=1.0e+6; %frequency(Hz) ec= 1; amplitude(V) xam= ec(1+m*xm).*cos(2*pi*fc*t); %AM signal magspec= abs(fft(xam)); %generates the AM spectrum
Figure 2 shows the results obtained when executing the above program. The modulating signal of 10 kHz is shown in Fig. 2.a. The resulting AM signal, with M = 50 % and a carrier frequency of 1 MHz, and its frequency spectrum are shown in Figs. 2. and 2.c, respectively. The spectrum
consists of the carrier at 1 MHz and a period of side bands at 1 MHz 1 kHz. Increasing the modulation index M to 1.5 results in over modulated waveform as shown in Fig. 2.d.
Fig. 2 AM simulation results: (a) modulating signal, (b) AM waveform, (c) AM spectrum and (d) over modulated AM waveform.
carrier is changed according to the sample values of the modulating signal. Figure 3 shows a block diagram and waveforms associated with a simple PWM system. At the transmitter the analogue signal and a sawtooth ramp are compared directly at the input of a comparator, the output of which is the PWM pulse train. PPM is simply generated by differentiating PWM pulse train. The duration of the kth plus is given as:
k = 0 [1 + Mm( kTc )]
(3)
where 0 is the unmodulated pulse width representing Mm(Tc) = 0, and M is the modulation index = 2/Tc, Tc is the sampling interval, and m(t) = sin mt is the single tone modulating signal .
Table 1 PTM
Possible schemes Pulse width modulation (PWM) Pulse position modulation(PPM) Pulse interval modulation(PIM) Pulse interval and width modulation (PIWM) Pulse frequency modulation (PFM) Squarewave FM (SWFM) Variable Width (duration) Position Interval (space) Interval and width Frequency Frequency
The resulting spectra for a trailing edge modulated naturally sampled PWM waveform may be expressed as:
ns
( t ) =
1 2
M 2
sin J
0
t +
sin sin
n = 1
( n n ( n
t ) t n )
n = 1
( n M n J sin
k
(4)
n = 1
k = 1
( n M ) n [ ( n c + k
) t n ]
Where M = modulation index (0<M<1), and m and c are the modulating signal and the carrier frequencies respectively. Jk(x) is a Bessel function of the first kind, order k. In the absence of a modulating signal (M = 0) this series reduces to the Fourier series of the square carrier wave. With the modulating signal present a diminishing series of sidetones are generated around the carrier frequency and all its harmonics and separated by a frequency equal to that of
the input signal m (term 5) along with a baseband component (term 2), see Fig.4. As the
Fig. 4 PWM modulation spectrum. modulation index is increased the number of sidetones and their amplitude increase with respect to the sampling frequency and input signal component, effectively limiting the distortion performance for a given ratio of sampling frequency to maximum input frequency. An improved distortion performance for a given modulation index, assuming that the distortion is above the noise threshold, can only be achieved by increasing the sampling ratio, thereby also increasing the bandwidth of the modulated signal.
During signal transmission the PWM and PPM signals will be corrupted by noise and this was simulated by adding white Gaussian noise signal. The noise is band limited and the channel was modelled as a simple first order low pass filter. At the receiver, the received PPM pulse train is passed through a slicer in order to reshape the pulse train and eliminate the amplitude noise. PPM (with clock pulses) signal is then converted back into PWM by using a divide by two circuits. The regenerated PWM signal is then passed a high order low pass filter in order to recover the information signal.
System Specifications
Transmitter:
- Modulating Single: Sinewave with amplitude = 3V and Frequency = 10 kHz. - Carrier signal: Ramp waveform: amplitude = 5 V - Sampling ratio: 10, 5, and 3 - Modulation index: 50%, 25%, and 10% - PWM/PPM: Unipolar with amplitude of 5 V - PPM duty cycle: Student to select
Channel: - A simple low pass filter:- bandwidth; 300 kHz, 200 kHz, 100 kHz - Noise: bandlimited white noise with bandwidth: 100 kHz, 50 kHz, and 20 kHz Receiver: - Slicer: Threshold level set by the students. - Low pass filter:- type: chose any, order: 6th, bandwidth: 10 kHz and gain: optional. For a given set of parameters: i.e. modulation index, sampling ratio, channel bandwidth, simulation should be carried out to show: Time domain waveforms and frequency spectra: