# Question about ofdm\_sync\_long block of gr-ieee802-11 module

**URL:** <https://www.ruby-forum.com/t/question-about-ofdm-sync-long-block-of-gr-ieee802-11-module/241896>\
**Category:** GNU Radio\
**Created:** [May 9, 2015, 12:07pm UTC](https://www.ruby-forum.com/t/question-about-ofdm-sync-long-block-of-gr-ieee802-11-module/241896 "2015-05-09T12:07:34Z")\
**Posts on this page:** 6\
**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 9, 2015, 12:07pm UTC](https://www.ruby-forum.com/t/question-about-ofdm-sync-long-block-of-gr-ieee802-11-module/241896/1 "2015-05-09T12:07:34Z")

</div>

I am looking gr-ieee802-11 module.

a part of the source code is pasted here (  
[https://gist.github.com/gsongsong/3df4553fe96e2d62b83e](https://gist.github.com/gsongsong/3df4553fe96e2d62b83e))

I have a question on the following statement:

`if(rel >= 0 && (rel < 128 || ((rel - 128) % 80) > 15))` in `case COPY`  
`if(((d_count + o) % 64) == 0)` in `case RESET`

I am wonder what do these numbers(128, 80, 15, 64) and modulo operation  
have logical meaning in IEEE 802.11p PHY frame?

I’ve read 802.11 OFDM specification, thus I have knowledge about it,  
but I have no idea what are roles of these things in implementation.

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 9, 2015, 1:24pm UTC](https://www.ruby-forum.com/t/question-about-ofdm-sync-long-block-of-gr-ieee802-11-module/241896/2 "2015-05-09T13:24:40Z")

</div>

Hi Jeon,

in such a case, linking to the original file [1] including line number  
might be more helpful, as it gives more context.

So, looking at this, it’s taking the delayed input samples and copies  
them (offset-corrected) to the output, considering parts of the samples,  
x = ignore, o = copy, starting at the frame start:

oooooooo|xx?oooooo|xx?oooooo|…  
128 |16?128-16|16?128-16|…

I’m not too familiar with 802.11p frames, but that looks like Basti’s  
leaving out some pilots in between the data, probably only copying the  
preamble and data payload. But I could be wrong.

Greetings,  
Marcus

[1]  
[https://github.com/bastibl/gr-ieee802-11/blob/master/lib/ofdm\_sync\_long.cc#L128](https://github.com/bastibl/gr-ieee802-11/blob/master/lib/ofdm_sync_long.cc#L128)

---

<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 9, 2015, 2:44pm UTC](https://www.ruby-forum.com/t/question-about-ofdm-sync-long-block-of-gr-ieee802-11-module/241896/3 "2015-05-09T14:44:07Z")

</div>

Hi,

> On 09 May 2015, at 13:23, Marcus M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> So, looking at this, it’s taking the delayed input samples and copies them  
> (offset-corrected) to the output, considering parts of the samples,  
> x = ignore, o = copy, starting at the frame start:
> 
> oooooooo|xxoooooo|xxoooooo|…  
> 128 |16128-16|16128-16|

Exactly, its to remove the cyclic prefix (remove the first 16 samples of  
every 80 samples). Unfortunately, the first 128 samples (the long  
training sequence) dont fit into the same scheme. Therefore the special  
case here.

Best,  
Bastian

> > but I have no idea what are roles of these things in implementation.
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

–  
Dipl.-Inform. Bastian B.  
Distributed Embedded Systems Group  
University of Paderborn, Germany

> **[Home](https://www.bastibl.net/)**
>
> I'm Bastian Bloessl, a Research Group Leader at the Secure Mobile Networking Lab, TU Darmstadt. Checkout my blog, projects, publications, and resume; or connect on Github, Twitter, YouTube, or Facebook.

---

<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 10, 2015, 4:22am UTC](https://www.ruby-forum.com/t/question-about-ofdm-sync-long-block-of-gr-ieee802-11-module/241896/4 "2015-05-10T04:22:34Z")

</div>

Dear Bastian,

I missed one another thing.

`if(((d_count + o) % 64) == 0)` statement in  
[https://github.com/bastibl/gr-ieee802-11/blob/master/lib/ofdm\_sync\_long.cc#L141](https://github.com/bastibl/gr-ieee802-11/blob/master/lib/ofdm_sync_long.cc#L141)

Is this because of a length of an OFDM signal being a multiple of 64,  
which  
is the number of subcarriers? (Except cyclic prefix)

Regards,  
Jeon.

2015-05-09 22:32 GMT+09:00 Jeon [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<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 9, 2015, 3:33pm UTC](https://www.ruby-forum.com/t/question-about-ofdm-sync-long-block-of-gr-ieee802-11-module/241896/5 "2015-05-09T15:33:46Z")

</div>

Dear Marcus and Bastian,

Thank you for your detailed answers.

Also, thank you for useful usage of gist. 🙂

Regards,  
Jeon.

2015-05-09 21:42 GMT+09:00 Bastian B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<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 11, 2015, 6:31am UTC](https://www.ruby-forum.com/t/question-about-ofdm-sync-long-block-of-gr-ieee802-11-module/241896/6 "2015-05-11T06:31:13Z")

</div>

Hi,

> On 10 May 2015, at 04:21, Jeon [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
> I missed one another thing.
> 
> `if(((d_count + o) % 64) == 0)` statement in  
> [https://github.com/bastibl/gr-ieee802-11/blob/master/lib/ofdm\_sync\_long.cc#L141](https://github.com/bastibl/gr-ieee802-11/blob/master/lib/ofdm_sync_long.cc#L141)
> 
> Is this because of a length of an OFDM signal being a multiple of 64, which is  
> the number of subcarriers? (Except cyclic prefix)

Yes, the next step is the FFT that works on blocks of 64 samples. The  
line you quoted is executed when a new frame is about to start. It’s to  
ensure that the new frame starts at a multiple of 64 samples.

Best,  
Bastian
