lab. 3 digital modulation digital modulation:

13
1 Lab. 3 Digital Modulation Digital modulation: Coder DAC Transmit filter Up- conversion Channel Down- conversion Receive filter ADC Processing Detection Decoder {1,0,0,1,0,1,...} {1,0,0,1,0,1,...} symbol noise Baseband equivalent channel model + RF RF

Upload: virote

Post on 08-Jan-2016

91 views

Category:

Documents


7 download

DESCRIPTION

Lab. 3 Digital Modulation Digital modulation:. RF. {1,0,0,1,0,1,...}. Up- conversion. Transmit filter. Coder. DAC. symbol. noise. RF. Receive filter. Down- conversion. +. Channel. Baseband equivalent channel model. {1,0,0,1,0,1,...}. ADC. Processing. Detection. Decoder. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lab. 3  Digital Modulation Digital modulation:

1

Lab. 3 Digital Modulation

Digital modulation:

Coder DAC Transmitfilter

Up-conversion

ChannelDown-conversion

Receivefilter

ADC Processing Detection Decoder

{1,0,0,1,0,1,...}

{1,0,0,1,0,1,...}

symbolnoise

Baseband equivalent channel model

+

RF

RF

Page 2: Lab. 3  Digital Modulation Digital modulation:

2

Coder (symbol mapper):– Maps the input bits to a symbol (number).

Digital-to-analog converter (DAC)– Convert digital sequence to analogy waveform

Transmit filtering (pulse shaping):– Maps the symbol to an analog waveform.

Receiver filtering (matched filtering)– Match the transmit waveform (noise filtering)

Analog-to-digital conversion (ADC):– Convert analogy waveform to digital sequence (sampling)

Processing/detection– Process and detect the transmit symbol

Decoder:– Demaps the detected symbols to bits

Page 3: Lab. 3  Digital Modulation Digital modulation:

3

Symbol mapping:

Transmit filtering:

Receive filtering:

{1,0,0,1,0,1,...}BPSK

Noise

Page 4: Lab. 3  Digital Modulation Digital modulation:

4

Sampling:

Detection:

Demapping:

{1,0,0,1,0,1,...}

Page 5: Lab. 3  Digital Modulation Digital modulation:

5

Digital equivalent baseband channel model:

Coder (symbol mapping):– PAM (1,3,5,7,..)

– QAM (1/3/5/7,..+j 1/3/5/7)

ComplexChannel h(n)

( ) ( ) ( )I Qa n a n j a n ( ) ( ) ( )I Qy n y n j y n

( ) ( ) ( )y n a n h n

Noise

Page 6: Lab. 3  Digital Modulation Digital modulation:

6

Practice 1:– Generate a 16-QAM mapper (Gray mapping).

– Map a bit sequence with the mappers.

(1110) (1010)(0110)(0010)

(1111) (1011)(0111)(0011)

(1101) (1001)(0101)(0001)

(1100) (1000)(0100)(0000)

* Note: there is no complex operations in C and you have to convert them into real operations

Page 7: Lab. 3  Digital Modulation Digital modulation:

7

We first consider the baseband equivalent system.

Note that the operations of the digital systems can be exactly modeled. However, those of analog systems can only be approximately modeled.

Coder DAC Transmitfilter

Up-conversion

ChannelDown-conversion

Receivefilter

ADC Processing Detection Decoder

{1,0,0,1,0,1,...}

{1,0,0,1,0,1,...}

symbolnoise

Baseband equivalent channel model

+

Page 8: Lab. 3  Digital Modulation Digital modulation:

8

Thus, we conduct simulations all on the digital domain.

This assumes that all the processing in analog domain is either perfect or can be absorbed into the channel and noise effects.

Coder Channel

Processing Detection Decoder

{1,0,0,1,0,1,...}

{1,0,0,1,0,1,...}

symbol

noiseDigital

+

Digital

Page 9: Lab. 3  Digital Modulation Digital modulation:

9

Detection:– Minimum error probability (maximize the posteriori

probability) For PAM:

For QAM:

1 3-1-3

Decision boundary

Page 10: Lab. 3  Digital Modulation Digital modulation:

10

Practice 2– Generate a 16-QAM sequence.

– Add Gaussian noise to have a SNR of 10 dB.

– Check if your generation is right.

Practice 3:– Conduct detection for the QAM symbols.

– Calculate the probability of symbol error.

*Signal power : 4(12+12)/16+8(12+32)/16+4(32+32)/16=10 10log10(10/2)=10 2 =1

* You can write data to a file and use Matlab to plot or calculate.

C: FILE *fp; fp = fopen("noise_r.dat","wb"); fwrite(nr,4,M,fp); fclose(fp);

Matlab:fname=input('Input the file name?');len=input('Input the data length?');fid_1 = fopen(fname,'rb'); x = fread(fid_1,len,'float32'); fclose(fid_1);Length

Page 11: Lab. 3  Digital Modulation Digital modulation:

11

Homework:– Simulate the symbol error rates (SERs) of the 16-QAM

scheme with SNRs of 5dB, 10dB, 15dB, etc such that you can plot a SER curve.

– Calculate the theoretical SERs and also plot a curve.

– Put these two curves in the same figure to see if your simulation results are OK.

Note: you may find that the result is different for different simulation.

Page 12: Lab. 3  Digital Modulation Digital modulation:

rand()– Uniform random variable

– between 0~RAND_MAX

– #include <stdlib.h>

– srand (time(NULL)); //Initialize random seed with system time

– http://www.cplusplus.com/reference/cstdlib/rand/

12

Page 13: Lab. 3  Digital Modulation Digital modulation:

13

Generate Gaussian Noise– Box-Muller method for generating Gaussian distributed

random numbers

– Generate z_1 and z_2 with U(-1,1), which can be done with z = 2y –1, y ~ U(0,1)

– Discard (z_1, z_2) unless r^2 = z_1^2 + z_2^2 1≦

– Consequently, we have