# Ofdm plateau\_detector\_fb\_impl//ofdm\_sync\_sc\_cfb\_impl

**URL:** <https://www.ruby-forum.com/t/ofdm-plateau-detector-fb-impl-ofdm-sync-sc-cfb-impl/243192>\
**Category:** GNU Radio\
**Created:** [August 31, 2015, 4:47pm UTC](https://www.ruby-forum.com/t/ofdm-plateau-detector-fb-impl-ofdm-sync-sc-cfb-impl/243192 "2015-08-31T16:47:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [August 31, 2015, 4:47pm UTC](https://www.ruby-forum.com/t/ofdm-plateau-detector-fb-impl-ofdm-sync-sc-cfb-impl/243192/1 "2015-08-31T16:47:22Z")

</div>

Hi all,  
I have a question on the synchronization of ofdm  
example,namely the sch&cox source code.

```
       The plateau_detector_fb_impl.cc can find the plateau,and then 

```

header\_payload\_demux\_impl can find the head data.  
STEP 1: plateau\_detector\_fb\_impl find the plateau.  
flank\_start = i;  
while(i \< noutput\_items && in[i] \>= d\_threshold)  
i++;  
if((i - flank\_start) \> 1) { // 1 Sample is not a plateau  
out[flank\_start + (i-flank\_start)/2] = 1;  
i = std::min(i+d\_max\_len, noutput\_items-1);  
}  
STEP 2:header\_payload\_demux\_impl can find the head data  
case STATE\_HEADER:  
if (check\_items\_available(d\_header\_len, ninput\_items,  
noutput\_items, nread)) {  
copy\_n\_symbols(in, out\_header, PORT\_HEADER,  
d\_header\_len);  
STEP 3:  
memcpy((void \*) out, (void \*) (in + d\_gi \* d\_itemsize),  
d\_items\_per\_symbol \* d\_itemsize);

```
        I think may be the code have some errors.For example,the 

```

data is cdef+abcdef,the cyclic prefix is cdef,and the data is abcdef.  
According step1,the output will ouput 0010000000.Because the sch&cox  
will output a plateau in the cyclic prefix,namely the index  
corresponding to the cdefa will be the plateau.The source code output 1  
in the middle.Namely the index corresponding to the middle “e” output 1.  
According to the step 2 and step3, we copy the  
d\_items\_per\_symbol \* d\_itemsize bytes after (in + d\_gi \* d\_itemsize) to  
the output.In the example, cdef+abcdef,the d\_gi is 4. (in + d\_gi \*  
d\_itemsize) will correspond to the c.Then output d\_items\_per\_symbol is  
6,then output cdef…But the true head data is abcdef,so I think maybe  
the source code have some problems.Is my understanding right?  
Thank you.  
Best regards,  
zswx

---

<div class="post-metadata">

**Author:** ![zszszs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/5fc32e/32.png) [@zszszs](https://www.ruby-forum.com/u/zszszs)\
**Post date:** [August 31, 2015, 11:08pm UTC](https://www.ruby-forum.com/t/ofdm-plateau-detector-fb-impl-ofdm-sync-sc-cfb-impl/243192/2 "2015-08-31T23:08:51Z")

</div>

On 31.08.2015 07:15, zs wrote:

> ```
> According to the step 2 and step3, we copy the
> 
> ```
> 
> d\_items\_per\_symbol \* d\_itemsize bytes after (in + d\_gi \* d\_itemsize) to  
> the output.In the example, cdef+abcdef,the d\_gi is 4. (in + d\_gi \*  
> d\_itemsize) will correspond to the c.Then output d\_items\_per\_symbol is  
> 6,then output cdef..But the true head data is abcdef,so I think maybe  
> the source code have some problems.Is my understanding right?

Not sure I’m understanding you correctly, but maybe these factoids help  
you:

- If you check out ofdm\_rx.grc, you’ll see a couple of delays that try  
and align things.
- The qa\_ofdm\_\*.py files check the OFDM stuff pretty exhaustively, and  
you might be interested in qa\_ofdm\_sync\_sc\_cfb.py in particular.
- If we start copying at the first ‘e’ in your example, the receiver  
will still work fine (minus a phase offset).

Cheers,  
Martin
