Lab 1
Camera Communication
Platform – Same as in-class #2
• USRP + LED as Tx
• Raspberry pi camera
• Boost your data rate !! Up to 8kbps
Camera
• Raspberry pi
• Frame rate 30fps
• Shutter speed = 1us
• Resolution 1920*1080
Grading criteria
• Unawareness + workable – 20%
• Intensity stays constant over any 15ms ( 60Hz )
• Transmit 8bps ( in-class #2 )
• Baseline – 40%
• 128 bps
• Boost data rate – 30%
• 5% for each 2x. Maximum rate up to 128 × 26 = 8192 bps
• Report – 10%
• Encode / decode explanation + work division
How rolling shutter works ?
Signal Time
Global Shutter
1/30 s (1/fps)
Rolling Shutter
Tr (Read-out time)
Varies with camera models Time Gap
Find signal start
• Preamble
• Indicate the start(/end) of the signal
• Tx / Rx do not sync
• E.g. Tx transmits -> random ( 10ms, 100ms ) -> Rx camera start
• Unique symbol (sequence)
• Unused frequency in FSK
• Long bright/dark in Manchester coding
• May not follow symbol duration
• Need to have a clear “ending”
• Counter example : long bright + 1st symbol Manchester ‘0’
( bright/dark)
Signal Loss handling
Signal Time Rolling Shutter
Tr (Read-out time)
Varies with camera models 𝑇𝑖𝑚𝑒 𝐺𝑎𝑝 = 1
𝑓𝑝𝑠 − 𝑇𝑟 × #𝑟𝑜𝑤𝑠
𝑇 𝑟 Calculation
• Transmit a data of known frequency
• Calculate the strip width
• Example : transmit 1 kHz cosine wave, 1 bright + 1 dark = 1ms = 1 strip
• 19 strips in image ( 1 black + 1 white ) occupying 888 pixels
• 𝑇𝑟 = 1𝑚𝑠
#𝑟𝑜𝑤𝑠 𝑝𝑒𝑟 𝑐𝑦𝑐𝑙𝑒 = 1𝑚𝑠
(888/19) = 21.4𝑢𝑠
1
Signal Loss handling – long symbol
Signal Time Rolling Shutter
𝑇𝑖𝑚𝑒 𝐺𝑎𝑝
• Symbol duration > Gap
• Each symbol will be captured
• e.g. 1/30 s
• Each symbol carry multiple bits
• Multiple frequencies in FSK
• Multiple amplitude in ASK
Signal Loss handling – long symbol
• Each symbol will last over 1 frames
• Large symbol – more complex decoding
• Reference
• RollingLight :
http://www.csie.ntu.edu.tw/~hsinmu/wiki/_media/pap er/mobisys15.pdf
Symbol splitter ( optional )
• A fixed small symbol << symbol duration
• between 2 symbols to split symbol ( in case 2 consecutive same symbols )
• Similar to preamble, maybe a unique intensity in ASK or frequency in FSK
Signal Loss handling – short symbol
Signal Time Rolling Shutter
𝑇𝑖𝑚𝑒 𝐺𝑎𝑝
• Symbol duration < Gap and frame
• Some symbol loss
• Need to calculate symbol loss rate
Signal Loss handling – small symbol
• Single frame contains multiple symbol
• Small symbol – heavy coding + parity to recover
• Coding rate > symbol loss rate
• https://en.wikipedia.org/wiki/Forward_error_correction
#List_of_error-correcting_codes
Sequence number ( optional )
• Detect loss symbol in time gap
• “number” each symbol
• E.g. 24 symbols into 3 groups { A,B,C }, 8 symbols in each group = 3 bit per symbol
• Transmit symbol in group order ( cyclic )
• data = [110] [001] [010] [111] [101] [000]
• Sym. = [A6] [B1] [C2] [A7] [B5] [C0]
• If group order skipped in decode -> symbol loss
• E.g. [A6] [B1] [A7] -> [C?]
Lab #1 : CamCom
• Tx
• USRP control LED
• Fixed Sampling rate : 200K
• 1 = bright, 0 = dark. Linear scale ( 0.5 = half intensity) Sample MATLAB file create bin file
• https://drive.google.com/file/d/0B_Z- TUMjZ2A8ZDNLM0FMQ0U1TUU/view
• Upload your bin file through
• scp teamN_v#.bin [email protected]:~/ook-vlc/
Lab #1 : CamCom
• Rx
• Raspberry camera
• Fixed 30fps 1920*1080 mp4
• Captured video in
• http://mvnl.csie.ntu.edu.tw/~wnfa/wn17fall/
• CLEAR in 10/1 (Sun.) 23:59
• test.mp4 – sample video for 1kHz cosine wave
• Download the video and decode
• Read video sample code in
• https://www.dropbox.com/s/5zx14ozqg408san/OOKRxDemo.m
?dl=0
Grading criteria
• Demo : Unawareness + workable – 20%
• Intensity stays constant over any 15ms ( 60Hz )
• Transmit 8bps ( in-class #2 )
• Demo : Baseline – 40%
• 128 bps
• Demo : Boost data rate – 30%
• 5% for each 2x. Maximum rate up to 128 × 26 = 8192 bps
Demo
• 10/26 (Thur.)
• 15 min per team
• Whole day available, book the time slot at
https://docs.google.com/spreadsheets/d/1Gt0kPk DGTFpR8MTsswOTMN4ZozkOdAH661KgcRgJIoc/edi t?usp=sharing
• Please feel free to email us if both of you are not available
Submit
• courses.dlc.ntu.edu.tw
• Lab > Lab1
• .zip containing encode.m/ decode.m/ report.pdf