0% found this document useful (0 votes)
58 views15 pages

ELEC6021 Communications Assignment I: Submission Details

The document provides instructions for an assignment on analog modulation techniques including amplitude modulation (AM) and quadrature amplitude modulation (QAM). Students are asked to: 1) Generate random input signals, modulate them using AM onto a carrier signal, and demodulate to reconstruct the original signal. 2) Extend the work to QAM by modulating two input signals (in-phase and quadrature-phase) onto cosine and sine carriers respectively. 3) Document the work in a written report with plots and explanations of the key signal processing steps.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views15 pages

ELEC6021 Communications Assignment I: Submission Details

The document provides instructions for an assignment on analog modulation techniques including amplitude modulation (AM) and quadrature amplitude modulation (QAM). Students are asked to: 1) Generate random input signals, modulate them using AM onto a carrier signal, and demodulate to reconstruct the original signal. 2) Extend the work to QAM by modulating two input signals (in-phase and quadrature-phase) onto cosine and sine carriers respectively. 3) Document the work in a written report with plots and explanations of the key signal processing steps.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

ELEC6021 Communications Assignment I

Submission Details
You should work through the exercises below and document your implementations. Your documentation should be written in continuous prose, providing not only the gures, comments and answers that are directly requested by the exercises, but also some brief explanation and discussion of what these things show. Feel free to refer to the gures provided in these exercises without including them in your write-up. Each gure in your write-up should have well labelled axes and a relevant title or legend that identies which signals are shown. You can nd an example of what Im looking for at the course website https://secure.ecs.soton.ac.uk/notes/elec6021/comms/ When you are nished, print out your write-up and staple it together. You need to submit it to ECS reception before 4pm on Thursday 13/11/2008. If you notice any mistakes in this document or have any queries about it, please email me at [email protected] Have fun, Rob Maunder.

1
1.1

Analogue Modulation
Amplitude Modulation

When an Radio Frequency (RF) signal is placed onto the antenna of a transmitter, it will propagate through the air and can be detected on the antenna of a receiver. The higher the frequency of this signal, the smaller the antennas that are required. However, we are often interested in communicating relatively low frequency signals, such as audio. Hence, we must modulate our low frequency signal onto a high frequency carrier, in order to transmit it. Figure 1 shows the schematic of a transmission scheme that uses Amplitude Modulation (AM) to transmit an input signal x(t) and demodulation to obtain a received signal x (t). As shown in Figure 1 y (t) = x(t) cos(2fc t), u(t) = 2x(t) cos(2fc t) cos(2fc t). 1 (1) (2)

Modulator cos(2fc t) x(t) y (t)

Demodulator 2 cos(2fc t) u(t) x (t)

LPF

Figure 1: AM modulation and demodulation. Using the trigonometric identity 2 cos() cos() = 1 + cos(2), we get u(t) = x(t) (1 + cos(4fc t)) , = x(t) + x(t) cos(4fc t). (3) (4)

a) Input Signal. For our input signal x(t), we shall employ a normally distributed random signal that has been bandlimited to an maximum frequency of fmax = 10 kHz. Lets start by generating a normally distributed random signal xw (t) and worry about bandlimiting it later. Well simulate the analogue signal xw (t) over an interval of T = 0.1 s, using a high sampling rate of fs = 2 MHz. Thus, the rst step is to put the commands f s=2000000; T=0.1; samples=f s*T; t=(0:(samples-1))/f s; into a new Matlab .m le. You should use this .m le throughout Section 1.1. This way, youll be able to modify it when you get to Section 1.2, making things much easier for you. You can generate a random analogue signal xw (t) by putting the commands randn(seed,0); x w=randn(size(t)); into your .m le. Here, we have seeded the random number generator, which will ensure that youll get the same sequence of random numbers every time you run your .m le. This will make it easier for you to keep your results self-consistent in your write-up (and make it easier for me to mark it!) Note that you can look up any unfamiliar Matlab commands and their parameters using Matlabs help facility. For example, in Matlabs command window type help randn to obtain information on how to create a Gaussian distributed random variable. You can plot the rst 1000 samples of the signal xw (t) by putting the commands figure; plot(t(1:1000),x w(1:1000)); into your .m le and running it. Use the insert menu in the resultant gure to add relevant labels to the x and y axes of this plot, as well as a relevant title. You should do this for all of the plots generated in this assignment. The signal xw (t) is said to be white. This means that it contains components at all frequencies. You may check this by using the pwelch Matlab function, which displays the signals Power Spectral Density (PSD). Simply put the commands 2

figure; pwelch(x w); into your .m le and run it. Again, use the insert menu in the resultant gure to change the title so that it indicates which signal the PSD relates to. You should do this for all of the PSDs generated in this assignment. However, we require a signal that does not contain any components above a frequency of fmax = 10 kHz. We can eliminate these components from xw (t) using a Low-Pass Filter (LPF). Matlabs fir1 function can be used to design an LPF. Take a look at the help that Matlab oers for this function using the command help fir1 This tells us that the command B=fir1(N,W n); designs an Nth order LPF and returns the N + 1 lter coecients in a vector B. The normalised cut-o frequency W n must be in the range 0 < W n < 1, with 1 corresponding to half the sample rate fs . A lter order of N = 1023 is a good choice, but its up to you to work out what value to use for W n, with consideration of fmax and fs . The signal xw (t) can be ltered to obtain x(t) using the command x=filter2(B,x w); Plot the rst 1000 samples of the signal x(t) and generate its PSD using the plot and pwelch functions, as before. Observe that the high frequency components of x(t) have been attenuated by about 90 dB compared to the low frequency components. In other words, the PSD of the low frequency components is 1090/10 = 1000000000 higher than that of the high frequency components! Our LPF has done such a good job because its order N = 1023 is so high. Export the plots and PSDs of the signals xw (t) and x(t) as .jpg images and include these in your write-up. Comment on the dierences between the two signals and between the two PSDs. Also, explain the calculation you used to choose the normalised cut-o frequency W n for the LPF.

b) Modulation. Create a carrier c(t) with frequency fc = 250 kHz using the commands f c=250000; c=cos(2*pi*f c*t); Plot the rst 1000 samples of this carrier c(t) using the plot function, as before. You may like to use the zoom button in the resultant gure to take a closer look at the carrier wave. Also, generate the PSD of c(t) using the pwelch function, as before. Next, we need to multiply the carrier c(t) with the input signal x(t) in order to obtain the AM signal y (t), as shown in Figure 1. You can do this using the command y=c.*x; Note that we must use the element-wise multiplication (.*) rather than the vector multiplication (*) of c and x. Again, plot the rst 1000 samples of this AM signal y (t) and generate its PSD using the plot and pwelch functions, as before. Include the new plots and PSDs in your write-up. Comment on how the plots of x(t) and c(t) may be combined to obtain that of y (t). Similarly, comment on how the PSD of y (t) may be obtained by combining those of x(t) and c(t). What is the bandwidth of y (t) in Hertz? How does this compare to the maximum frequency in 3

x(t), namely fmax ?

c) Demodulation. Take a look at the demodulator in Figure 1. Notice that it doesnt use any components that we havent already considered. Demodulation should be no problem for a student of your talents! Start by transforming y (t) into u(t). You can use similar Matlab code to that which transformed x(t) into y (t), but dont forget to multiply by two, as shown in Figure 1. Plot the rst 1000 samples of the signal u(t) and generate its PSD using the plot and pwelch functions, as before. Note that an image signal has arisen in the PSD. This image signal can be removed using the LPF shown in Figure 1. With consideration of the PSD of u(t), choose a normalised cut-o frequency W n for this LPF that is half-way between the desired signal and the image signal. A lter order of N = 23 will be sucient for this LPF; there is no need to attenuate the image signal by as much as a thousand million times in this case! Obtain the reconstructed signal x (t) and compare its rst 1000 samples to those of x(t) using the commands figure; plot(t(1:1000),xhat(1:1000),-, t(1:1000),x(1:1000),--); Here, the parameter - tells Matlab to plot x (t) using a solid line, while the parameter -- results in a dashed line for x(t). Make sure you are happy that x (t) and x(t) are very similar. Also, generate the PSD of x (t) using the pwelch function, as before. Include the new plots and PSDs in your write-up. Comment on how the plots of u(t) and x (t) compare to those of x(t) and y (t). Similarly, comment on how the PSDs of u(t) and x (t) compare to those of x(t) and y (t). Also, comment on how the PSD of u(t) relates to the equations provided below Figure 1. Explain the calculation you used to choose the normalised cut-o frequency W n for the LPF.

1.2

Quadrature Amplitude Modulation

So far, we have only considered the use of a cosine carrier wave. If we had used a sine carrier wave in Section 1.1, we would have obtained very similar results. This is because the sine and cosine functions dier only by a phase shift of /2 radians, ie cos() = sin( + /2). As a result, sin() = 0 if cos() = 1 and cos() = 0 if sin() = 1. These results indicate that the cosine and sine functions are orthogonal to each other. This means that a signal xi (t) that is amplitude modulated onto a cosine carrier wave will not interfere with another signal xq (t) that is modulated onto a sine carrier wave having the same frequency fc . In this way, we can transmit two signals at once, which is useful for stereo audio for example. We refer to these signals as the in-phase signal xi (t) and the quadrature-phase signal xq (t). The additional presence of the quadrature-phase signal gives Quadrature Amplitude Modulation (QAM) its name. A schematic for a QAM scheme is shown in Figure 2

Modulator cos(2fc t) xi (t)

Demodulator 2 cos(2fc t) ui (t) x i (t)

y (t)

LPF

xq (t)

sin(2fc t)

uq (t)

LPF

x q (t)

2 sin(2fc t)

Figure 2: QAM modulation and demodulation. As shown in Figure 2 y (t) = xi (t) cos(2fc t) + xq (t) sin(2fc t), ui (t) = 2xi (t) cos(2fc t) cos(2fc t) + 2xq (t) sin(2fc t) cos(2fc t), uq (t) = 2xq (t) sin(2fc t) sin(2fc t) + 2xi (t) cos(2fc t) sin(2fc t). (5) (6) (7)

Using the trigonometric identities 2 cos() cos() = 1 + cos(2), 2 sin() sin() = 1 cos(2) and 2 cos() sin() = sin(2), we get ui (t) = xi (t) + xi (t) cos(4fc t) + xq (t) sin(4fc t), uq (t) = xq (t) xq (t) cos(4fc t) + xi (t) sin(4fc t). (8) (9)

After the high-frequency components of ui (t) and uq(t) are removed by the LPFs shown in Figure 2, we obtain x i (t) = xi (t), x q (t) = xq (t), as desired. (10) (11)

a) Plots and PSDs Modify the Matlab .m le you wrote for Section 1.1 in order to simulate the scheme of Figure 2. You can generate xi (t) and xq (t) in a similar manner to how you generated x(t) in Section 1.1a, by using the commands randn(seed,0); x w = randn(size(t)); x i = filter2(B,x w); x w = randn(size(t)); x q = filter2(B,x w); Note that by regenerating xw (t) before obtaining xq (t), we ensure that it diers to xi (t). You can obtain y (t) by using the commands c i=cos(2*pi*f c*t); 5

c q=sin(2*pi*f c*t); y=c i.*x i+c q.*x q; You can obtain ui (t) and uq (t) in the same way that you obtained u(t) in Section 1.1c. These signals can be ltered using the same LPF as the one you used in Section 1.1c. Generate the PSD of y (t) in the same way that you did in Section 1.1b. Also, plot the rst 1000 samples of xi (t) and x i (t) in the same gure, like you did in Section 1.1c. Do the same for xq (t) and x q (t). Make sure that you are convinced that QAM allows the transmission of two signals at the same time. Include the PSD and one of the new plots in your write-up. With consideration of the PSD, explain how the bandwidth of y (t) compares to that obtained for the AM scheme in Section 1.1b? This may seem surprising since the AM scheme only transmits one signal, whereas the QAM scheme transmits two. If not in bandwidth, how does the QAM scheme pay for the additional signal?

1.3

Complex Quadrature Amplitude Modulation

Note that just like how our signal comprises the two components xi (t) and xq (t), there are two components to a complex number, namely the real part and the imaginary part. Complex numbers can therefore conveniently represent the two parts of our signal, according to x(t) = xi (t) + jxq (t), (12)

where j =

1. In this case, the schematic of Figure 2 is transformed into that of Figure 3.


Modulator ej 2fc t x(t) Re() y (t) Demodulator 2ej 2fc t u(t) LPF x (t)

Figure 3: Complex QAM modulation and demodulation. As shown in Figure 3 y (t) = Re x(t)ej 2fc t , where Re[a + jb] = a. (13)

a) Calculations Use the following identities to determine expressions for y (t), u(t) and x (t). e
j

ej = cos() + j sin(), 2 cos() cos() = 1 + cos(2), 2 sin() sin() = 1 cos(2), 2 cos() sin() = sin(2). 6

= cos() j sin(),

j 2 = 1,

(14) (15) (16) (17) (18) (19)

Provide your calculations in your write-up, showing where you have used each of the identities provided above. Comment on how your expression for y (t) compares to that provided in Equation 5 for the scheme of Figure 2. Comment on how your expression for x (t) compares to that of Equation 12.

1.4

Additive White Gaussian Noise

So far, weve assumed that our channel does not adversely aect our transmitted signal y (t). Lets see how our analogue modulation scheme performs when the channel introduces some Additive White Gaussian Noise (AWGN) n(t), as shown in Figure 4.
Modulator ej 2fc t x(t) Re() n(t) y (t) y (t) Demodulator 2ej 2fc t u(t) LPF x (t)

Figure 4: Complex QAM modulation and demodulation in the presence of AWGN. This noise n(t) is additive because it is added to the transmitted signal y (t). It is Gaussian because it may be generated using a sequence of Gaussian distributed random variables, just like how our signal xw (t) was generated in Section 1.1a. As described in Section 1.1a, sequences of Gaussian distributed random variables have components at all frequencies. Therefore, our noise n(t) is white.

a) Plots and PSDs Modify your .m le from Section 1.2 in order to simulate the scheme of Figure 4. Generate the noise n(t) using the commands randn(seed, 0); n=0.01*randn(size(t)); Here, the multiplier of 0.01 results in some relatively low-power noise. Here are some other commands to help you simulate the scheme of Figure 4 x=x i+j*x q; yhat=real(x.*exp(-j*2*pi*f c*t))+n; u=2*yhat.*exp(j*2*pi*f c*t); Compare plots of the transmitted and received signals using the commands figure; plot(t(1:1000),real(xhat(1:1000)),-, t(1:1000),real(x(1:1000)),--); figure; plot(t(1:1000),imag(xhat(1:1000)),-, t(1:1000),imag(x(1:1000)),--); Also, generate PSDs for the two components of the received signal using the commands figure; pwelch(real(xhat)); figure; pwelch(imag(xhat));

Include one of the plots and one of the PSDs in your write-up. Comment on how the AWGN has aected the demodulated signals. Comment on how the PSD compares to that obtained for x (t) in Section 1.1c. How has this PSD been aected by your choice of the cut-o frequency for the LPF of Figure 4? Comment on how this would inuence your choice of cut-o frequency in the future.

2
2.1

Digital Modulation
4-ary Quadrature Amplitude Modulation

The previous section showed that analogue modulation schemes are susceptible to noise. In this section, well show that digital modulation schemes can achieve reliable communications even in the presence of relatively severe noise. The dierence between an analogue and a digital modulation scheme is the type of signal they are used to convey. As we showed in Section 1, analogue modulators transmit an analogue signal x(t). However, the analogue demodulator can never be sure if a particular component of the demodulated signal x (t) is signal or noise. By contrast, digital modulators transmit digital signals, such as a sequence of binary digits b[n]. Since a bit can only have a value of 0 or 1, the demodulator just has to choose from these two values when recovering the sequence b[n]. While the demodulator can never be sure that it has made the right choices, it will typically do a good job so long as the noise is not really bad. We can construct a digital modulation scheme by converting the digital signal b[n] into an analogue signal x(t) and using the analogue modulation scheme of Figure 4. Once the demodulated signal x (t) has been recovered, we just need to convert it back into a digital signal b[n]. Schematics for a Digital to Analogue Converter (DAC) and an Analogue to Digital Converter (ADC) are provided in Figures 5 and 6.
b[n] Serial to parallel converter b1 [n] b2 [n] 4QAM mapper s[n] s(t) Root raised x(t) cosine lter

impulse generator

Figure 5: Digital to analogue conversion using 4QAM.


x (t) Root raised cosine lter s (t) s [n] b1 [n] 4QAM demapper b2 [n] Parallel to serial converter b[n]

sampler

Figure 6: Analogue to digital conversion using 4QAM.

a) Bit mapping Lets consider a scheme that transmits bits at a rate of fb = 20 kbit/s. Start by adding the following commands into the .m le you created in Section 1.4. f b=20000; bits=f b*T;

You can generate a random bit sequence b[n] using the commands rand(seed,0); b=round(rand(1,bits)); You may like to look up the rand and round functions in Matlabs help facility to see how this works. Lets use M = 4-ary Quadrature Amplitude Modulation (4QAM), like in Figures 5 and 6. This transmits log2 (M ) = 2 bits at a time by combining them into a single 4QAM symbol. You can determine the symbol rate fsymb , the total number of symbols and the number of samples per symbol using the commands bits per symbol=2; f symb=f b/bits per symbol; symbols=bits/bits per symbol; samples per symbol=f s/f symb; As shown in Figure 5, the rst step in 4QAM modulation is to convert our serial sequence of bits b[n] into two parallel sequences b1 [n] and b2 [n]. You can do this using the commands b mat=reshape(b,bits per symbol,symbols); b 1=b mat(1,:); b 2=b mat(2,:); Verify that this works by comparing the rst 10 bits in b[n] (use the command b(1:10)) with the rst 5 bits in b1 [n] and b2 [n] (use the commands b 1(1:5) and b 2(1:5)). Notice that the bits in b[n] having even indices go into one of the parallel bit sequences, while the bits with odd indices go into the other. Next, we need to map each pair of bits to a 4QAM symbol, in order to generate the symbol sequence s[n], as shown in Figure 5. Like in the complex QAM scheme of Section 1.3, the 4QAM symbols are complex. You can do the mapping using the command sn=a*(-2*(b 1-0.5)+j*-2*(b 2-0.5)); Here, you need to choose the value for a that results in an average symbol power of one. You can check that the average symbol power is normalised in this way using the command sum(abs(sn).2)/symbols Output the rst ve values in your resultant symbol sequence s[n] using the command sn(1:5). Make sure that you can see how the bit values in b1 [n] and b2 [n] relate to the corresponding complex values in s[n]. The possible values of the 4QAM symbols in s[n] can be visualised using the constellation diagram of Figure 7. The bit mapping we have used is called the Gray bit mapping. Table 1 would detail this bit mapping, but it is incomplete. b1 [n] 0 0 1 1 b2 [n] 0 1 0 1 s[n]

Table 1: 4QAM Gray bit mapping Include the bit and symbol values that you observed in your write-up. Include a 9

Im(s[n])

Re(s[n])

Figure 7: 4QAM constellation diagram. table like Table 1 in your write-up and ll in the missing complex values of s[n] by examining the provided Matlab code. Comment on how the distance between the various pairs of constellation points in Figure 7 is related to how similar their mapped bit values are. Comment on why this is benecial. Derive an expression for the value of a that correctly normalises the average symbol power and include this in your write-up.

b) Impulse generation As shown in Figure 5, the next step is to convert our sequence of discrete 4QAM symbols s[n] into a continuous function of time s(t). We can do this by generating impulses having the corresponding complex amplitudes, as shown in Figure 5. Since our symbols are generated at a rate of fsymb = 104 symbols/s, each one has a duration of 104 s. Lets generate our impulses at the midpoints of these durations. Remember that in our simulation, we are using samples to model the various continuous functions of time. Hence, you can generate s(t) by up-sampling s[n] by samples per symbol times. You can do this using the command st=upsample(sn*samples per symbol,samples per symbol,samples per symbol/2); Here, the third parameter ensures that the impulses occur at the midpoints of the symbol durations. Plot the real and imaginary parts of the rst 1000 samples in s(t). Make sure that you can see how these plots relate to the rst ve bits of b1 [n] and b2 [n], as well as the rst ve complex values in s[n]. Also, generate the PSDs for the real and imaginary parts of s(t). Include these plots and one of the PSDs in your write-up. With reference to your PSD, comment on why it is necessary to apply a LPF to s(t) before modulating it onto the channel.

10

c) Root raised cosine ltering The root raised cosine lter of Figure 5 is a special type of LPF that is particularly suited for digital modulation in the presence of AWGN. You can generate a root raised cosine lter using the command B rrcos=firrcos(10*samples per symbol,f symb/2,f symb,f s,sqrt); Like in Section 1.1a, use the filter2 function to lter s(t) and generate the analogue signal x(t). Compare the real part of the signals s(t) and x(t) using the commands figure; plot(t(1:1000),real(x(1:1000)),-, t(1:1000),real(st(1:1000))/samples per symbol,--); Do the same for the imaginary part. Also, generate PSDs for the real and imaginary parts of x(t). Include these plots and one of the PSDs in your write-up. Comment on how the signals s(t) and x(t) are related. What is the maximum frequency that is present within the signal x(t)? How does this compare to the symbol rate fsymb ?

d) Modulation and demodulation Use the Matlab code you wrote for Section 1.4 to simulate the transmission of your signal x(t). Compare the real and imaginary parts of x(t) with those of x (t) using the commands provided in Section 1.4a. Conrm that these signals are very similar and that they only dier because of the noise you introduced. State the bandwidth of y (t) in your write-up.

e) Root raised cosine ltering 2 As shown in Figure 6, the rst step in obtaining b[n] from x (t) is to lter it. This will remove some of the noise that was not ltered out by the LPF of Figure 4. You should use the same root raised cosine lter that you designed in Section 2.1c and you should use the filter2 function again. Compare the real and imaginary parts of the resultant signal s (t) with those of s(t) by using commands similar to the one provided in Section 2.1c. As shown in Figures 5 and 6, the impulses of s(t) pass through two root raised cosine lters, one in the transmitter and one in the receiver. Figure 8 shows the impulse response of this pair of lters. In the absence of any channel noise, the signal s (t) can be obtained by convolving s(t) with the response shown in Figure 8. This convolution replaces each impulse in s(t) with a version of the impulse response shown in Figure 8 that has the corresponding complex amplitude. Include your new plots in your write-up. With reference to Figure 8, explain how the root raised cosine lters of Figures 5 and 6 facilitate a low bandwidth without inducing inter symbol interference.

f) Sampling and 4QAM demapping Next, we need to sample s (t) at the midpoints of the symbol durations, as shown in Figure 6. These midpoints coincide with the impulses shown in the plots you just generated. You can sample s (t) using the command

11

Impulse response of a pair of 10 kHz root raised cosine filters 1

Normalised impulse response

0.75

0.5

0.25

0 0.2 0.1 0 0.1 Time since impulse [ms] 0.2

Figure 8: 4QAM constellation diagram. snhat=sthat(upsample(ones(size(sn)), samples per symbol,samples per symbol/2)==1); Output the rst ve values in the resultant sequence s [n] using a command similar to the one suggested in Section 2.1a. Make sure that you can see how these ve values are obtained from s (t) by comparing them with the plots you generated in Section 2.1e. As shown in Figure 6 the next step is 4QAM demapping. This can be performed by seeing where the samples in s [n] occur within the constellation diagram of Figure 7. More specically, we need to decide which constellation point is the nearest to each sample. For 4QAM, we can do this by seeing which side of the axes the samples are. We can do this using the commands b 1hat=real(snhat)<0; b 2hat=imag(snhat)<0; Display the rst ve bits in the resultant sequences b1 [n] and b2 [n] using similar commands to the ones suggested in Section 2.1a. Make sure you can see why these values have been selected for these bits by considering the rst ve values in snhat. The nal step of Figure 6 is parallel to serial conversion. You can achieve this using the commands b mathat=[b 1hat;b 2hat]; b hat=reshape(b mathat,1,bits); Display the rst ten bits in the resultant sequence b[n] using a similar command to the one suggested in Section 2.1a. Include the values of s [n], b1 [n], b2 [n] and b[n] that you observed in your write-up. Comment on how these values compare to the ones you observed in Section 2.1a.

12

g) Bit Error Ratio We can assess how well our 4QAM modulation scheme has mitigated the noise n(t) by comparing b[n] with b[n]. The similarity of these bit sequences may be quantied using the Bit Error Ratio (BER), which is obtained using the command ber=sum(b hat=b)/bits In Section 1.4a, a multiplier of 0.01 was applied to the noise signal n(t). Gradually increase this multiplier until at least one of the rst ten bits in b[n] diers to the corresponding bit in b[n]. Using your new noise multiplier, compare the real and imaginary parts of x(t) with those of x (t) by invoking the commands provided in Section 1.4a. Also, compare the real and imaginary parts of s (t) with those of s(t) by using commands similar to the one provided in Section 2.1c. Include the new plots in your write-up. Also provide the rst ve values of s [n], b1 [n] and b2 [n], as well as the rst ten values of b[n]. Comment on why the observed bit errors have occurred. State the BER that you obtained.

2.2

16-ary Quadrature Amplitude Modulation

In the 4QAM scheme of Section 2.1, we transmitted two bits at a time and achieved a bit rate of fb = 20 kbit/s. However, we can achieve higher bit rates by transmitting more bits at a time. In M = 16-ary Quadrature Amplitude Modulation (16QAM), we transmit log2 (M ) = 4 bits at a time, as shown in Figures 9 and 10.
b1 [n] b[n] Serial to parallel converter b4 [n] 16QAM mapper s[n] impulse generator s(t) Root raised x(t) cosine lter

Figure 9: Digital to analogue conversion using 16QAM.


b1 [n] x (t) Root raised cosine lter s (t) sampler s [n] 16QAM demapper b4 [n] Parallel to serial converter b[n]

Figure 10: Analogue to digital conversion using 16QAM. Compare Figures 9 and 10 with Figures 5 and 6. Notice that the only dierences are in the design of the serial to parallel converter, the bit mapper, the bit demapper and the parallel to serial converter. In this section, youll need to write some Matlab code that will simulate each of these components.

a) Parallel to serial conversion Modify the .m le you wrote in Section 2.1 to give a bit rate of fb = 40 kbit/s. Also, modify this code to decompose the bit sequence b[n] into four 13

sequences b1 [n], b2 [n], b3 [n] and b4 [n], as shown in Figure 9. Output the rst 20 bits in b[n], as well as the rst ve bits in each of b1 [n], b2 [n], b3 [n] and b4 [n]. Include these values in your write-up and comment on how they are related. Also, include any lines of Matlab code that you modied.

b) Bit mapping The constellation diagram for 16QAM is provided in Figure 11. The constellation points in this gure are labelled with the corresponding Gray-mapped bit values of b1 [n], b2 [n], b3 [n] and b4 [n].
Im(s[n]) {b1 [n], b2 [n], b3 [n], b4 [n]} = 0010 0011 3a 2a 0110 0111 a Re(s[n]) 0101 0100 0001 0000

3a 1110

2a

a 1111 a 2a

a 1101

2a

3a 1100

1010

1011 3a

1001

1000

Figure 11: 16QAM constellation diagram and Gray bit mapping. Write some Matlab code to perform 16QAM bit mapping. There are a number of ways that you could do this, so feel free to get creative! Youll need to normalise the average symbol power to one by selecting a value for the constant a of Figure 11. Note that this value will be dierent to the one you used in 4QAM. Because the average symbol powers of both the 4QAM and 16QAM schemes are normalised in this way, it is fair to compare them. Output the rst ve complex values in the resultant symbol sequence s[n]. Include these values in your write-up and comment on how they are related to the bit values you obtained in Section 2.2a. Also, include your Matlab code for performing 16QAM bit mapping. Comment on how the distance between the various pairs of constellation points in Figure 11 is related to how similar their mapped bit values are. Comment on why this is benecial. Finally, include a derivation of the constant a.

c) Modulation and demodulation Use the Matlab code you wrote in Section 2.1 to transmit s[n] and recover s [n]. Output the rst ve complex values in s [n]. Include these values in your write-up. Also, include plots and PSDs that correspond 14

to the ones you generated in Section 2.1. What is the maximum frequency that is present within the signal x(t)? How does this compare to the symbol rate fsymb ? What is the bandwidth of the signal y (t)? How does this compare to the bandwidth of the 4QAM scheme?

d) Bit demapping Write some Matlab code to perform 16QAM bit demapping. Again, there are a number of ways that you could do this. Display the rst ve bits in the resultant sequences b1 [n], b2 [n], b3 [n] and b4 [n]. Include these values in your write-up and comment on how they relate to the rst ve values in s [n]. Also, include the Matlab code you wrote to perform 16QAM demapping. Explain how your code decides what value each bit should have.

e) Parallel to serial conversion Write some Matlab code to perform parallel to serial conversion. Display the rst 20 bits in the resultant sequence b[n]. Include these values in your write-up and comment on how they relate to the sequences b1 [n], b2 [n], b3 [n] and b4 [n]. Also, include the Matlab code you wrote to perform parallel to serial conversion. What BER do you obtain when you use the same noise multiplier that you found in Section 2.1g? Your 16QAM scheme has the same bandwidth and average transmit power as the 4QAM scheme, but it has the advantage of a higher bit rate. What is the disadvantage of 16QAM compared to 4QAM? Which of the bit sequences b1 [n], b2 [n], b3 [n] and b4 [n] do you think are most susceptible to bit errors? Explain your reasoning.

Sheng Chen 07/10/2005 Rob Maunder 14/10/2008

15

You might also like