DSP C 5000 Chapter 21 Frequency Modulation GMSK

  • Slides: 70
Download presentation
DSP C 5000 Chapter 21 Frequency Modulation GMSK Modulation Copyright © 2003 Texas Instruments.

DSP C 5000 Chapter 21 Frequency Modulation GMSK Modulation Copyright © 2003 Texas Instruments. All rights reserved.

Learning Objectives u u u ESIEE, Slide 2 Overview of Digital Modulation Understanding GMSK

Learning Objectives u u u ESIEE, Slide 2 Overview of Digital Modulation Understanding GMSK Modulation Learning how to Implement a GMSK Modulator on a C 54

Digital Modulations u Basebandpass signalling are used to transmit data on physical channels such

Digital Modulations u Basebandpass signalling are used to transmit data on physical channels such as telephone cables or radiofrequency channels. The source of data (bits or symbol) may be a computer file or a digitized waveform (speech, video…) w The transmitted signal carries information about the data and its characteristic changes at the same rate as the data. When the signal carrying the data information w Extends from 0 Hz upwards, the term baseband signalling is used. w Has its power centered on a central frequency fc, the term bandpass signalling or modulation is used. w u ESIEE, Slide 3

Digital Modulation u Modulation is used because: w w w ESIEE, Slide 4 The

Digital Modulation u Modulation is used because: w w w ESIEE, Slide 4 The channel does not include the 0 Hz frequency and baseband signalling is impossible The bandwidth of the channel is split between several channels for frequency multiplexing For wireless radio-communications, the size of the antenna decreases when the transmitted frequency increases.

Carrier Frequency u u In simple modulation schemes, a single frequency signal, the carrier,

Carrier Frequency u u In simple modulation schemes, a single frequency signal, the carrier, is modified at the rate of the data. The carrier is commonly written as: fc= Carrier frequency A = Carrier Amplitude = Carrier phase u ESIEE, Slide 5 The 3 main parameters of the carrier: amplitude, phase and frequency can be modified to carry the information leading to: amplitude, phase and frequency modulation.

Digital Modulation u CPM: Continuous Phase Modulation w w w u QAM: Quadrature Amplitude

Digital Modulation u CPM: Continuous Phase Modulation w w w u QAM: Quadrature Amplitude Modulation w w u Example: QPSK, OQPSK, 16 QAM Characteristic: High spectral efficiency Multicarrier Modulation w w ESIEE, Slide 6 Frequency or phase modulation Example: MSK, GMSK Characteristic: constant envelope modulation Example: OFDM, DMT Characteristic: Muti-path delay spread tolerance, effectivness against channel distortion

What is the Complex Envelope z(t) of a Modulated Signal x(t) ? fc= Carrier

What is the Complex Envelope z(t) of a Modulated Signal x(t) ? fc= Carrier frequency z(t) = Complex envelope of x(t) z. I(t), z. Q(t) are the baseband components x. H(t) = Hilbert transform of x(t) = x(t) with a phase shift of /2 Sx(f) = Power spectral density of x(t) ESIEE, Slide 7

Complex Envelope z of a Modulated Signal x Frequency Domain ESIEE, Slide 8

Complex Envelope z of a Modulated Signal x Frequency Domain ESIEE, Slide 8

GMSK Modulation u Gaussian Minimum Shift Keying. u Used in GSM and DECT standards.

GMSK Modulation u Gaussian Minimum Shift Keying. u Used in GSM and DECT standards. Relevant to mobile communications because of constant envelope modulation: u w w u ESIEE, Slide 9 Quite insensitive to non-linearities of power amplifier Robust to fading effects But moderate spectral efficiency.

What is GMSK Modulation? u u u Continuous phase digital frequency modulation Modulation index

What is GMSK Modulation? u u u Continuous phase digital frequency modulation Modulation index h=1/2 Gaussian Frequency Shaping Filter GMSK = MSK + Gaussian filter Characterized by the value of BT w w ESIEE, Slide 10 T = bit duration B = 3 d. B Bandwidth of the shaping filter BT = 0. 3 for GSM BT = 0. 5 for DECT

GMSK Modulation, Expression for the Modulated Signal x(t) ak = Binary data = +/-

GMSK Modulation, Expression for the Modulated Signal x(t) ak = Binary data = +/- 1 h = Modulation index = 0. 5 Normalization s(t) = Gaussian frequency shaping filter s(t)= Elementary frequency pulse ESIEE, Slide 11

GMSK Elementary Phase Pulse ESIEE, Slide 12

GMSK Elementary Phase Pulse ESIEE, Slide 12

Architecture of a GMSK Modulator ESIEE, Slide 13

Architecture of a GMSK Modulator ESIEE, Slide 13

Equation for the Gaussian Filter h(t) The duration MTb of the gaussian pulse is

Equation for the Gaussian Filter h(t) The duration MTb of the gaussian pulse is truncated to a value inversely proportional to B. BT = 0. 5, MTb = 2 Tb BT = 0. 3, MTb = 3 or 4 Tb ESIEE, Slide 14

Frequency and Phase Elementary Pulses Tbg(t ) Elementary frequency pulse BTb = +¥ 0.

Frequency and Phase Elementary Pulses Tbg(t ) Elementary frequency pulse BTb = +¥ 0. 5 BTb = 0, 3 0. 4 0. 3 j (t ) Elementary phase pulse 1. 6 /2 BT b = +¥ 1. 4 1. 2 BT 1 BT b b = 0. 5 = 0. 3 0. 8 0. 6 0. 2 0. 4 0. 1 0 0. 2 0 -2 -1 0 1 2 t in number of bit periods Tb The elementary frequency pulse is the convolution of a square pulse r(t) with a gaussian pulse h(t). Its duration is (M+1)Tb. ESIEE, Slide 15 -2 -1 0 1 2 t in number of bit period Tb

GMSK Signals 1 Binary sequence t 0 -1 0 5 10 15 20 1

GMSK Signals 1 Binary sequence t 0 -1 0 5 10 15 20 1 t GMSK modulated Signal 0 -1 F (t ) 0 5 10 15 20 5 t 0 in rd -5 z I ( t ) = cos (F ( t ) ) 1 0 5 10 15 20 t 0 -1 0 5 10 15 20 1 z Q ( t ) = sin (F ( t ) ) 0 -1 ESIEE, Slide 16 t 0 5 10 15 20

Power Spectral Density of GMSK Signals ESIEE, Slide 17

Power Spectral Density of GMSK Signals ESIEE, Slide 17

Implementing a GMSK Modulator on a DSP u Quadrature modulation can be used: w

Implementing a GMSK Modulator on a DSP u Quadrature modulation can be used: w u Or a modulated loop can be used. w ESIEE, Slide 18 The DSP calculates the phase and the 2 baseband components z. I and z. Q and sends them to the DAC. In this case, the DSP generates the instantaneous frequency finst signal that is sent to the DAC.

Calculation of the Instantaneous Frequency u finst is obtained by a simple filtering of

Calculation of the Instantaneous Frequency u finst is obtained by a simple filtering of the bit sequence ak by a FIR filter of impulse response s(n). Open Matlab routine pul_phas. m to calculate s(n). Explanation of parameters are given in following slides. ESIEE, Slide 19

Expression for the Baseband Components u ESIEE, Slide 20 The baseband components z. I

Expression for the Baseband Components u ESIEE, Slide 20 The baseband components z. I and z. Q are modulated in amplitude by the 2 quadrature carriers.

Baseband Components and Carriers u Baseband components u The carriers are generally RF analog

Baseband Components and Carriers u Baseband components u The carriers are generally RF analog signals generated by analog oscillators However, we will show they could be generated digitally if the value of fc were not too high. u ESIEE, Slide 21

Calculation of the Baseband Components on a DSP u Calculate the phase at time

Calculation of the Baseband Components on a DSP u Calculate the phase at time m. TS w u ESIEE, Slide 22 Ts the sampling frequency. Read the value of cos( ) and sin( ) from a table.

Calculation of the Elementary Pulse Phase with Matlab u The elementary pulse phase (m.

Calculation of the Elementary Pulse Phase with Matlab u The elementary pulse phase (m. TS) is calculated with Matlab and stored in memory. w w ESIEE, Slide 23 The duration LT of the evolutive part of (m. TS) depends on the value of BT. is called phi in the matlab routine.

Calculation of the Elementary Pulse Phase with Matlab 1/2 Beginning of the matlab routine

Calculation of the Elementary Pulse Phase with Matlab 1/2 Beginning of the matlab routine Open Matlab routine pul_phas. m ESIEE, Slide 24

Calculation of the Elementary Pulse Phase with Matlab 2/2 End of the matlab routine

Calculation of the Elementary Pulse Phase with Matlab 2/2 End of the matlab routine ESIEE, Slide 25

Using the Matlab Routine u u Start Matlab Use: w w u call the

Using the Matlab Routine u u Start Matlab Use: w w u call the routine using to calculate the phase pulse phi ( ) and the pulse s: w u [phi, s]=pul_phas(T_over_Ts, L, BT, T) Plot the phase phi and the shaping pulse s w w ESIEE, Slide 26 T_over_Ts=8 L=4 T=1 BT=0. 3 plot(phi) plot(s)

Results of Matlab Routine ESIEE, Slide 27

Results of Matlab Routine ESIEE, Slide 27

Results for phi u For L=4 and T_over_Ts=8, we obtain 32 samples for phi.

Results for phi u For L=4 and T_over_Ts=8, we obtain 32 samples for phi. Matlab gives the following values for phi: u Phi= [0. 0001, 0. 0062, 0. 0127, 0. 1884, 0. 2740, 0. 9299, 1. 0672, 1. 4945, 1. 5262, 1. 5696, 1. 5703, u After this evolutive part of phi, phi stays equal to /2 (1. 57). To calculate , the evolutive part and the constant part of the elementary phase pulse phi are treated separately. u ESIEE, Slide 28 0. 0002, 0. 0005, 0. 0246, 0. 0446, 0. 3798, 0. 5036, 1. 1910, 1. 2968, 1. 5462, 1. 5581, 1. 5706] 0. 0012, 0. 0763, 0. 6409, 1. 3824, 1. 5646, 0. 0028, 0. 1231, 0. 7854, 1. 4476, 1. 5680,

Calculation of u ESIEE, Slide 29 Separation of evolutive and constant parts of phi.

Calculation of u ESIEE, Slide 29 Separation of evolutive and constant parts of phi.

Memory Part and Evolutive Part of ESIEE, Slide 30

Memory Part and Evolutive Part of ESIEE, Slide 30

Recursive Calculation of u Names of variables w w Phase = phi = array

Recursive Calculation of u Names of variables w w Phase = phi = array of evolutive part of , w w w u Ns = number of samples per bit = T/Ts an = binary sequence (+/- 1) 2 calculation steps: w w ESIEE, Slide 31 Nphi samples = LT/Ts Calculate z. I=cos( ) and z. Q=sin( ) by table reading

Calculation of : Initialization u Initialization step: w w u L first bit periods,

Calculation of : Initialization u Initialization step: w w u L first bit periods, phimem = 0 At bit L+1, phimem is set to a 1 /2. Principle of the initialization processing: w FOR i=1 to i=L w for j=(i-1)Ns+1 to j=(i-1)Ns+Nphi w w ESIEE, Slide 32 phase((i-1)Ns+j)= phase((i-1)Ns+j)+phi(j)an(i) Endfor end. FOR phimem=an(1) /2

Calculation of : After Initialization u FOR i=L+1 to last_bit w For j=(i-1)Ns+1 to

Calculation of : After Initialization u FOR i=L+1 to last_bit w For j=(i-1)Ns+1 to j=(i-1)Ns+Nphi w w w end. For j=(i-1)Ns+1 to j=i Ns w w w u ESIEE, Slide 33 phase((i-1)Ns+j)= phase((i-1)Ns+j)+phi(j)an(i) phase((i-1)Ns+j)= phase((i-1)Ns+j)+phimem xi=cos(phase(i-1)Ns+j) xq=sin(phase((i-1)Ns+j) end. For phimem=phimem+pi/2 an(i+1 -L) end. FOR

Coding and Wrapping the Phase Table u The phase value in [- , [

Coding and Wrapping the Phase Table u The phase value in [- , [ is represented by the 16 -bit number Iphase w w ESIEE, Slide 34 Minimum phase = - , Iphase = -215. Maximum phase = (1 -215), Iphase = 215 -1.

Index for the table in Phase Calculation u Phase increment between 2 table values:

Index for the table in Phase Calculation u Phase increment between 2 table values: w w 2 / Ncos and on Iphase 216/Ncos For Iphase, the index of the table is: w w w ESIEE, Slide 35 i= Ncos Iphase 2 -16 Here Ncos 2 -16 = 2 -9, So the index in the table is given by shifting Iphase 9 bits to the right.

Coding of phi u The quantized values of phi can be obtained with Matlab:

Coding of phi u The quantized values of phi can be obtained with Matlab: w u ESIEE, Slide 36 phi= round(phi*2^15/pi); phi is defined and initialized in the file phi 03. asm as:

Calculation of sin() and cos() by Table Lookup u We use a table of

Calculation of sin() and cos() by Table Lookup u We use a table of cosine values w w u u u ESIEE, Slide 37 Length of the table Ncos=128, circular buffer Contents of the table: cosine of angles i uniformly distributed between - and . deb_cos = first address of the table mid_cos = address of the table middle cos( i ) is at address mid_cos + i

Calculation of sin() and cos() by Table Lookup u Conversion of the phase modulo

Calculation of sin() and cos() by Table Lookup u Conversion of the phase modulo 2 : w w ESIEE, Slide 38 Wrapping phase in [- , [ Done by a macro: testa 02 pi

Generating the Sine Values from a Table of Cosine Values u To generate sin(

Generating the Sine Values from a Table of Cosine Values u To generate sin( ) from the table of cosine values, we use: w w cos( /2 - ) or cos(- /2 + ) or cos(3 /2+ ) If i is the index of the cosine, for the sine we use: w w ESIEE, Slide 39 i-Ncos/4 i+3 Ncos /4 if i>= -Ncos/4 if i < Ncos/4.

Implementation on a C 54 x, Test Sequence u We can test the GMSK

Implementation on a C 54 x, Test Sequence u We can test the GMSK modulation on a given periodical binary sequence an: w w an=[ 0 1 1 0 0] These bits are stored in a circular buffer: w w ESIEE, Slide 40 Size NB = 10 Declaration of a section bits aligned on an address which is a multiple of 16 bits.

Testing the Generation of on the C 54 x, Results Buffer u ESIEE, Slide

Testing the Generation of on the C 54 x, Results Buffer u ESIEE, Slide 41 We calculate and store it in a buffer pointed by AR 1. The size of the result buffer is 1000 words.

Testing the Generation of on the C 54 x Buffers ESIEE, Slide 42

Testing the Generation of on the C 54 x Buffers ESIEE, Slide 42

Listing for the Calculation of Definitions ESIEE, Slide 43

Listing for the Calculation of Definitions ESIEE, Slide 43

Listing for the Calculation of Macro for phase wrapping ESIEE, Slide 44

Listing for the Calculation of Macro for phase wrapping ESIEE, Slide 44

Listing for the Calculation of Initialization of Registers and Buffers 1/2 ESIEE, Slide 45

Listing for the Calculation of Initialization of Registers and Buffers 1/2 ESIEE, Slide 45

Listing for the Calculation of Initialization of Registers and Buffers 2/2 ESIEE, Slide 46

Listing for the Calculation of Initialization of Registers and Buffers 2/2 ESIEE, Slide 46

Listing for the Calculation of Calculation for the first L bits ESIEE, Slide 47

Listing for the Calculation of Calculation for the first L bits ESIEE, Slide 47

Listing for the Calculation of the Following Bits 1/2 ESIEE, Slide 48

Listing for the Calculation of the Following Bits 1/2 ESIEE, Slide 48

Listing for the Calculation of the Following Bits 2/2 ESIEE, Slide 49

Listing for the Calculation of the Following Bits 2/2 ESIEE, Slide 49

Illustration of the Phase Result Wrapped Between - and u ESIEE, Slide 50 Plot

Illustration of the Phase Result Wrapped Between - and u ESIEE, Slide 50 Plot under CCS the buffer of phase results

Generation of the Baseband Components z. I=cos( ) and z. Q=sin( ) u u

Generation of the Baseband Components z. I=cos( ) and z. Q=sin( ) u u u We calculate z. I and z. Q and we do not need to save the phase any more. We output ZI and Zq, in this example on DXR 0 and DXR 1. We need the table of constants for the values of cosine. w w ESIEE, Slide 51 This table is defined in the file tabcos. asm The cosine values are given in format Q 14.

File tabcos. asm ESIEE, Slide 52

File tabcos. asm ESIEE, Slide 52

Listing for the Calculation of z. I and z. Q u u u The

Listing for the Calculation of z. I and z. Q u u u The listing for definitions and initializations is the same as before. Processing of the L first bits, Processing of the other bits w ESIEE, Slide 53 (infinite loop)

Processing of the First L Bits 1/2 ESIEE, Slide 54

Processing of the First L Bits 1/2 ESIEE, Slide 54

Processing of the First L Bits 2/2 ESIEE, Slide 55

Processing of the First L Bits 2/2 ESIEE, Slide 55

Processing of the Following bits 1 of 2 ESIEE, Slide 56

Processing of the Following bits 1 of 2 ESIEE, Slide 56

Processing of the Following Bits 2 of 2 ESIEE, Slide 57

Processing of the Following Bits 2 of 2 ESIEE, Slide 57

Results Observed in CCS ESIEE, Slide 58

Results Observed in CCS ESIEE, Slide 58

Generation of 2 Quadrature Carriers u Generation of: w w u u ESIEE, Slide

Generation of 2 Quadrature Carriers u Generation of: w w u u ESIEE, Slide 59 cos(2 fct) and sin (2 fct) fc is the frequency of the carrier In this example we choose fc=1/T Sampling frequency = 1/Ts = f. S In RF applications, the carriers are not generated by the DSP. It is only possible to use the DSP for low values of fc. The angle (t)= 2 fct is calculated then the value of cos() is read from a table.

Calculation of the Angle of the Carriers u u u ESIEE, Slide 60 Recursive

Calculation of the Angle of the Carriers u u u ESIEE, Slide 60 Recursive calculation of the angle : The precision of the generated frequency depends on the precision of . The phase increment corresponds to an increment I to the integer that represents . u I =216 fc. TS rounded to the closest integer.

Calculation of the Angle of the Carriers u u If the number of samples

Calculation of the Angle of the Carriers u u If the number of samples period of the carrier is a power of 2, 2 k: w I =216 fc. TS=2(16 -k) is exact w Then the precision of the generated frequency depends only on the precision of the sampling frequency. Otherwise, there is an error dfc in fc: w u ESIEE, Slide 61 |dfc|<2 -17 f. S. Error in the amplitudes of the carriers due to finite precision of the table reading. (possible interpolation).

Implementation on a C 54 x u u ESIEE, Slide 62 We use: fs/fc=8=Ns.

Implementation on a C 54 x u u ESIEE, Slide 62 We use: fs/fc=8=Ns. The cosine table has 128 Values in Q 14.

Implementation on a C 54 x u u u ESIEE, Slide 63 Here k=3

Implementation on a C 54 x u u u ESIEE, Slide 63 Here k=3 (8 samples period) and the increment w I =216 fc. TS=2(16 -k) =213 Simple case of f. S/fc as an integer value, the table is read with an offset from the pointer = 16 = 27/23 to generate a cosine with 8 samples period. We can work directly on the index i and not on I.

Generation of the Cosine and Sine Carriers u For the cosine: w w w

Generation of the Cosine and Sine Carriers u For the cosine: w w w u For the sine: w w w u ESIEE, Slide 64 The circular buffer containing the cosine values (length N) is accessed with AR 1. Incremented by the content of AR 0=16. AR 1 initialized with deb_cos. Same circular buffer accessed by AR 2 initialized with deb_cos + Ncos/4. Decremented by AR 0=16. Outputs (cos and sin) are sent to DXR 0 and DXR 1.

Generation of quadrature 2 Carriers u u u File porteuse. asm A file associated

Generation of quadrature 2 Carriers u u u File porteuse. asm A file associated with DXR 0 and DXR 1 is used to save visual results obtained with the CCS simulator. Here cosine table goes from: w ESIEE, Slide 65 0 to 2

Listing for the Generation of 2 Carriers 1 of 2 ESIEE, Slide 66

Listing for the Generation of 2 Carriers 1 of 2 ESIEE, Slide 66

Listing for the Generation of 2 Carriers 2 of 2 ESIEE, Slide 67

Listing for the Generation of 2 Carriers 2 of 2 ESIEE, Slide 67

Results Obtained with CCS ESIEE, Slide 68

Results Obtained with CCS ESIEE, Slide 68

Tutorial u The listing files for the precedent examples can be found in the

Tutorial u The listing files for the precedent examples can be found in the directory “tutorial”: w ESIEE, Slide 69 Tutorial > Dsk 5416 > Chapter 21 > Labs_modulation

Further Activities u Application 5 for the TMS 320 C 5416 DSK and for

Further Activities u Application 5 for the TMS 320 C 5416 DSK and for the TMS 320 C 5510. u Alien Voices. A very simple application showing the effect of modulation on audio frequencies. It shows how the carrier causes sum and difference frequencies to be generated. Here it is used to generate the strange voices used for aliens in science fiction films and television. ESIEE, Slide 70