You are on page 1of 50

Bilkent University Department of Electrical and Electronics Engineering Spring 2012-2013 EEE 432 Telecommunications II Project Assignment I

Alican Nalci, 20902058 October 6, 2013

Contents
1 Introduction 2 Work 2.a A scatter plot of the 16-QAM signal constellation . . . . . . . 2.b Set = 0.5 and modulate a random data sequence {mk } . . . 2.b.1 Generation of the Root Raised Cosine Pulse: . . . . . 2.b.2 Generation of Baseband 16-QAM modulated signal s (t): 2.b.3 Plot sI [n] and sQ [n] for the rst 30 symbols . . . . . . 2.b.4 Plot the eye diagrams for sI [n] and sQ [n] . . . . . . . 2.b.5 Plot the power spectral density of sI [n] . . . . . . . . 2.c Repeat part (2.b) for = 0.2 and = 0 . . . . . . . . . . . . 2.c.1 Plot sI [n] and sQ [n] for the rst 30 symbols = 0.2 . 2.c.2 Plot the eye diagrams for sI [n] and sQ [n] for = 0.2 . 2.c.3 Plot the power spectral density of sI [n] for = 0.2 . . 2.c.4 Plot sI [n] and sQ [n] for the rst 30 symbols = 0 . . 2.c.5 Plot the eye diagrams for sI [n] and sQ [n] for = 0 . . 2.c.6 Plot the power spectral density of sI [n] for = 0 . . . 2.d Repeat part (2.b) with higher data rate T = 1/3600 . . . . . 2.d.1 Plot sI [n] and sQ [n] for the rst 30 symbols = 0.5 and T = 1/3600 . . . . . . . . . . . . . . . . . . . . . . 2.d.2 Plot the eye diagrams for sI [n] and sQ [n] for = 0.5 and T = 1/3600 . . . . . . . . . . . . . . . . . . . . . . 2.d.3 Plot the power spectral density of sI [n] for = 0 and T = 1/3600 . . . . . . . . . . . . . . . . . . . . . . . . 3 Conclusion 4 Code Appendix 5 References 3 4 4 7 7 9 12 14 17 18 20 21 24 27 28 29 31 33 35 38 41 42 50

Introduction

In this project assignment, we are asked to implement a Mary QAM modem to modulate random data sequences, while doing the modulation root raised cosine pulse with dierent parameters is used. For dierent values of roll of factor and symbol rate, the constructed system is simulated to check requirements such as inter-symbol interference and bandwidth requirements. This project assignment is a part of a bigger project, and only baseband modulation assessments were done for this assignment. The work are divided into sub sections presented in chapter 2. During the simulations, Matlab is used, especially for the root raised cosine pulse communications toolbox is used. In the Conclusion chapter, an overview of the project is given, and all the codes are included in the code appendix section.

2
2.a

Work
A scatter plot of the 16-QAM signal constellation

Since we are doing a 16-QAM baseband modulation for this assignment, we would like to see how a 16-QAM symbol is formed. In a typical QAM constellation it is permitted to transmit several bits in a single symbol, in the generic case if n is the number of bits to be transmitted over the communication medium, then 2n is the order of our QAM constellation. For the specic case of 16-QAM modulation, we transmit 4 bits per symbol, which obeys 24 = 16. Below is a gure that shows the bits per symbols of various MAry transmission schemes.

Figure 1: Bits per symbols and symbol rate for various modulation schemes By increasing the size of our QAM constellation, such as having 64-QAM instead of 16-QAM, we can transmit more bits, in fact two more bits, hence we can send data at higher rates, however this comes at an expense of more transmit power to ensure the same probability of bit error [1]. For our case however, we are only interested in 16-QAM system, in which 4 bits are used to represent a symbol. The Matlab function which generates the scatter plot of the 16-QAM signal constellation is given below along with the commands that invoke the function. The commands that invoke the function:
%% Question A: Scatter Plot for the 16-QAM signal constallation %%Function scatter is used inside the QAM_Generate function below. QAM_Input = LINSPACE( 0, 15, 16); [Ak, Bk, ak, bk] = QAM_Generate(QAM_Input,M);

The function that creates the 16-QAM signal constellation:


function [ Ak, Bk, ak, bk ] = QAM_Generate( QAM_Input, M ) %QAM_GENERATE %For the M =16 case chart below shows, %how ak and bk are obtained. However this function %works for any M, it is generic. % % Mk bk ak % % ----------------------% 0 0 0 % 1 0 1 % 2 0 2 % 3 0 3 % 4 1 0 % 5 1 1 % 6 1 2 % 7 1 3 % 8 2 0 % 9 2 1 % 10 2 2 % 11 2 3 % 12 3 0 % 13 3 1 % 14 3 2 % 15 3 3 %-----------------------%We see that Ak is the remainder %of Mk from mod 4 operation, and Bk %is the quotient of Mk from mod 4 operation. ak = rem(QAM_Input,sqrt(M)); bk = floor(QAM_Input./sqrt(M)); %We shift the mean of ak and bk to 0. Ak = 2.*ak -sqrt(M)+1; Bk = 2.*bk -sqrt(M)+1; f = scatterplot(Ak+j*Bk); print(f,-dpng,-r300, [Scatter]); end

When the function QAM_Generate is executed with the given commands, it generates the scatter plot as given below:

Figure 2: A scatter plot of the 16-QAM signal constellation with zero mean In the gure we see that there are two axes representing two basis vectors that span a 2D Suclidean Space, one is named the In-Phase part and the other one is the Quadrature part. Two bits are used to represent in-phase part of the symbol and another two bits are used to represent the quadrature part of the symbol. Hence normally, in-phase and quadrature values could be one of the following{00, 01, 10, 11}2 which corresponds to base ten representation of {0, 1, 2, 3}10 . Yet we shift and normalize the axes such that now we have {3, 1, 1, 3}10 for each axis, hence we had a zero mean constellation.

2.b

Set = 0.5 and modulate a random data sequence {mk }

In this part we are actually doing a baseband 16-QAM modulation for a given random data sequence. In order to generate a modulated signal at the modem output we follow the steps on the rst page in the assignment sheet. 2.b.1 Generation of the Root Raised Cosine Pulse:

Root raised cosine pulse has the characteristic of the square rooted version of a raised cosine pulse in the frequency domain. So if HRC (f ) represents the Fourier Transform of the raised cosine pulse, then the root raised cosine pulse HRRC (f ) is dened as: HRRC (f ) = HRC (f ). Using Matlab this pulse can be dened using the lter design toolbox. Such a design code is given below:
function [ rrc, filter ] = RRC_Generate( t, alpha, omega, T, Ts) %%This function is used to generate the root raised cosine pulse %%which will later be convolved with the dirac combs for the %%in phase and quadrature components of the M-QAM symbol. %%For this purpose fdesign(filter design) toolbox of %%Matlab will be used with the method pulseshaping(). %%However, since this toolbox designs a filter with passband %%amplitude equal to 1. We must do proper normalization, %%such that we obtain root raised cosine pulse from the %%designed filter. filterObj = fdesign.pulseshaping( T/Ts, ... Square Root Raised Cosine, ... N,Beta, ... length(t)-1, ... alpha ); filter = design(filterObj); %%Do the Normalization Here rrc = filter.Numerator/(sqrt(2*omega)); end

For a given , , T, Ts this function designs a lter which is shaped as root raised cosine pulse hence we can use it while modulating the random data sequence.

For this part we set our parameters as follows:


%%Define the parameters of the assignment %-------------------------------T = 1/2400; % Data Rate in seconds W = 1/(2*T); % Bandwith in Hertz Ts = 8*W; % Sampling Period in Seconds alpha = 0.5; % Roll-of parameter for root raised cosine pulse M = 16; % M for MAry QAM fc = 1800; % Cut-off frequency for modulation N = 4096; % Data Sequence length %--------------------------------

And we design our root raised cosine using the function given in the previous page. That yields us the following pulse shape in frequency and time domain shapes.

Figure 3: Root raised cosine pulse for = 0.5 and T = 1/2400 in time domain

Figure 4: Root raised cosine pulse for = 0.5 and T = 1/2400 in frequency domain The frequency domain characteristics of the root raised cosine show that it has a at pass band around the 0 Hertz (it is not pass-band modulated), and falling edges between 1000-2000 Hertz. By trial and error, and checking the analytical function it can be observed that for = 0 the frequency content of this pulse is like a rectangular pulse, and as becomes larger such that: = 1 it has a cosine like bend around zero Hertz. 2.b.2 Generation of Baseband 16-QAM modulated signal s (t):

In this part we will modulate a random data sequence of length N = 4096, using a baseband 16-QAM modulation system, and obtain s (t). This is the baseband modulated modem output. s (t) can be decomposed into in-phase and quadrature parts as follows: s (t) = sI (t)+jsQ (t). The following function is used to obtain s (t):

s (t) =
k=1

(Ak + jBk )p(t kT )

(1)

Where Ak represents the value of the in-phase part, and Bk represents the value of the quadrature part of the kth 16-QAM symbol. p(t kT ) is the kT shifted root raised cosine pulse that we designed in the previous part. 9

Using the fact that (Ak + jBk ) is constant for a specic value of k, Equation 1 can be transformed into the following equation:

s (t) =
k=1

(Ak + jBk )p(t kT )


= p(t) Ak
k=1

(t kT ) + jBk
k=1

(t kT )

(2)

Using the time shifting property of the time domain convolution of two signals, we were able to decompose the baseband modulated signal s (t) as in 2. Now we see that there are tow Dirac Comb functions weighted with coefcients Ak and Bk , respectively. For the modulation purpose, the following Matlab code produces these weighted Dirac Comb functions:
function [ d_I, d_Q ] = Dirac_Comb_Generate( Ak, Bk, N, T, Ts ) %This function is used to generate two dirac comb pulses which %are weighted by the appropriate values of the M-QAM modulation %scheme, for 16-QAM the values Ak, and Bks are to be chosen %such that they are the in-phase and quadrature %parts of the symbol. % % % % % Ak: Bk: N: T: Ts: In phase component of the M-QAM symbol Quadrature component of the M-QAM symbol The input data length Data Rate in seconds Sampling Period

t = -N*T/2:Ts:N*T/2; %needed to match dirac comb length %to root raised cosine %pulse vector length d_I = zeros(length(t),1); d_Q = zeros(length(t),1); %%Assign the weights Ak for the in phase component %%of the M-QAM modulation scheme. for i = 0:1:length(Ak)*T/Ts-1 if(rem(i,T/Ts) == 0) d_I(i+1) = Ak(floor(i/(T/Ts))+1); end end

10

%%Assign the weights Bk for the quadrature component of %%the M-QAM modulation scheme. for i = 0:1:length(Bk)*T/Ts-1 if(rem(i,T/Ts) == 0) d_Q(i+1) = Bk(floor(i/(T/Ts))+1); end end end

Having the function that creates weighted Dirac Comb functions for the quadrature and in-phase parts of the 16-QAM modulated signal, we do the convolution of the root raised cosine pulse p(t) with the Dirac Comb functions. As follows:
%%Create a Dirac Comb pulse, which includes weighted %%dirac deltas spaced equally once every Ts seconds, %%which is the sampling period. [dirac_I, dirac_Q] = Dirac_Comb_Generate( Ak, Bk, N, T, Ts ); %%We convolve the root raised cosine pulse that %%we generate for a specific roll of factor and %% bandwithwith the weighted in-phase and quadrature %%components of the dirac comb that we generated previously. same %%command is used to ensure same vector size. s_I = conv(dirac_I,root_raised_cosine,same); s_Q = conv(dirac_Q,root_raised_cosine,same);

s_I in the Matlab script above represents the in-phase component, and s_Q represents the quadrature part of the 16-QAM modulated signal. Such that: s (t) = sI (t) + jsQ (t).

11

2.b.3

Plot sI [n] and sQ [n] for the rst 30 symbols

In the end of the section 2.b.2 we have derived the in-phase and quadrature components of the baseband 16-QAM modulated signal. Now we plot the rst 30 symbols of each part of the signal. Normally, a generic Matlab function was written to compute and plot the results for these steps, however for a better layout we give the script here, the functions are given in the Appendix part of the report.
%% Plot s_i[n] for the first 30 symbols f = figure; plot(s_I(1:30*T*Ts)) title([S_I[n] first 30 Values, for Alpha = num2str(alpha) T = 1/ num2str(1/T)]); xlabel(Sample) ylabel(Amplitude) print(f,-dpng,-r300, [S_I[n]_Alpha_1div_ num2str(1/alpha) _T_ num2str(1/T)]); %% Plot s_q[n] for the first 30 symbols f = figure; plot(s_Q(1:30*T*Ts)) title([S_Q[n] first 30 Values, for Alpha = num2str(alpha) T = 1/ num2str(1/T)]); xlabel(Sample) ylabel(Amplitude) print(f,-dpng,-r300, [S_Q[n]_Alpha_1div_ num2str(1/alpha) _T_ num2str(1/T)]);

12

This code produced the following plots:

Figure 5: sI [n] for = 0.5 and T = 1/2400 for the rst 30 symbols

Figure 6: sQ [n] for = 0.5 and T = 1/2400 for the rst 30 symbols 13

We see that the rst 30 symbols of the quadrature and in-phase components of the signal have a random characteristic, and since the signal is modulated using a root raised cosine pulse its maximum and minimum values are not strictly between -3 and +3 as we dened our 16-QAM Constellation. Rather they are constrained by the maximum value of the root raised cosine 1 pulse which is for this case = 0.0204 Thus, in the overall communica2W tion scenario the receiver should implement a lter like a matched lter to reverse the eect of convolution with the root raised cosine pulse. 2.b.4 Plot the eye diagrams for sI [n] and sQ [n]

Eye diagrams help us to evaluate the performance of the modulation scheme, specically the eect of inter symbol interference(ISI) [2]. Here are few properties of the eye diagrams: In an Mary system there are M-1 eye openings. The width of the eye opening is the time interval over which the received signal can be sampled without error from intersymbol interference [2]. Meaning that if we sample at the instants that correspond to the time intervals of the eye openings then we eliminate the bit errors due to ISI. The slope of the eyelid on the upper left of an eye corresponds to the sensitivity of the system to the timing errors. The height of the eye opening at a specied sampling time denes the noise margin of the system [2]. Now that we know the properties of the eye diagrams, we plot the eye diagrams for this question using the following Matlab Code:
%% The Eye Diagrams for s_i[n] and s_q[n] s_envelope = s_I+j*s_Q; f = eyediagram(s_envelope, 20 ,4*T); print(f,-dpng,-r300, [Eye_Diagram_ num2str(1/alpha) _T_ num2str(1/T)]);

Where s_envelope = s (t). The function eyediagram takes a complex value and plots the eyediagram as follows:

14

Figure 7: The Eye Diagrams for sI [n] and sQ [n]s for = 0.5 and T = 1/2400 We see that we have 3 eye openings for in the eye diagram. Which satises the statement that, in an Mary system there are M-1 eye openings, where M is 4. Furthermore if we sample this signal at instants; for example between t = 25.105 and t=41.105 there is an eye opening, meaning that there will be no probability of bit errors due to ISI. 15

The data markers below are placed such that the zero ISI time interval is shown. Between those markers, if the signal is sampled at the receiver, there will be no error due to ISI.

Figure 8: The Eye Diagram showing the zero ISI time interval for sI [n] and sQ [n]s for = 0.5 and T = 1/2400

16

2.b.5

Plot the power spectral density of sI [n]

Using the Welch method, we can estimate the power spectral density of sI [n]. There is an implemented Matlab version for this method, and this will be used as follows:
%% Using the Welch method, compute the power spectral density estimate. figure; pwelch(s_I,[],[],[],Ts,twosided)

Where s_I variable in the code above is sI [n]. This way we obtain the power spectral density as:

Figure 9: Power spectral density estimate of sI [n] for = 0.5 and T = 1/2400

17

Since we are doing baseband modulation in this assignment, our center frequency is 0 Hertz, hence for the bandwidth requirement of 4 dB attenuation at 1300 Hz away from center frequency we check the attenuation at 1300 Hz. Observed Attenuation is approximately: 72 dB (77.2 dB ) = 5.2 dB however we see that the estimate is not very robust and is noisy, hence the required attenuation is barely met.

2.c

Repeat part (2.b) for = 0.2 and = 0

Repeat part (2.b) for = 0.2 If we make smaller than the current value by setting it: = 0.2. We expect to obtain the Fourier Transform of the root raised cosine pulse to have a more sharp edges around the cut-o frequencies. Lets Check if that is the case by inspecting the plots:

Figure 10: Root raised cosine pulse for = 0.2 and T = 1/2400 in time domain

18

Figure 11: Root raised cosine pulse for = 0.2 and T = 1/2400 in frequency domain We clearly see that the root raised cosine pulse is very much like a rectangular function compared to the = 0.5 case, yet still it is not rectangular. We also see that the Fourier Transform of the root raised cosine pulse for = 0.2 case is compressed in frequency, compared to = 0.5 case. This is not surprising since, if we expand a signal in the time domain, its frequency domain equivalent is compressed.

19

2.c.1

Plot sI [n] and sQ [n] for the rst 30 symbols = 0.2

Figure 12: sI [n] for = 0.2 and T = 1/2400 for the rst 30 symbols

Figure 13: sQ [n] for = 0.2 and T = 1/2400 for the rst 30 symbols 20

2.c.2

Plot the eye diagrams for sI [n] and sQ [n] for = 0.2

Figure 14: The Eye Diagrams for sI [n] and sQ [n]s for = 0.2 and T = 1/2400 Comparing this eye diagram plot of = 0.2, with the previous case of = 0.5 we see that, the eye openings this time are narrower. Meaning that the time 21

interval during which we have to sample the signal at the receiver is lesser compared to the = 0.5 case. According to the properties for eye diagrams given in 2.b.4, we observe the following for this case: Narrower eye openings as observed for this case means that the probability of bit errors due to ISI will increase. The slope of the eyelid on the upper left on an eye in the eye diagram, is more increased for the cases with small as in this case. Hence we say that sensitivity of the system to timing errors is also increased. The height of the eye at a specied sampling time is higher for the cases with small , leading to the conclusion that noise margin of the system is higher. We see that as becomes smaller, we have a more expanded root raised cosine pulse in the time domain, hence we reduce the zero-ISI performance of the system; because this time the receiver have to select the sampling instants from a diminished time interval. This phenomenon is show in the gure next page:

22

Figure 15: The Eye Diagram showing the zero ISI time interval for sI [n] and sQ [n]s for = 0.2 and T = 1/2400 The markers in the plot are on the signalling intervals for this case(outside the eye). Whereas in the previous case for = 0.5 they were within the eye openings.

23

2.c.3

Plot the power spectral density of sI [n] for = 0.2

Figure 16: Power spectral density estimate of sI [n] for = 0.2 and T = 1/2400 Observed Attenuation is approximately: 70 dB (78.8 dB ) = 8.8 dB We see that the bandwidth requirement is satised well enough compared to the case = 0.5, this is due to the fact that the power is more concentrated in the baseband region therefore we have a more sharp fall around 1300 Hz. This is not surprising because we know that as gets smaller, the frequency characteristic of the root raised cosine pulse converge to a rectangular shape hence having a more concentrated power spectral density around central frequency.

24

Repeat part (2.b) for = 0 If we make smaller than the current value by setting it: = 0. We expect to obtain the Fourier Transform of the root raised cosine pulse to look like a rectangular function. Below is the time domain version of the root raised cosine pulse for = 0. Compared to the = 0.5 and = 0.2 cases we see that the root raised cosine pulse is expanded in time, which is natural since its frequency content is more concentrated around zero Hertz.

Figure 17: Root raised cosine pulse for = 0 and T = 1/2400 in time domain

25

Figure 18: Root raised cosine pulse for = 0 and T = 1/2400 in frequency domain We clearly see that the root raised cosine pulse is a rectangular function. There are jumps at the cut-o frequencies, this is due to Gibbs eect, and is a result of the fact that Fourier transform of a signal make jumps at discontinuity points [3].

26

2.c.4

Plot sI [n] and sQ [n] for the rst 30 symbols = 0

Figure 19: sI [n] for = 0.2 and T = 1/2400 for the rst 30 symbols

Figure 20: sQ [n] for = 0 and T = 1/2400 for the rst 30 symbols 27

2.c.5

Plot the eye diagrams for sI [n] and sQ [n] for = 0

Figure 21: The Eye Diagrams for sI [n] and sQ [n]s for = 0 and T = 1/2400 This time the eye openings are very narrow compared to the other cases, according to the information . We have an expanded time domain root raised cosine pulse, hence the time interval during which the receiver could sample without ISI is smaller compared to the other cases. According to the properties for eye diagrams given in 2.b.4, we observe the following for this case: Small eye diagram as observed for this case means that the probability of bit errors due to ISI increase. 28

The slope of the eyelid on the upper left on an eye in the eye diagram, is more increased for the cases with small as in this case. Hence we say that sensitivity of the system to timing errors is also increased. The height of the eye at a specied sampling time is higher for the cases with small , leading to the conclusion that noise margin of the system is higher. 2.c.6 Plot the power spectral density of sI [n] for = 0

Figure 22: Power spectral density estimate of sI [n] for = 0.2 and T = 1/2400 Observed Attenuation is approximately: 73 dB (121.8 dB ) = 48.8 dB We see that the bandwidth requirement is satised perfectly.This is due to the fact that the power is completely concentrated in the baseband region and we have a 90 degrees fall around 1300 Hz. What we derive from this comparison is that as, we expand the time domain root raised cosine pulse 29

by making = 0, we concentrate the frequency content in a rectangular shape, hence having a more concentrated power. This is why we have such an abrupt attenuation at cut o frequency.

30

2.d

Repeat part (2.b) with higher data rate T = 1/3600

In this part we use = 0.5 as we did in part b) and we use T = 1/3600 which will also aect the shape of the root raised cosine pulse; because the 1 W used in the formula of root raised cosine pulse is related to T as T = . 2W What we expect is that, as T becomes smaller; hence we increase our data rate, we have to send more symbols in the same amount of time; this requires that we compress our root raised cosine pulses in the time domain, and as a result we expand the pulses in the frequency domain. This eect is shown below:

Figure 23: Root raised cosine pulse for = 0.5 and T = 1/3600 in time domain

31

Figure 24: Root raised cosine pulse for = 0.5 and T = 1/3600 in frequency domain As we have explained, time domain signal is more compressed in time by reducing the symbol period. Moreover we also see that the signal amplitude is attenuated to 0.0166.

32

2.d.1

Plot sI [n] and sQ [n] for the rst 30 symbols = 0.5 and T = 1/3600

Figure 25: sI [n] for = 0.5 and T = 1/3600 for the rst 30 symbols

33

Figure 26: sQ [n] for = 0.5 and T = 1/3600 for the rst 30 symbols

34

2.d.2

Plot the eye diagrams for sI [n] and sQ [n] for = 0.5 and T = 1/3600

Figure 27: The Eye Diagrams for sI [n] and sQ [n]s for = 0.5 and T = 1/3600 We see that the eye openings are this time narrower compared to the case where, = 0.5 and T = 1/2400. This is not surprising since, the data rate this time is higher and we are sending more symbols.

35

By comparing the gures below, which are for = 0.5, T = 1/2400. and = 0.5, T = 1/3600. We can see that the possible sampling instants for = 0.5, T = 1/2400 case at the receiver for 0-ISI are between: t=25.105 seconds and t=41.105 seconds. However for = 0.5, T = 1/3600 case those instants are between t=16.105 and t=27.105 seconds. To sum up, For = 0.5, T = 1/2400 time duration for 0-ISI sampling = 41.105 25.105 = 16.105 seconds For = 0.5, T = 1/3600 time duration for 0-ISI sampling = 27.105 16.105 = 11.105 seconds Meaning that as we increase our data rate by increasing T the system becomes prone to bit errors, due to ISI.

Figure 28: The Eye Diagram showing the zero ISI time interval for sI [n] and sQ [n]s for = 0.5 and T = 1/2400

36

Figure 29: The Eye Diagram showing the zero ISI time interval for sI [n] and sQ [n]s for = 0.5 and T = 1/3600

37

2.d.3

Plot the power spectral density of sI [n] for = 0 and T = 1/3600

Now lets check whether the bandwidth requirement is satised, for a higher data rate.

Figure 30: Power spectral density estimate of sI [n] for = 0.5 and T = 1/3600 Observed Attenuation is approximately: 75.5 dB (78.17 dB ) = 2.67 dB We see that the bandwidth requirement is not satised. As we increase T ; hence having a more compressed time domain pulse, and more expanded pulse in the frequency domain. We scatter the signal power more widely around the fundamental frequency. For this reason the signal power decays more slowly 1300 Hz around the central frequency. Therefore, required attenuation is not met.

38

Therefore trying higher data rates will not satisfy the bandwidth requirement. Lets check what happens if we modify the roll of factor of the pulse. Lets try = 0 and T = 1/3600:

Figure 31: Power spectral density estimate of sI [n] for = 0 and T = 1/3600 The attenuation is approximately = 2 dB and we see that roll o factor does not improve the bandwidth requirement. The power spectral density makes a sharp transition but not around 1300 Hz, therefore we cannot modify roll of factor to satisfy the bandwidth requirement. What is left is that we could use lower data rates than T = 1/3600 : for example for = 0.5 and T = 1/2700.

39

Figure 32: Power spectral density estimate of sI [n] for = 0.5 and T = 1/2700 We see that this time the bandwidth requirement is satised. We also try for other cases such as T = 1/2700, and conclude that they also satisfy the bandwidth requirement, but when T is smaller than 1/2700 we cannot satisfy the bandwidth requirement for = 0.5.

40

Conclusion

In this assignment we have implemented an 16-QAM root raised cosine modem, to modulate random data sequences of length 4096. During the simulation stages, we have made assessments for the system behaviours for dierent values of roll of factor, and symbol period. We observed that as roll of factor decreases, from = 0.5 to = 0, the pulse shape is expanded in time domain, compressed in frequency domain hence having a more concentrated power spectral density. Also, reduced burdened the zero ISI performance of the system. As symbol period T decreased, we learned that it is possible to increase the data rate, however at an expense of increasing ISI, therefore ISI also places constraints on the data rate of a communication system. Moreover, decreasing the symbol period had an eect of scattering the signal energy more widely around the fundamental frequency, which would aect the bandwidth requirements for dierent scenarios. We have simulated the baseband transmission scenario, and for the pass band modulation all we have to do is to multiply the obtained pulse s (t) with a cosine pulse with a specic fundamental frequency other than 0 Hertz, and route the signal into the communication media to be received by the receiver.

41

Code Appendix

The function that creates the 16-QAM signal constellation:


function [ Ak, Bk, ak, bk ] = QAM_Generate( QAM_Input, M ) %QAM_GENERATE %For the M =16 case chart below shows, %how ak and bk are obtained. However this function %works for any M, it is generic. % % Mk bk ak % % ----------------------% 0 0 0 % 1 0 1 % 2 0 2 % 3 0 3 % 4 1 0 % 5 1 1 % 6 1 2 % 7 1 3 % 8 2 0 % 9 2 1 % 10 2 2 % 11 2 3 % 12 3 0 % 13 3 1 % 14 3 2 % 15 3 3 %-----------------------%We see that Ak is the remainder %of Mk from mod 4 operation, and Bk %is the quotient of Mk from mod 4 operation. ak = rem(QAM_Input,sqrt(M)); bk = floor(QAM_Input./sqrt(M)); %We shift the mean of ak and bk to 0. Ak = 2.*ak -sqrt(M)+1; Bk = 2.*bk -sqrt(M)+1; f = scatterplot(Ak+j*Bk); print(f,-dpng,-r300, [Scatter]); end

42

The code that designs the root raised cosine pulse:


function [ rrc, filter ] = RRC_Generate( t, alpha, omega, T, Ts) %%This function is used to generate the root raised cosine pulse %%which will later be convolved with the dirac combs for the %%in phase and quadrature components of the M-QAM symbol. %%For this purpose fdesign(filter design) toolbox of %%Matlab will be used with the method pulseshaping(). %%However, since this toolbox designs a filter with passband %%amplitude equal to 1. We must do proper normalization, %%such that we obtain root raised cosine pulse from the %%designed filter. filterObj = fdesign.pulseshaping( T/Ts, ... Square Root Raised Cosine, ... N,Beta, ... length(t)-1, ... alpha ); filter = design(filterObj); %%Do the Normalization Here rrc = filter.Numerator/(sqrt(2*omega)); end

43

The code that creates weighted Dirac Comb functions:


function [ d_I, d_Q ] = Dirac_Comb_Generate( Ak, Bk, N, T, Ts ) %This function is used to generate two dirac comb pulses which %are weighted by the appropriate values of the M-QAM modulation %scheme, for 16-QAM the values Ak, and Bks are to be chosen %such that they are the in-phase and quadrature %parts of the symbol. % % % % % Ak: Bk: N: T: Ts: In phase component of the M-QAM symbol Quadrature component of the M-QAM symbol The input data length Data Rate in seconds Sampling Period

t = -N*T/2:Ts:N*T/2; %needed to match dirac comb length %to root raised cosine %pulse vector length d_I = zeros(length(t),1); d_Q = zeros(length(t),1); %%Assign the weights Ak for the in phase component %%of the M-QAM modulation scheme. for i = 0:1:length(Ak)*T/Ts-1 if(rem(i,T/Ts) == 0) d_I(i+1) = Ak(floor(i/(T/Ts))+1); end end %%Assign the weights Bk for the quadrature component of %%the M-QAM modulation scheme. for i = 0:1:length(Bk)*T/Ts-1 if(rem(i,T/Ts) == 0) d_Q(i+1) = Bk(floor(i/(T/Ts))+1); end end end

44

The code that makes all the required assessments:


function [ bool ] = Analyze( M, W, alpha, N, T, Ts ) %This function is used to solve the parts b,c,d given in the assignment for %generic values. % M: Is the M of the M-QAM Modulation % W: Bandwith % Alpha: Roll of Factor for the root raised cosine pulse % N: Data length % T: Data Rate in seconds % Ts: Sampling Period % t: Time Vector % %%Define The Time Vector, Fast Fourier Transform Size, FFT Normalization %%vector t = -N*T/2:Ts:N*T/2; fftSize = 2^nextpow2(length(t)); % Cooley-Tukey Efficiency Implementation fftNormalization = linspace(-(Ts/2)^-1,(Ts/2)^-1,fftSize); %%Generate Pseudo-Random Data sequence which will be modulated by M-QAM Random_data_sequence = floor((M).*rand(4096,1)); %%Given the data sequence generate M-QAM symbols [Ak, Bk, ak, bk] = QAM_Generate( Random_data_sequence, M ); %%Create the root raised cosine pulse root_raised_cosine = RRC_Generate( t, alpha, W, T ,Ts ); %%Plot and save the root raised cosine(RRC) pulse in time domain f = figure; plot(t,root_raised_cosine); XLIM([-5E-3 +5E-3]) title([Root Raised Cosine Pulse, Alpha = num2str(alpha) T = 1/ num2str(1/T)]) xlabel(Time) ylabel(Amplitude) print(f,-dpng,-r300, [RRC_Alpha num2str(1/alpha) _T_ num2str(1/T)]);

45

%%Plot and save the Fourier Transform of the RRC pulse f = figure; plot(fftNormalization, abs(fftshift(fft(root_raised_cosine,fftSize)))); title([Fourier Transform of the Root Raised Cosine Pulse, Alpha = num2str(alpha) T = 1/ num2str(1/T)]) xlabel(Frequency) ylabel(Amplitude) print(f,-dpng,-r300, [Fourier_Transform_RRC_Alpha num2str(1/alpha) _T_ num2str(1/T)]); %%Create a Dirac Comb pulse, which includes weighted dirac deltas space %%equally once every Ts seconds, which is the sampling period. [dirac_I, dirac_Q] = Dirac_Comb_Generate( Ak, Bk, N, T, Ts ); %%We convolve the root raised cosine pulse that we generate for a specific %%roll of factor and bandwith, with the weighted in-phase and quadrature %%components of the dirac comb that we generated previously. same %%command is used to ensure same vector size. s_I = conv(dirac_I,root_raised_cosine,same); s_Q = conv(dirac_Q,root_raised_cosine,same); %% Plot s_i[n] for the first 30 symbols f = figure; plot(s_I(1:30*T/Ts)) title([S_I[n] first 30 Values, for Alpha = num2str(alpha) T = 1/ num2str(1/T)]); xlabel(Sample) ylabel(Amplitude) print(f,-dpng,-r300, [S_I[n]_Alpha_1div_ num2str(1/alpha) _T_ num2str(1/T)]); %% Plot s_q[n] for the first 30 symbols f = figure; plot(s_Q(1:30*T/Ts)) title([S_Q[n] first 30 Values, for Alpha = num2str(alpha) T = 1/ num2str(1/T)]); xlabel(Sample) ylabel(Amplitude) print(f,-dpng,-r300, [S_Q[n]_Alpha_1div_ num2str(1/alpha) _T_ num2str(1/T)]);

46

%% The Eye Diagrams for s_i[n] and s_q[n] s_envelope = s_I+j*s_Q; f = eyediagram(s_envelope, 20 ,4*T); print(f,-dpng,-r300, [Eye_Diagram_ num2str(1/alpha) _T_ num2str(1/T)]); %% Using the Welch method, compute the power spectral density estimate. figure; pwelch(s_I,[],[],[],1/Ts,twosided) end

47

The code that simulates system for dierent parameters:


clc clear close all %%Define the parameters of the assignment %-------------------------------T = 1/2400; % Data Rate in seconds W = 1/(2*T); % Bandwith in Hertz Ts = 1/(8*W); % Sampling Period in Seconds alpha = 0.5; % Roll-of parameter for root raised cosine pulse M = 16; % M for MAry QAM fc = 1800; % Cut-off frequency for modulation N = 4096; % Data Sequence length %-------------------------------%% Question A: Scatter Plot for the 16-QAM signal constallation %%Function scatter is used inside the QAM_Generate function below. QAM_Input = LINSPACE( 0, 15, 16); [Ak, Bk, ak, bk] = QAM_Generate(QAM_Input,M); %% Question B: %%Roll of factor is set to 0.5 and root raised cosine pulse is modulated %%using a baseband modulator. The Function Analyze is a high level %%function that computes and plots all of the requirements. Including %%eyediagrams and powerspectral densities. alpha = 0.5; Analyze( M, W, alpha, N, T, Ts ); %% Question C: %%Here we repeat Question B for different values of alpha which is the roll %%of factor of the root raised cosine pulse. alpha = 0.2; Analyze( M, W, alpha, N, T, Ts ); alpha = 0.0; Analyze( M, W, alpha, N, T, Ts ); %% Part D: We repeat Question B for higher data rates.

48

alpha = 0.5; %roll-of parameter T = 1/3600; W = 1/(2*T); Ts = 1/(8*W); Analyze( M, W, alpha, N, T, Ts); T = 1/4800; W = 1/(2*T); Ts = 1/(8*W); Analyze( M, W, alpha, N, T, Ts); T = 1/6000; W = 1/(2*T); Ts = 1/(8*W); Analyze( M, W, alpha, N, T, Ts); %% Part E: We do additional tests to evaluate the system performance for %% various data rates and roll of factors. alpha = 0.2; T = 1/3600; W = 1/(2*T); Ts = 1/(8*W); Analyze( M, W, alpha, N, T, Ts); alpha = 0; T = 1/3600; W = 1/(2*T); Ts = 1/(8*W); Analyze( M, W, alpha, N, T, Ts); alpha = 0.5; T = 1/2700; W = 1/(2*T); Ts = 1/(8*W); Analyze( M, W, alpha, N, T, Ts);

49

References

[1] "M-Ary Data Transmission Systems", Communication Systems 5th Edition, Haykin. Simon, Moher. Michael, Wiley 2010. [2] "Eye Pattern", Communication Systems 5th Edition, Haykin. Simon, Moher. Michael, Wiley 2010. [3] "Design of FIR Filters Using a Rectangular Window", Lecture Notes on Discrete-Time Signal Processing, Cetin A. Enis, Bilkent University, November 19, 2012. pp. 83

50

You might also like