Course Activity - 國立臺灣大學

21
Course Activity On-off keying

Transcript of Course Activity - 國立臺灣大學

Page 1: Course Activity - 國立臺灣大學

Course ActivityOn-off keying

Page 2: Course Activity - 國立臺灣大學

LED to camera communication

• CamCom

• Intuitive / Visible

• Clear and simple channel

• Easy encoding / low data rate

Page 3: Course Activity - 國立臺灣大學

Camera

• Raspberry pi

• Frame rate 30fps

• Shutter speed = 1us

• Resolution 1920*1080

Page 4: Course Activity - 國立臺灣大學

Camera – Rolling Shutter

Global Shutter Rolling Shutter

Pixels exposedSIMULTANEOUSLY

Pixels exposedROW BY ROW

Page 5: Course Activity - 國立臺灣大學

How rolling shutter works ? TimeSignalGlobal Shutter

1/30 s(1/fps)

Rolling Shutter

Tr (Read-out time)Varies with camera models

Time Gap

Page 6: Course Activity - 國立臺灣大學
Page 7: Course Activity - 國立臺灣大學

On-Off keying

• 1 = bright = on

• 0 = dark = off

• 1 second = 30 frames = 30 samples

• Symbol duration = 1/15 second

• Self designed preamble ( e.g. 1/5 second bright

Page 8: Course Activity - 國立臺灣大學

On-Off keying

Time

Intensity

1/15 s

Discard mixed frame, 1~2 frames = 1 bit, 3 frames = 2 bit

Page 9: Course Activity - 國立臺灣大學

On-Off keying

• Problem : #On != #off, intensity changes

• No synchronization between Tx / Rx• E.g. Rx = 28 fps, Tx = 30fps

• 30 consecutive ‘1’ s fail

Page 10: Course Activity - 國立臺灣大學

Manchester coding

• 1 = dark -> bright

• 0 = bright -> dark

• Intensity changes in EVERY symbol• Provide synchronization

• Symbol duration = 1/15 second

• Self designed preamble ( e.g. 1/5 second bright

Page 11: Course Activity - 國立臺灣大學

Manchester coding

Time

Intensity

1/15 s

Discard mixed frame, 1~2 frames = 1 bit, 3 frames = 2 bit

1 1 0 01

Page 12: Course Activity - 國立臺灣大學

Manchester decoding

Time

Intensity 1 1 0 01

D DB BD DB BB BD DD DB BB BD D

Time

Intensity 1 1 0 01

DD BB DD BB BB DD DD BB BB DD

Page 13: Course Activity - 國立臺灣大學

Course Activity

• In-class exercise • Deadline : Wednesday ( maybe extended )

• Inter/ inner group discussion ok !

• Inter group code exchange FORBIDDEN• DO NOT SHOW YOUR CODE TO OTHERS EXCEPT YOUR TEAMATE

Page 14: Course Activity - 國立臺灣大學

Activity #2 : CamCom Manchester

• 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/

• Password: wnfa2017

Page 15: Course Activity - 國立臺灣大學

Activity #2 : CamCom Manchester

• Rx• Raspberry camera

• Fixed 30fps 1920*1080 mp4

• Captured video in • http://mvnl.csie.ntu.edu.tw/~wnfa/wn17fall/

• 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

Page 16: Course Activity - 國立臺灣大學

Requirement

• Decode 1 byte ( 1 char ) from 1s video

Page 17: Course Activity - 國立臺灣大學

Submit

• courses.dlc.ntu.edu.tw• Exercise > OOK

• .zip containing encode.m/ decode.m/ report.pdf

Page 18: Course Activity - 國立臺灣大學

Activity #2 : Rolling Shutter Manchester

• Tx• USRP control LED

• Fixed Sampling rate : 200K

• 1 = bright, 0 = dark. Linear scale ( 0.5 = half intensity)

• Sample bin file created by MATLAB

• Sample MATLAB file create bin file

• Upload your bin file to

Page 19: Course Activity - 國立臺灣大學

Activity #2 : Rolling Shutter Manchester

• Rx• Raspberry camera

• Fixed 30fps 1920*1080 mp4

• Captured video in • http://mvnl.csie.ntu.edu.tw/~wnfa/wn17fall/

• 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

Page 20: Course Activity - 國立臺灣大學

Requirement

• Decode 1 byte ( 1 char ) from 1s video

Page 21: Course Activity - 國立臺灣大學

Submit

• courses.dlc.ntu.edu.tw• Exercise > Rolling OOK

• .zip containing encode.m/ decode.m/ report.pdf