Presentation is loading. Please wait.

Presentation is loading. Please wait.

Correlation (Packet detection)

Similar presentations


Presentation on theme: "Correlation (Packet detection)"— Presentation transcript:

1 Correlation (Packet detection)

2 Cross Correlation A simple, yet powerful technique for detecting known patterns A key physical layer technique for detecting packets Detecting cell tower ID based on known sequences Detecting gene sequences Other broad applications in - pattern recognition, single particle analysis, electron tomography, averaging, cryptanalysis, and neurophysiology preamble payload channel is idle

3 Cross Correlation Consider a sequence of complex numbers –
𝑍= 𝑠 1 𝑒 𝑖 𝜃 1 , 𝑠 2 𝑒 𝑖 𝜃 2 , 𝑠 3 𝑒 𝑖 𝜃 3 , 𝑠 4 𝑒 𝑖 𝜃 4 Consider its complex conjugate 𝑍 ∗ = 𝑠 1 𝑒 −𝑖 𝜃 1 , 𝑠 2 𝑒 −𝑖 𝜃 2 , 𝑠 3 𝑒 −𝑖 𝜃 3 , 𝑠 4 𝑒 −𝑖 𝜃 4 𝑍 ∗ 𝑍 𝑇 = = 𝑠 1 + 𝑠 2 + 𝑠 3 + 𝑠 4 𝑠 1 𝑒 𝑖 𝜃 1 𝑠 2 𝑒 𝑖 𝜃 2 𝑠 3 𝑒 𝑖 𝜃 3 𝑠 4 𝑒 𝑖 𝜃 4 𝑠 1 𝑒 −𝑖 𝜃 1 𝑠 2 𝑒 −𝑖 𝜃 2 𝑠 3 𝑒 −𝑖 𝜃 3 𝑠 4 𝑒 −𝑖 𝜃 4

4 Cross Correlation 𝑍 ∗ 𝑍 𝑇 = = 𝑠 1 + 𝑠 2 + 𝑠 3 + 𝑠 4 𝑍 ∗ 𝑁 𝑇 =
𝑠 1 𝑒 −𝑖 𝜃 1 𝑠 2 𝑒 −𝑖 𝜃 2 𝑠 3 𝑒 −𝑖 𝜃 3 𝑠 4 𝑒 −𝑖 𝜃 4 𝑠 1 𝑒 𝑖 𝜃 1 𝑠 2 𝑒 𝑖 𝜃 2 𝑠 3 𝑒 𝑖 𝜃 3 𝑠 4 𝑒 𝑖 𝜃 4 Phase match, the sum is high 𝑍 ∗ 𝑍 𝑇 = = 𝑠 1 + 𝑠 2 + 𝑠 3 + 𝑠 4 𝑍 ∗ 𝑁 𝑇 = = 𝑠 1 𝑛 1 𝑒 −𝑖( 𝜃 1 + 𝜙 1 ) + 𝑠 2 𝑛 2 𝑒 −𝑖( 𝜃 2 + 𝜙 2 ) + 𝑠 3 𝑛 3 𝑒 −𝑖( 𝜃 3 + 𝜙 3 ) + 𝑠 4 𝑛 4 𝑒 −𝑖( 𝜃 4 + 𝜙 4 ) 𝑠 1 𝑒 −𝑖 𝜃 1 𝑠 2 𝑒 −𝑖 𝜃 2 𝑠 3 𝑒 −𝑖 𝜃 3 𝑠 4 𝑒 −𝑖 𝜃 4 𝑛 1 𝑒 𝑖 𝜙 1 𝑛 2 𝑒 𝑖 𝜙 2 𝑛 3 𝑒 𝑖 𝜙 3 𝑛 4 𝑒 𝑖 𝜙 4 Phase mis-match, the sum is low magnitude

5 Cross Correlation The phase match results in strong detection of the known pattern even in presence of noise. For example The sequence Z is a subsequence of another large sequence Noise has been added to it Cross correlation helps detects this submerged sequence 𝑎 1 𝑒 𝑖 𝜓 1 , 𝑎 2 𝑒 𝑖 𝜓 2 , 𝑎 3 𝑒 𝑖 𝜓 3 , 𝑎 4 𝑒 𝑖 𝜓 4 , , 𝑠 1 𝑒 𝑖 𝜃 1 , 𝑠 2 𝑒 𝑖 𝜃 2 , 𝑠 3 𝑒 𝑖 𝜃 3 , 𝑠 4 𝑒 𝑖 𝜃 4 , 𝑎 5 𝑒 𝑖 𝜃 1 , 𝑎 6 𝑒 𝑖 𝜃 2 , 𝑎 7 𝑒 𝑖 𝜃 3 , 𝑎 8 𝑒 𝑖 𝜃 4 𝑎 1 𝑒 𝑖 𝜓 1 , 𝑎 2 𝑒 𝑖 𝜓 2 , 𝑎 3 𝑒 𝑖 𝜓 3 , 𝑎 4 𝑒 𝑖 𝜓 4 , 𝑠 1 𝑒 𝑖 𝜃 1 + 𝑛 1 , 𝑠 2 𝑒 𝑖 𝜃 2 + 𝑛 2 , 𝑠 3 𝑒 𝑖 𝜃 3 + 𝑛 3 , 𝑠 4 𝑒 𝑖 𝜃 4 + 𝑛 4 , 𝑎 5 𝑒 𝑖 𝜃 1 , 𝑎 6 𝑒 𝑖 𝜃 2 , 𝑎 7 𝑒 𝑖 𝜃 3 , 𝑎 8 𝑒 𝑖 𝜃 4

6 Detecting patterns Cross-correlation can be used to detect the submerged sequence Specifically, it answers following questions Does the known sequence (Z) exist in the input sequence Where in the input sequence does Z appear? 𝑎 1 𝑒 𝑖 𝜓 1 , 𝑎 2 𝑒 𝑖 𝜓 2 , 𝑎 3 𝑒 𝑖 𝜓 3 , 𝑎 4 𝑒 𝑖 𝜓 4 , 𝑠 1 𝑒 𝑖 𝜃 1 + 𝑛 1 , 𝑠 2 𝑒 𝑖 𝜃 2 + 𝑛 2 , 𝑠 3 𝑒 𝑖 𝜃 3 + 𝑛 3 , 𝑠 4 𝑒 𝑖 𝜃 4 + 𝑛 4 , 𝑎 5 𝑒 𝑖 𝜃 1 , 𝑎 6 𝑒 𝑖 𝜃 2 , 𝑎 7 𝑒 𝑖 𝜃 3 , 𝑎 8 𝑒 𝑖 𝜃 4

7 Methodology 𝑎 1 𝑒 𝑖 𝜓 1 , 𝑎 2 𝑒 𝑖 𝜓 2 , 𝑎 3 𝑒 𝑖 𝜓 3 , 𝑎 4 𝑒 𝑖 𝜓 4 , 𝑠 1 𝑒 𝑖 𝜃 1 + 𝑛 1 , 𝑠 2 𝑒 𝑖 𝜃 2 + 𝑛 2 , 𝑠 3 𝑒 𝑖 𝜃 3 + 𝑛 3 , 𝑠 4 𝑒 𝑖 𝜃 4 + 𝑛 4 , 𝑎 5 𝑒 𝑖 𝜃 1 , 𝑎 6 𝑒 𝑖 𝜃 2 , 𝑎 7 𝑒 𝑖 𝜃 3 , 𝑎 8 𝑒 𝑖 𝜃 4 Input sequence 𝑍= 𝑠 1 𝑒 −𝑖 𝜃 1 𝑠 2 𝑒 −𝑖 𝜃 2 𝑠 3 𝑒 −𝑖 𝜃 3 𝑠 4 𝑒 −𝑖 𝜃 4 Template sequence

8 Methodology 𝑎 1 𝑒 𝑖 𝜓 1 , 𝑎 2 𝑒 𝑖 𝜓 2 , 𝑎 3 𝑒 𝑖 𝜓 3 , 𝑎 4 𝑒 𝑖 𝜓 4 , 𝑠 1 𝑒 𝑖 𝜃 1 + 𝑛 1 , 𝑠 2 𝑒 𝑖 𝜃 2 + 𝑛 2 , 𝑠 3 𝑒 𝑖 𝜃 3 + 𝑛 3 , 𝑠 4 𝑒 𝑖 𝜃 4 + 𝑛 4 , 𝑎 5 𝑒 𝑖 𝜃 1 , 𝑎 6 𝑒 𝑖 𝜃 2 , 𝑎 7 𝑒 𝑖 𝜃 3 , 𝑎 8 𝑒 𝑖 𝜃 4 𝑠 1 𝑒 −𝑖 𝜃 1 𝑠 2 𝑒 −𝑖 𝜃 2 𝑠 3 𝑒 −𝑖 𝜃 3 𝑠 4 𝑒 −𝑖 𝜃 4

9 Methodology 𝑎 1 𝑒 𝑖 𝜓 1 , 𝑎 2 𝑒 𝑖 𝜓 2 , 𝑎 3 𝑒 𝑖 𝜓 3 , 𝑎 4 𝑒 𝑖 𝜓 4 , 𝑠 1 𝑒 𝑖 𝜃 1 + 𝑛 1 , 𝑠 2 𝑒 𝑖 𝜃 2 + 𝑛 2 , 𝑠 3 𝑒 𝑖 𝜃 3 + 𝑛 3 , 𝑠 4 𝑒 𝑖 𝜃 4 + 𝑛 4 , 𝑎 5 𝑒 𝑖 𝜃 1 , 𝑎 6 𝑒 𝑖 𝜃 2 , 𝑎 7 𝑒 𝑖 𝜃 3 , 𝑎 8 𝑒 𝑖 𝜃 4 𝑠 1 𝑒 −𝑖 𝜃 1 𝑠 2 𝑒 −𝑖 𝜃 2 𝑠 3 𝑒 −𝑖 𝜃 3 𝑠 4 𝑒 −𝑖 𝜃 4

10 Methodology 𝑎 1 𝑒 𝑖 𝜓 1 , 𝑎 2 𝑒 𝑖 𝜓 2 , 𝑎 3 𝑒 𝑖 𝜓 3 , 𝑎 4 𝑒 𝑖 𝜓 4 , 𝑠 1 𝑒 𝑖 𝜃 1 + 𝑛 1 , 𝑠 2 𝑒 𝑖 𝜃 2 + 𝑛 2 , 𝑠 3 𝑒 𝑖 𝜃 3 + 𝑛 3 , 𝑠 4 𝑒 𝑖 𝜃 4 + 𝑛 4 , 𝑎 5 𝑒 𝑖 𝜃 1 , 𝑎 6 𝑒 𝑖 𝜃 2 , 𝑎 7 𝑒 𝑖 𝜃 3 , 𝑎 8 𝑒 𝑖 𝜃 4 𝑠 1 𝑒 −𝑖 𝜃 1 𝑠 2 𝑒 −𝑖 𝜃 2 𝑠 3 𝑒 −𝑖 𝜃 𝑠 4 𝑒 −𝑖 𝜃 4

11 Methodology 𝑎 1 𝑒 𝑖 𝜓 1 , 𝑎 2 𝑒 𝑖 𝜓 2 , 𝑎 3 𝑒 𝑖 𝜓 3 , 𝑎 4 𝑒 𝑖 𝜓 4 , 𝑠 1 𝑒 𝑖 𝜃 1 + 𝑛 1 , 𝑠 2 𝑒 𝑖 𝜃 2 + 𝑛 2 , 𝑠 3 𝑒 𝑖 𝜃 3 + 𝑛 3 , 𝑠 4 𝑒 𝑖 𝜃 4 + 𝑛 4 , 𝑎 5 𝑒 𝑖 𝜃 1 , 𝑎 6 𝑒 𝑖 𝜃 2 , 𝑎 7 𝑒 𝑖 𝜃 3 , 𝑎 8 𝑒 𝑖 𝜃 4 𝑠 1 𝑒 −𝑖 𝜃 1 𝑠 2 𝑒 −𝑖 𝜃 𝑠 3 𝑒 −𝑖 𝜃 𝑠 4 𝑒 −𝑖 𝜃 4

12 Methodology 𝑎 1 𝑒 𝑖 𝜓 1 , 𝑎 2 𝑒 𝑖 𝜓 2 , 𝑎 3 𝑒 𝑖 𝜓 3 , 𝑎 4 𝑒 𝑖 𝜓 4 , 𝑠 1 𝑒 𝑖 𝜃 1 + 𝑛 1 , 𝑠 2 𝑒 𝑖 𝜃 2 + 𝑛 2 , 𝑠 3 𝑒 𝑖 𝜃 3 + 𝑛 3 , 𝑠 4 𝑒 𝑖 𝜃 4 + 𝑛 4 , 𝑎 5 𝑒 𝑖 𝜃 1 , 𝑎 6 𝑒 𝑖 𝜃 2 , 𝑎 7 𝑒 𝑖 𝜃 3 , 𝑎 8 𝑒 𝑖 𝜃 4 𝑠 1 𝑒 −𝑖 𝜃 𝑠 2 𝑒 −𝑖 𝜃 𝑠 3 𝑒 −𝑖 𝜃 𝑠 4 𝑒 −𝑖 𝜃 4 board

13 Methodology 𝑎 1 𝑒 𝑖 𝜓 1 , 𝑎 2 𝑒 𝑖 𝜓 2 , 𝑎 3 𝑒 𝑖 𝜓 3 , 𝑎 4 𝑒 𝑖 𝜓 4 , 𝑠 1 𝑒 𝑖 𝜃 1 + 𝑛 1 , 𝑠 2 𝑒 𝑖 𝜃 2 + 𝑛 2 , 𝑠 3 𝑒 𝑖 𝜃 3 + 𝑛 3 , 𝑠 4 𝑒 𝑖 𝜃 4 + 𝑛 4 , 𝑎 5 𝑒 𝑖 𝜃 1 , 𝑎 6 𝑒 𝑖 𝜃 2 , 𝑎 7 𝑒 𝑖 𝜃 3 , 𝑎 8 𝑒 𝑖 𝜃 4 𝑠 1 𝑒 −𝑖 𝜃 𝑠 2 𝑒 −𝑖 𝜃 𝑠 3 𝑒 −𝑖 𝜃 𝑠 4 𝑒 −𝑖 𝜃 4

14 Methodology 𝑎 1 𝑒 𝑖 𝜓 1 , 𝑎 2 𝑒 𝑖 𝜓 2 , 𝑎 3 𝑒 𝑖 𝜓 3 , 𝑎 4 𝑒 𝑖 𝜓 4 , 𝑠 1 𝑒 𝑖 𝜃 1 + 𝑛 1 , 𝑠 2 𝑒 𝑖 𝜃 2 + 𝑛 2 , 𝑠 3 𝑒 𝑖 𝜃 3 + 𝑛 3 , 𝑠 4 𝑒 𝑖 𝜃 4 + 𝑛 4 , 𝑎 5 𝑒 𝑖 𝜃 1 , 𝑎 6 𝑒 𝑖 𝜃 2 , 𝑎 7 𝑒 𝑖 𝜃 3 , 𝑎 8 𝑒 𝑖 𝜃 4 𝑠 1 𝑒 −𝑖 𝜃 1 .𝑠 2 𝑒 −𝑖 𝜃 𝑠 3 𝑒 −𝑖 𝜃 𝑠 4 𝑒 −𝑖 𝜃 4

15 A matlab example Pattern Noise

16 Pattern embedded in noise – visually not detectable

17 Correlation can detect the hidden pattern

18 Correlation output when the pattern is absent

19 Dealing with multipath
Received signal is a convolution of transmitted signal and the wireless channel Consider a preamble transmission 𝑋 𝑝 𝑌 𝑝 = 𝑋 𝑝 ∗𝐻 Correlation between 𝑋 𝑝 and 𝑌 𝑝 would be small because 𝑌 𝑝 is polluted by wireless multipath (𝐻) Auto-correlation is used to deal with multipath effects

20 Autocorrelation 𝑋 𝑝 𝑋 𝑝 Transmit repeated copies of the preamble 𝑋 𝑝
𝑌 𝑝 = 𝑋 𝑝 ∗𝐻 𝑌 𝑝 Distorted but repeated copies the preamble are received

21 Autocorrelation 𝑌 𝑝 𝑌 𝑝 Cross correlate the two copies to detect the preamble Strong cross correlation indicates the presence of a preamble Such repeated sequence does not appear elsewhere in the packet, so no false positives


Download ppt "Correlation (Packet detection)"

Similar presentations


Ads by Google