# Detecting unipolar and repeating preamble on wired communications?

**URL:** <https://www.ruby-forum.com/t/detecting-unipolar-and-repeating-preamble-on-wired-communications/241837>\
**Category:** GNU Radio\
**Created:** [May 5, 2015, 8:32am UTC](https://www.ruby-forum.com/t/detecting-unipolar-and-repeating-preamble-on-wired-communications/241837 "2015-05-05T08:32:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [May 5, 2015, 8:32am UTC](https://www.ruby-forum.com/t/detecting-unipolar-and-repeating-preamble-on-wired-communications/241837/1 "2015-05-05T08:32:28Z")

</div>

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)  
(n is very small noise and fluctuation, n can be either negative or  
positive)

I think an optical fiber communication might use unipolar signalling,  
but  
I’m not sure.

Is there anyone already implemented unipolar preamble detection  
succesffully, or could anyone give me some hints on mathematical  
approach  
or something?

Regards,  
Jeon.

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [May 5, 2015, 9:28am UTC](https://www.ruby-forum.com/t/detecting-unipolar-and-repeating-preamble-on-wired-communications/241837/2 "2015-05-05T09:28:33Z")

</div>

Hi,

> (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)

There is no difference … “0 volt” is just an arbitrary reference  
point.

0 ↔ +A swing is the same as  
-A/2 ↔ A/2 swing if you shift your reference …

Ethernet and USB are _differential_ but that’s just to improve signal  
integrity / noise immunity and such. At the receiver end, the  
differential input buffer essentially compares both and see which one  
is higher. (a bit simplified, but that’s the gist of it).

> Is there anyone already implemented unipolar preamble detection  
> succesffully, or could anyone give me some hints on mathematical approach or  
> something?

If ‘A’ is known, just remove -A/2 from your input signal.  
If it is unknown,you can use a very long time constant low pass to  
find it. (assuming your signal doesn’t have long runs of 0 or 1).

Cheers,

Sylvain

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [May 8, 2015, 7:00am UTC](https://www.ruby-forum.com/t/detecting-unipolar-and-repeating-preamble-on-wired-communications/241837/3 "2015-05-08T07:00:52Z")

</div>

Dear, Sylvain M.,

Thanks.I got a hint from your answer.

What about using moving average instead LPF?  
I think moving average (MA) is much simpler than LPF if computational  
cost  
is considered.  
But, another issue is, precision on estimation A and A/2. In that case,  
LPF  
would be better.

Anyway, I will do applying either LPF and MA on my flow graph. Thanks.

Regards,  
Jeon.

2015-05-05 16:27 GMT+09:00 Sylvain M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
