I am trying to implement a preamble detection.
A couple of things that,
I'm not using wireless communication but wired communication.
And also, I'm not using a bipolar signal, but a unipolar signal.
(Bipolar: a signal swings between +A volts (or amperes) and -A volts; Ethernet, USB, Wi-Fi, ... are using bipolar signals,
Unipolar: a signal swings between +A volts and 0 volts)
Using a unipolar signal, I am having a difficulties on determining whether a signal has a repetition.
A preamble has a typical form of 1, 0, 1, 0, 1, 0, 1, 0, (and data payload follows)
and it is mapped into a real signal and received at a receiver: +A+n, n, +A+n, n, +A+n, n, +A+n, n, (and data payload follows)