930 likes | 942 Vues
CS43 4 /53 4 : Topics in Networked (Networking) Systems Wireless Foundation: LPF; Digital Modulation and Demodulation; Wireless Channel Yang (Richard) Yang Computer Science Department Yale University 208A Watson Email: yry@cs.yale.edu http:// zoo.cs.yale.edu /classes/cs434 /. Admin.
E N D
CS434/534: Topics in Networked (Networking) SystemsWireless Foundation: LPF; Digital Modulation and Demodulation; Wireless ChannelYang (Richard) YangComputer Science DepartmentYale University208A WatsonEmail: yry@cs.yale.eduhttp://zoo.cs.yale.edu/classes/cs434/
Admin • PS1 status
Recap: Amplitude Modulation (AM) • Block diagram • Time domain • Frequency domain
Recap: Demod of AM • Design option 1: multiply modulated signal by e-jfct, and then LPF • Design option 2: quadrature sampling
Remaining Hole: How to Design LPF • Frequency domain view -B -B B B freq freq
Recap: Design Option 1 compute freq -B B -B B freq freq zeroing outoutbandfreq compute lower-passtime signal This is essentially how image compression works. Problem(s) of Design Option 1: FFT + IFFT
Design Option 2: Impulse Response Filters • GNU software radio implements filtering using • Finite Impulse Response (FIR) filters • Infinite Impulse Response (IIR) Filters • FIR filters are more commonly used • FIR/IIR is essentially online, streaming algorithms • They are used in networks/communications/vision/robotics…
FIR Filter • An N-th order FIR filter h is defined by an array of N+1 numbers: • They are often stored backward (flipped) • Assume input data stream is x0, x1, …, … hN h2 h1 h0
FIR Filter xn-3 xn-2 xn-1 xn xn+1 * * * * 3rd-OrderFilter h3 h2 h1 h0 compute y[n]:
FIR Filter xn-3 xn-2 xn-1 xn xn+1 * * * * h3 h2 h1 h0 compute y[n+1]
FIR Filter is also called convolution between x (as a vector) and h (as a vector), denoted as
Key Question Using h to Implement LPF • Q: • How to determine h? • Approach: • Understand the effects of y=g*h in the frequency domain
g*h in the Continuous Time Domain • Remember that we consider x as samples of time domain function g(t) on [0, 1] and (repeat in other intervals) • 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];
Visualizing g*h g(t) time h(t) 0 0 T T
Visualizing g*h g(t) g(t) time t h(0) 0 0 T T
Fubini’s Theorem • In English, you can integrate • first along y and then along x • first along x and then along y • at (x, y) grid They give the same result See http://en.wikipedia.org/wiki/Fubini's_theorem
Summary of Progress So Far y = g * h => Y[k] = G[k] H[k] In the case of Fourier Transform, y = g * h => Y[f] = G[f] H[f] is called the Convolution Theorem, an important theorem.
Applying Convolution Theorem to Design LPF • Choose h() so that • H() is close to a rectangle shape • h() has a low order (why?) 1 f -1/2 1/2
Sinc Function • The h() is often related with the sinc(t)=sin(t)/t function f -1/2 1/2 1
FIR Design in Practice (Offline) • Compute h • MATLAB or other design software • GNU Software radio: optfir (optimal filter design) • GNU Software radio: firdes (using a method called windowing method) • Implement filter with given h • freq_xlating_fir_filter_ccf or • fir_filter_ccf
LPF Design Example (Offline) • Design a LPF to pass signal at 1 KHz and block at 2 KHz
LPF Design Example (Offline) #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 foundchan = gr.freq_xlating_fir_filter_ccf( 1 , # Decimation rate chan_taps, #coefficients 0, #Offset frequency - could be used to shift 48e3) #incoming sample rate
Outline • Recap • Wireless background • Frequency domain • Modulation and demodulation • Basic concepts • Amplitude modulation/demodulation • Amplitude demodulation • frequency shifting • low pass filter and Convolution Theorem • Digital modulation
Modulation • Modulation of digital signals also known as Shift Keying • Amplitude Shift Keying (ASK): • vary carrier amp. according to data • Frequency Shift Keying (FSK) • vary carrier freq. according to bit value • Phase Shift Keying (PSK) • vary carrier freq. according to data 1 0 1 t 1 0 1 t 1 0 1 t
Q I 0 1 Phase Shift Keying: BPSK • BPSK (Binary Phase Shift Keying): • bit value 1: cosine wave cos(2πfct) • bit value 0: inverted cosine wave cos(2πfct+π) • very simple PSK • Properties • robust, used e.g. in satellite systems one bit time T one bit time T 1 0
Q 11 10 I 00 01 Phase Shift Keying: QPSK • QPSK (Quadrature Phase Shift Keying): • 2 bits coded at a time • we call the two bits as one symbol • symbol determines shift of cosine wave • often also transmission of relative, not absolute phase shift: DQPSK - Differential QPSK
Example: 16-QAM (4 bits = 1 symbol) Symbols 0011 and 0001 have the same phase φ,but different amplitude a. 0000 and 1000 have same amplitude but different phase Q 0010 0001 0011 0000 φ I a 1000 Quadrature Amplitude Modulation • Quadrature Amplitude Modulation (QAM): combines amplitude and phase modulation • It is possible to code n bits using one symbol • 2n discrete levels
Generic Representation of Digital Keying (Modulation) • Sender sends symbols one-by-one • M signaling functions g1(t), g2(t), …, gM(t), each has a duration of symbol time T • Each value of a symbol has a signaling function
Q I 0 1 Exercise: gi() for BPSK • 1: • g1(t) = cos(2πfct) t in [0, T] • 0: • g0(t) = -cos(2πfct) t in [0, T] • Are the two signaling functions independent? • Hint: think of the samples forming a vector, if it helps, in linear algebra • Ans: No. g1(t) = -g0(t) -1 1 cos(2πfct)[0, T] g0(t) g1(t)
Q 11 10 I 00 01 Exercise: Signaling Functions gi() for QPSK • 11: • cos(2πfct + π/4) t in [0, T] • 10: • cos(2πfct + 3π/4) t in [0, T] • 00: • cos(2πfct - 3π/4) t in [0, T] • 01: • cos(2πfct - π/4) t in [0, T] • Are the four signaling functions independent? • Ans: No. They are all linear combinations of sin(2πfct) and cos(2πfct).
sin(2πfct) 00 11 10 QPSK Signaling Functions as Sum of cos(2πfct), sin(2πfct) 01 • 11: cos(π/4 + 2πfct) t in [0, T] -> cos(π/4) cos(2πfct) + -sin(π/4) sin(2πfct) • 10: cos(3π/4 + 2πfct) t in [0, T] -> cos(3π/4) cos(2πfct) + -sin(3π/4) sin(2πfct) • 00: cos(- 3π/4 + 2πfct) t in [0, T] -> cos(3π/4) cos(2πfct) + sin(3π/4) sin(2πfct) • 01: cos(- π/4 + 2πfct) t in [0, T] -> cos(π/4) cos(2πfct) + sin(π/4) sin(2πfct) • [cos(π/4), sin(π/4)] • [cos(3π/4), sin(3π/4)] cos(2πfct) • [cos(3π/4), -sin(3π/4)] • [-sin(π/4), cos(π/4)] • We call sin(2πfct) and cos(2πfct) the bases.
Outline • Recap • Wireless background • Frequency domain • Modulation and demodulation • Basic concepts • Amplitude modulation/demodulation • Digital modulation • modulation • demodulation
Key Question: How does the Receiver Detect Which gi() is Sent? • Assume synchronized (i.e., the receiver knows the symbol boundary).
Starting Point • Considered a simple setting: sender uses a single signaling function g(), and can have two actions • send g() or • nothing (send 0) • How does receiver use the received sequence x(t) in [0, T] to detect if sends g() or nothing?
Design Option 1 • Sample at a few time points (features) to check • Issue • Not use all data points, and less robust to noise
Design Option 2 • Streaming algorithm, using all data points in [0, T] • As each sample xi comes in, multiply it by a factor hT-iand accumulate to a sum y • At time T, makes a decision based on the accumulated sum at time T: y[T] x0 x1 x2 xT * * * * hT h2 h1 h0
Example Streaming (Convolution/Correlation): • Assume incoming x is a rectangular pulse (in baseband) and h is also a rectangular pulse • A gif animation (play in ppt) presentation): • redline g(): the sliding filter h(t) • blue line f(): the input x() Source: http://en.wikipedia.org/wiki/File:Convolution_of_box_signal_with_itself2.gif
Determining the Best h where w is noise, Design objective: maximize peak pulse signal-to-noise ratio
Determining the Best h Assume Gaussian noise, one can derive Using Fourier Transform and Convolution Theorem:
Determining the Best h Apply Schwartz inequality By considering
Determining Best h to Use x0 x0 x1 x1 x2 x2 xT xT * * * * * * * * g0 hT g1 h2 g2 h1 gT h0
Matched Filter Decision is called Matched filter. Example decision time
Summary of Progress • After this “complex” math, the implementation/interpretation is actually the following quite simple alg: • precompute auto correlation: <g, g> • compute the correlation between received x and signaling function g, denoted as <x, g> • if <x, g> is closer to <g, g> • output sends g • else • output sends nothing
Applying Scheme to BPSK • Consider g1 alone, compute <x, g1>, check if close to <g1, g1>: |<x, g1> - <g1, g1>| • Consider g0 alone, compute <x, g0>, check if close to <g0, g0>: |<x, g0> - <g0, g0>| • Pick closer • if |<x, g1> - <g1, g1>| < |<x, g0> - <g0, g0>| • pick 1 • else • pick 0 -1 1 cos(2πfct)[0, T] g0(t) g1(t)
Applying Scheme to BPSK • since g0 = -g1 • <x, g0> = - <x, g1> • <g0, g0> = - <g0, g1> • rewrite as • if |<x, g1> - <g1, g1>| < |<x, g1> - <g0, g1>| • pick 1 • else • pick 0 -1 1 cos(2πfct)[0, T] g0(t) g1(t)
Interpretation • For any signal s, <s, g1> computes the coordinate (projection) of s when using g1 as a base • cleaner if g1 is normalized (i.e., scale g1 by sqrt of <g1, g1>), but we do not worry about it yet <x, g1(t)> g1=cos(2πfct)[0, T] <g0(t), g1(t)> <g1(t), g1(t)> =-<g1(t), g1(t)>
Applying Scheme to QPSK: Attempt 1 • Consider g00 alone, compute <x, g00> … • Consider g01 alone, compute <x, g01> … • Consider g10 alone, compute <x, g10> … • Consider g11 alone, compute <x, g11> … • Issues • Complexity: • need to compute M correlation, where M is number of signaling functions • Think of 64-QAM