Sie sind auf Seite 1von 11

Case Study

Software Simulation of Pulse Time Modulation Techniques


Introduction In recent years we have seen a growing interest in application of software simulation in communication engineering. With the hardware becoming more complex and costly, a way forward to many researchers and teachers would be first to implements the ideas in the software environment. Computer simulations in many cases are an attractive alternative to hardware implementation. The advantage would be that one is able to make significant changes readily with a press of a button. This allows testing of the system using idealised processing elements, which may take a significant time to design and realise in hardware. In addition, simulation can support the hardware design by giving optimised component values, for the critical parts, and an early indication of the performance of the system. In simulation information can be tabulated and plotted with ease. There are several commercial packages, which enable complex systems to be modelled. In this study a commercially available software package called Matlab is used to demonstrate how complex communication systems can be modelled and their behaviour explored. It is the intention of this case study to demonstrate that MATLAB can be used to implement complete communication systems as shown in Fig. 1.
Channel Output signal

Input signal
Transmitter

Modulator

Demodulator

Receiver

Noise

Fig. 1 A typical communication system block diagram.

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,

a11 a12 ... a1m A = a 21 a 22 ... a 2 m a a ... a 31 32 nm

(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.

Example: Amplitude modulation

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.

Case Study: Pulse Time Modulation


Digital communication systems can be implemented using a variety of different modulation schemes one of which is based on pulse time modulation (PTM) methods. In PTM schemes one of a range of time dependent features of constant amplitude squarewave carrier waveform is used to convey information (see Table 1). In this case study a PTM scheme known as pulse width modulation (PWM) was selected. The codes with slight modifications can be applied to the other PTM schemes. PWM and PPM are an attractive scheme for transmission of analogue and data signals compared with purely digital modulation techniques [3-6]. In PWM the width of a constant amplitude pulse

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:

Transmitter:- Modulating signal, ramp, PWM and PPM waveforms Channel:- Noise, PWM + Noise and PPM + Noise Receiver: Regenerated PWM, regenerated PPM and recovered modulating signal

System linearity test. This can be done by: 1. Transmitting a very low frequency ramp signal and comparing it with the received waveform 2. Plotting modulating signal amplitude (peak-to-peak) vs. modulation index 2nd and third harmonic distortion measured at the output stage Signal to noise ratio Vs. carrier to noise ratio. Change the set up parameters and repeat the simulation.
References
1. Matlab,: The MathWorks, Inc. (1993). 2. Prt-Enander, E., Sjberrg, A., Melin, B., and Isaksson, P.,: The Matlab handbook (Addison-Wesley, 1996). 3. Young, P.H.,: Electronic communication techniques (Macmillan Publishing Company 1990, 3rd Edition, pp.137-174).

4.

Arnold, J. M., and Berry, M.: 'Pulse width modulation for optical fibre transmission of video signals', IEE International Conference on impact of VLSI technology on communication systems, 1983, London. 5. Suh, S. Y.:"Pulse width modulation for analog fiber-optic communications", J. lightwave Technol., 1987, LT-5, pp. 102-112 6. Wilson, B., Ghassemlooy, Z.: "Optical pwm data link for high quality analogue and video signals', J. Physics E, 1987, 20, pp. 841-845

Professor Z Ghassemlooy

Modulating signal

DC level Ramp generator

+ Comparator PWM Pulse generator PPM

(a)
V Ramp

Input signal 0

PWM

Clock

Unmodulated position

Modulated edges PPM

(b)
PWM + noise
Slicer

time

PWM

PPM

+ Low pass filter Noise Generator

Channel PPM + noise

2
PWM

Lowpass filter

Output

(c)

Fig. 3 PPM/PWM system: (a) transmitter, (b) waveforms and (c) channel and receiver.

Appendix A AM Matlab codes:


echo on clear clc n=4096; fs=4000000; %sampling frequency; fm=50000; %modulating frequency; fc=500000;%carrier frequency; M=1; %modulation index; t=0:1/fs:n/fs; %time vector x= M*sin(2*pi*fm*t); % Modulating signal P=spectrum(x,n); A=[0 2000000 -5 0]; axis(A) specplot(P,fs),pause axis y=sin(2*pi*fc*t); %Sinewave carrier z=x .* y; %AM signal %rand('normal'); %Random noise %z=z+(1/416)*rand(t); %Plot AM signal pause % Strike any key for plot. plot(t(1:n/10),z(1:n/10)), title('Time Domain Waveform'), .. xlabel('Time (s)'), pause %meta %x=[]; y=[]; pack clc P=spectrum(z,n); % AM spectrum axis(A) specplot(P,fs),pause axis %meta %demodulator %local carrier frequency; %w=sin((2*pi*fc*t)); %frequency error in local oscillator %w=sin((2*pi*(fc-1000)*t)) %phase error in local oscillator %+30*pi/180); %modulation is demodulation! %v = z .* w; v = z*Z; z=[];w=[];P=[];

10

z=[];p=[]; pack pause % Strike any key for plot. plot(t(1:n/10),v(1:n/10)), title('Time Domain waveform'),... xlabel('Time (s)'), ylabel('Amplitude(V)'),pause %meta P=spectrum(v,n); axis(A); specplot(P,fs),pause axis; %meta P=[]; pack %low pass filter; %cutoff frequency; fco=100000; [b,a] = butter(4,(fco)*2/fs); y = filter(b,a,v); plot(t(1:n),y(1:n)),title('Baseband signal'),... xlabel('Time(s)'), ylabel('Amplitude(v)'),pause %meta P=spectrum(y,n); axis(A); specplot(P,fs),pause axis %specplot(P(1:50),fs*50/2048);pause %meta

11

Das könnte Ihnen auch gefallen