# Arduino processing 13 bit barker code experiment

**URL:** <https://discourse.processing.org/t/arduino-processing-13-bit-barker-code-experiment/46027>\
**Category:** Gallery\
**Created:** [March 18, 2025, 8:57pm UTC](https://discourse.processing.org/t/arduino-processing-13-bit-barker-code-experiment/46027 "2025-03-18T20:57:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [March 18, 2025, 8:57pm UTC](https://discourse.processing.org/t/arduino-processing-13-bit-barker-code-experiment/46027/1 "2025-03-18T20:57:53Z")

</div>

playing with barker code

generating 4 khz 13 bit barker code using Arduino and ad9833 function generator to modulated the barker code with 8 khz sine wave carrier and processing sketch analysis the results

 ![Screenshot_2025-03-18-23-48-49-316](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/7/2/72763224f44570770a519a9300819a4f9b68bdb4.jpeg)

---

<div class="post-metadata">

**Author:** ![seanc4s](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@seanc4s](https://discourse.processing.org/u/seanc4s)\
**Post date:** [March 20, 2025, 1:24am UTC](https://discourse.processing.org/t/arduino-processing-13-bit-barker-code-experiment/46027/2 "2025-03-20T01:24:31Z")

</div>

I sense similarities with the fast Walsh Hadamard transform which also uses patterns of +1,-1 parameters. I will take a look at the dot product geometric meaning of Barker codes.  
[https://en.wikipedia.org/wiki/Barker\_code](https://en.wikipedia.org/wiki/Barker_code)  
[https://sites.google.com/view/algorithmshortcuts/2-point-wht](https://sites.google.com/view/algorithmshortcuts/2-point-wht)

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [March 20, 2025, 1:56am UTC](https://discourse.processing.org/t/arduino-processing-13-bit-barker-code-experiment/46027/3 "2025-03-20T01:56:28Z")

</div>

> [@seanc4s](#):
>
> I sense similarities with the fast Walsh

part of my code

```auto

int[] barkerCode = {1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1};
,
,
,
,
// Function to compute the autocorrelation of a signal
float[] computeAutocorrelation(float[] signal) {
  int n = signal.length;
  float[] autocorr = new float[n];

  for (int lag = 0; lag < n; lag++) {
    float sum = 0;
    for (int i = 0; i < n - lag; i++) {
      sum += signal[i] * signal[i + lag];
    }

```

barker code explain

[![](https://img.youtube.com/vi/qek4-ET1d9Q/maxresdefault.jpg "ECE3084 Lecture 12.5: Autocorrelation, Pulse Compression, and Barker Codes (Signals & Systems)") ](https://www.youtube.com/watch?v=qek4-ET1d9Q)
