Presentation is loading. Please wait.

Presentation is loading. Please wait.

Wireless PHY: Modulation and Demodulation Y. Richard Yang 09/6/2012.

Similar presentations


Presentation on theme: "Wireless PHY: Modulation and Demodulation Y. Richard Yang 09/6/2012."— Presentation transcript:

1 Wireless PHY: Modulation and Demodulation Y. Richard Yang 09/6/2012

2 2 Outline r Admin and recap r Frequency domain examples r Basic concepts of modulation r Amplitude modulation r Amplitude demodulation r Digital modulation

3 3 Admin r First assignment to be posted by this weekend r Any feedback on pace and coverage

4 4 Recap: Fourier Series of Periodic Function r A periodic function g(t) on [a, a+T] can be decomposed as: r For periodic function on [0, 1]

5 5 Fourier Transform r For those who are curious, we do not need it formally r Problem: what if g(t) is not periodic r Approach: m Truncate g(t) beyond [-L/2, L/2] (i.e., set = 0) and then repeat to define g L (t)

6 6 Fourier Transform Define Fourier Transform

7 Recap: Discrete Domain Analysis r FFT: Transforming a sequence of numbers x 0, x 1, …, x N-1 to another sequence of numbers X 0, X 1, …, X N-1 r Note r Hence X k is the coefficient for k Hz harmonics if the FFT N samples are for one sec 7

8 8 FFT Analysis vs Sample Rate X1X1 Nfft=Nsample X2X2 X Nfft/2 1Hz2HzNfft/2 Hz The freq. analysis resolution:

9 9 Frequency Domain Analysis Examples Using GNURadio r spectrum_2sin_plus m Audio m FFT Sink m Scope Sink m Noise

10 10 Frequency Domain Analysis Examples Using GNURadio r spectrum_1sin_rawfft m Raw FFT

11 11 Frequency Domain Analysis Examples Using GNURadio r spectrum_2sin_multiply_complex m Multiplication of a sine first by a real sine and then by a complex sine to observe spectrum

12 12 Takeaway from the Example r Advantages of I/Q representation

13 13 I/Q Multiplication Also Called Quadrature Mixing spectrum of complex signal x(t) spectrum of complex signal x(t)e j2f0t spectrum of complex signal x(t)e -j2f0t

14 14 Basic Question: Why Not Send Digital Signal in Wireless Communications? r Signals at undesirable frequencies m suppose digital frame repeat every T seconds, then signal decomposes into frequencies at 1/T, 2/T, 3/T, … m let T = 1 ms, generates radio waves at frequencies of 1 KHz, 2 KHz, 3 KHz, … 1 0 digital signal t

15 15 Frequencies are Assigned and Regulated

16 16 Spectrum and Bandwidth: Shannon Channel Capacity r The maximum number of bits that can be transmitted per second by a physical channel is: where W is the frequency range of the channel, and S/N is the signal noise ratio, assuming Gaussian noise

17 17 Frequencies for Communications VLF = Very Low FrequencyUHF = Ultra High Frequency LF = Low Frequency SHF = Super High Frequency MF = Medium Frequency EHF = Extra High Frequency HF = High Frequency UV = Ultraviolet Light VHF = Very High Frequency Frequency and wave length:  = c/f wave length, speed of light c  3x10 8 m/s, frequency f 1 Mm 300 Hz 10 km 30 kHz 100 m 3 MHz 1 m 300 MHz 10 mm 30 GHz 100  m 3 THz 1  m 300 THz visible light VLFLFMFHFVHFUHFSHFEHFinfraredUV optical transmission coax cabletwisted pair

18 18 Why Not Send Digital Signal in Wireless Communications? voice Transmitter 20-20KHz Antenna: size ~ wavelength At 3 KHz, Antenna too large! Use modulation to transfer to higher frequency

19 19 Outline r Recap r Frequency domain examples r Basic concepts of modulation

20 20 r The information source m Typically a low frequency signal m Referred to as baseband signal  Carrier  A higher frequency sinusoid  Example cos(2π10000t)  Modulated signal  Some parameter of the carrier (amplitude, frequency, phase) is varied in accordance with the baseband signal Basic Concepts of Modulation

21 21 Types of Modulation r Analog modulation m Amplitude modulation (AM) m Frequency modulation (FM) m Double and signal sideband: DSB, SSB r Digital modulation m Amplitude shift keying (ASK) m Frequency shift keying: FSK m Phase shift keying: BPSK, QPSK, MSK m Quadrature amplitude modulation (QAM)

22 22 Outline r Recap r Frequency domain examples r Basic concepts of modulation r Amplitude modulation

23 23 Example: Amplitude Modulation (AM) r Block diagram r Time domain r Frequency domain

24 24 Example: am_modulation Example r Setting m Audio source (sample 32K) m Signal source (300K, sample 800K) m Multiply r Two Scopes r FFT Sink

25 25 Example AM Frequency Domain Note: There is always the negative freq. in the freq. domain.

26 26 Problem: How to Demodulate AM Signal?

27 27 Outline r Recap r Frequency domain examples r Basic concepts of modulation r Amplitude modulation r Amplitude demodulation

28 28 Design Option 1 r Step 1: Multiply signal by e -jfct m Implication: Need to do complex multiple multiplication

29 29 Design Option 1 (After Step 1) -2f c

30 30 Design Option 1 (Step 2) r Apply a Low Pass Filter to remove the extra frequencies at -2f c -2f c

31 31 Design Option 1 (Step 1 Analysis) r How many complex multiplications do we need for Step 1 (Multiply by e -jfct )?

32 32 Design Option 2: Quadrature Sampling

33 33 Quadrature Sampling: Upper Path (cos)

34 34 Quadrature Sampling: Upper Path (cos)

35 35 Quadrature Sampling: Upper Path (cos)

36 36 Quadrature Sampling: Lower Path (sin)

37 37 Quadrature Sampling: Lower Path (sin)

38 38 Quadrature Sampling: Lower Path (sin)

39 39 Quarature Sampling: Putting Together

40 40 Exercise: SpyWork r Setting: a scanner scans 128KHz blocks of AM radio and saves each block to a file (see am_rcv.py). r SpyWork: Scan the block in a saved file to find radio stations and tune to each station (each AM station has 10 KHz)

41 41 Remaining Hole: Designing LPF r Frequency domain view freq B-B freq B-B

42 42 Design Option 1 freq B-B freq B-B compute freq zeroing out not want freq compute time signal Problem of Design Option 1?

43 43 Impulse Response Filters r GNU software radio implements filtering using m Finite Impulse Response (FIR) filters m Infinite Impulse Response (IIR) Filters r FIR filters are more commonly used r Filtering is common in networks/communications (and AI and …)

44 44 FIR Filter r An N-th order FIR filter h is defined by an array of N+1 numbers: r Assume input sequence x0, x1, …,

45 45 Implementing a 3-rd Order FIR Filter r An array of size N+1 for h xnxn x n-1 x n-2 x n-3 h0h0 h1h1 h2h2 h3h3 **** x n+1 compute y[n]

46 46 Implementing a 3-rd Order FIR Filter r An array of size N+1 for h xnxn x n-1 x n-2 x n-3 h0h0 h1h1 h2h2 h3h3 **** x n+1 compute y[n+1]

47 47 FIR Filter is also called convolution between x (as a vector) and h (as a vector), denoted as Key Question: How to Determine h?

48 g*h in the Continuous Time Domain 48 r Remember that we consider x as samples of time domain function g(t) on [0, 1] and (repeat in other intervals) r We also consider h as samples of time domain function h(t) on [0, 1] (and repeat in other intervals) for (i = 0; i< N; i++) y[t] += h[i] * g[t-i];

49 Visualizing g*h 49 g(t) h(t) time

50 Visualizing g*h 50 g(t) h(t) time t

51 Fourier Series of y=g*h 51

52 Fubini’s Theorem r In English, you can integrate m first along y and then along x m first along x and then along y m at (x, y) grid They give the same result 52 See http://en.wikipedia.org/wiki/Fubini's_theorem

53 Fourier Series of y=g*h 53

54 Summary of Progress So Far 54 y = g * h => Y[k] = G[k] H[k] is called the Convolution Theorem, an important theorem.

55 Applying Convolution Theorem to Design LPF 55 r Choose h() so that m H() is close to a rectangle shape m h() has a low order (why?)

56 Applying Convolution Theorem to Design LPF 56 r Choose h() so that m H() is close to a rectangle shape m h() has a low order (why?)

57 Sinc Function 57 r The h() is often related with the sinc(t)=sin(t)/t function f 1/2-1/2 1

58 FIR Design in Practice 58 r Compute h m MATLAB or other design software m GNU Software radio: optfir (optimal filter design) m GNU Software radio: firdes (using a method called windowing method) r Implement filter with given h m freq_xlating_fir_filter_ccf or m fir_filter_ccf

59 LPF Design Example 59 r Design a LPF to pass signal at 1 KHz and block at 2 KHz

60 LPF Design Example 60 #create the channel filter # coefficients chan_taps = optfir.low_pass( 1.0, #Filter gain 48000, #Sample Rate 1500, #one sided mod BW (passband edge) 1800, #one sided channel BW (stopband edge) 0.1, #Passband ripple 60) #Stopband Attenuation in dB print "Channel filter taps:", len(chan_taps) #creates the channel filter with the coef found chan = gr.freq_xlating_fir_filter_ccf( 1, # Decimation rate chan_taps, #coefficients 0, #Offset frequency - could be used to shift 48e3) #incoming sample rate

61 61 Outline r Recap r Frequency domain examples r Basic concepts of modulation r Amplitude modulation r Amplitude demodulation r Digital modulation

62 62 r Modulation of digital signals also known as Shift Keying r Amplitude Shift Keying (ASK): m vary carrier amp. according to bit value r Frequency Shift Keying (FSK) o pick carrier freq according to bit value r Phase Shift Keying (PSK): 101 t 101 t 101 t Modulation

63 63 r BPSK (Binary Phase Shift Keying): m bit value 0: sine wave m bit value 1: inverted sine wave m very simple PSK r Properties m robust, used e.g. in satellite systems Q I 01 Phase Shift Keying: BPSK

64 64 Phase Shift Keying: QPSK 111000 0101 Q I 11 01 10 00 A t r QPSK (Quadrature Phase Shift Keying): m 2 bits coded as one symbol m symbol determines shift of sine wave m often also transmission of relative, not absolute phase shift: DQPSK - Differential QPSK

65 65 r Quadrature Amplitude Modulation (QAM): combines amplitude and phase modulation r It is possible to code n bits using one symbol m 2 n discrete levels 0000 0001 0011 1000 Q I 0010 φ a Quadrature Amplitude Modulation r Example: 16-QAM (4 bits = 1 symbol) r Symbols 0011 and 0001 have the same phase φ, but different amplitude a. 0000 and 1000 have same amplitude but different phase

66 Exercise r Suppose fc = 1 GHz (fc1 = 1 GHz, fc0 = 900 GHz for FSK) r Bit rate is 1 Mbps r Encode one bit at a time r Bit seq: 1 0 0 1 0 1 r Q: How does the wave look like for? 66 111000 0101 Q I 11 01 10 00 A t

67 Generic Representation of Digital Keying (Modulation) r Sender sends symbols one-by-one r Each symbol has a corresponding signaling function g 1 (t), g 2 (t), …, g M (t), each has a duration of symbol time T r Exercise: m What is the setting for BPSK? for QPSK? 67

68 Checking Relationship Among g i () 68 r BPSK m 1: g 1 (t) = -sin(2πf c t) t in [0, T] m 0: g 0 (t) = sin(2πf c t) t in [0, T] r Are the two signaling functions independent? m Hint: think of the samples forming a vector, if it helps, in linear algebra m Ans: No. g 1 (t) = -g 0 (t)

69 Checking Relationship Among g i () 69 r QPSK m 11: sin(2πf c t + π/4) t in [0, T] m 10: sin(2πf c t + 3π/4) t in [0, T] m 00: sin(2πf c t - 3π/4) t in [0, T] m 01: sin(2πf c t - π/4) t in [0, T] r Are the four signaling functions independent? m Ans: No. They are all linear combinations of sin(2πf c t) and cos(2πf c t). m We call sin(2πf c t) and cos(2πf c t) the bases. m They are orthogonal because the integral of their product is 0.

70 Discussion: How does the Receiver Detect Which g i () is Sent? 70 r Assume synchronized (i.e., the receiver knows the symbol boundary). m This is also called coherent detection

71 Example: Matched Filter Detection 71 r Basic idea m consider each g m [0,T] as a point (with coordinates) in a space m compute the coordinate of the received signal s[0,T] m check the distance between g m [0,T] and the received signal s[0,T] m pick m* that gives the lowest distance value

72 Computing Coordinates 72 r Pick orthogonal bases {f 1 (t), f 2 (t), …, f N (t)} for {g 1 (t), g 2 (t), …, g M (t)} r Compute the coordinate of g m [0,T] as c m = [c m1, c m2, …, c mN ], where r Compute the coordinate of the received signal r[0,T] as r = [r 1, r 2, …, r N ] r Compute the distance between r and c m every cm and pick m* that gives the lowest distance value

73 Example: Matched Filter => Correlation Detector 73 received signal

74 74 Spectral Density of BPSK b R b =B b = 1/T b b f c : freq. of carrier fcfc Spectral Density = bit rate ------------------- width of spectrum used

75 75 Phase Shift Keying: Comparison BPSK QPSK f c : carrier freq. R b : freq. of data 10dB = 10; 20dB =100 111000 01 A t

76 Question 76 r Why would any one use BPSK, given higher QAM?


Download ppt "Wireless PHY: Modulation and Demodulation Y. Richard Yang 09/6/2012."

Similar presentations


Ads by Google