# Question about the synchronization symbol used in ofdm example

**URL:** <https://www.ruby-forum.com/t/question-about-the-synchronization-symbol-used-in-ofdm-example/232887>\
**Category:** GNU Radio\
**Created:** [November 2, 2014, 4:46pm UTC](https://www.ruby-forum.com/t/question-about-the-synchronization-symbol-used-in-ofdm-example/232887 "2014-11-02T16:46:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [November 2, 2014, 4:46pm UTC](https://www.ruby-forum.com/t/question-about-the-synchronization-symbol-used-in-ofdm-example/232887/1 "2014-11-02T16:46:11Z")

</div>

Hello all:  
Thank you in advance.I have two questions about the symbol  
used in ofdm example.  
1.The first synchronization symbol is:  
n1=00000001.414213538169860-1.4142135381698601.414213538169860-1.414213538169860-1.414213538169860-1.4142135381698601.414213538169860-1.4142135381698601.414213538169860-1.414213538169860-1.414213538169860-1.414213538169860-1.4142135381698601.414213538169860-1.4142135381698601.4142135381698601.4142135381698601.414213538169860-1.4142135381698601.4142135381698601.4142135381698601.414213538169860-1.4142135381698601.4142135381698601.4142135381698601.41421353816986000000  
As the algorithm said,the first half of the symbol is same  
to the second half of the symbol.  
But i do ifft(n1) in matlab,and the result is  
0.0441941730678082 + 0.00000000000000i0.0644254533894132 +  
0.175326551876726i-0.0367461119467220 -  
0.0453679674017572i0.0265416620395810 +  
0.0320366536443552i-0.0985725617473446 -  
0.0915672254739864i-0.0570202679872770 +  
0.0717009594634221i0.00862185545503520 -  
0.0331748224844260i0.0431267759560735 -  
0.101430672698735i0.0937499983955371 +  
0.0624999989303581i-0.116910980048072 +  
0.0875939237146428i0.0433449944244991 +  
0.00659888247777708i0.0708002546250446 -  
0.00739045916472342i0.00700533627335824 -  
0.105577898020703i-0.0292347816053780 +  
0.0541379637893818i0.0245529670293908 -  
0.0678979614538899i-0.237561871221452 +  
0.0681675029413550i0.00000000000000 + 0.00000000000000i0.237561871221452

- 0.0681675029413550i-0.0245529670293908 -  
0.0678979614538899i0.0292347816053780 +  
0.0541379637893818i-0.00700533627335823 -  
0.105577898020703i-0.0708002546250446 -  
0.00739045916472342i-0.0433449944244991 +  
0.00659888247777708i0.116910980048072 +  
0.0875939237146428i-0.0937499983955371 +  
0.0624999989303581i-0.0431267759560735 -  
0.101430672698735i-0.00862185545503520 -  
0.0331748224844260i0.0570202679872771 +  
0.0717009594634221i0.0985725617473446 -  
0.0915672254739864i-0.0265416620395810 +  
0.0320366536443552i0.0367461119467220 -  
0.0453679674017572i-0.0644254533894132 +  
0.175326551876726i-0.0441941730678082 +  
0.00000000000000i-0.0644254533894132 -  
0.175326551876726i0.0367461119467220 +  
0.0453679674017572i-0.0265416620395810 -  
0.0320366536443552i0.0985725617473446 +  
0.0915672254739864i0.0570202679872770 -  
0.0717009594634221i-0.00862185545503520 +  
0.0331748224844260i-0.0431267759560735 +  
0.101430672698735i-0.0937499983955371 -  
0.0624999989303581i0.116910980048072 -  
0.0875939237146428i-0.0433449944244991 -  
0.00659888247777708i-0.0708002546250446 +  
0.00739045916472342i-0.00700533627335824 +  
0.105577898020703i0.0292347816053780 -  
0.0541379637893818i-0.0245529670293908 +  
0.0678979614538899i0.237561871221452 -  
0.0681675029413550i0.00000000000000 +  
0.00000000000000i-0.237561871221452 -  
0.0681675029413550i0.0245529670293908 +  
0.0678979614538899i-0.0292347816053780 -  
0.0541379637893818i0.00700533627335823 +  
0.105577898020703i0.0708002546250446 +  
0.00739045916472342i0.0433449944244991 -  
0.00659888247777708i-0.116910980048072 -  
0.0875939237146428i0.0937499983955371 -  
0.0624999989303581i0.0431267759560735 +  
0.101430672698735i0.00862185545503520 +  
0.0331748224844260i-0.0570202679872771 -  
0.0717009594634221i-0.0985725617473446 +  
0.0915672254739864i0.0265416620395810 -  
0.0320366536443552i-0.0367461119467220 +  
0.0453679674017572i0.0644254533894132 - 0.175326551876726i  
The first half of the symbol in time domain isn’t same to  
the second half of the symbol.It is a fault?  
2.I read the document fft\_vcc\_fftw.cc  
gr\_complex _dst = d\_fft-\>get\_inbuf();  
unsigned int len = (unsigned int)(floor(d\_fft\_size/2.0));  
// half length of complex array  
memcpy(&dst[0], &in[len], sizeof(gr\_complex)_(d\_fft\_size -  
len));  
memcpy(&dst[d\_fft\_size - len], &in[0],  
sizeof(gr\_complex)\*len);  
Before doing the ifft operation,should I first do this?  
Thank you very much.  
Best regards,  
kun

---

<div class="post-metadata">

**Author:** ![xianda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/b38774/32.png) [@xianda](https://www.ruby-forum.com/u/xianda)\
**Post date:** [November 2, 2014, 5:02pm UTC](https://www.ruby-forum.com/t/question-about-the-synchronization-symbol-used-in-ofdm-example/232887/2 "2014-11-02T17:02:54Z")

</div>

​Hello Kun,

Could you please verify whether the input to the FFT call are supposed  
to  
be shifted or not?

Best,  
Aditya​

---

<div class="post-metadata">

**Author:** ![xianda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/b38774/32.png) [@xianda](https://www.ruby-forum.com/u/xianda)\
**Post date:** [November 2, 2014, 5:16pm UTC](https://www.ruby-forum.com/t/question-about-the-synchronization-symbol-used-in-ofdm-example/232887/3 "2014-11-02T17:16:02Z")

</div>

Hello Aditya:  
I think it should be shifted.In the transmitter of  
the OFDM,the ifft operation is adopted.  
Another phenomenon I have found that the result of  
the input data go through the FFT block (gnuradio)isn’t same to the  
result in matlab(just ifft(data)).Can you explain it?

Best regards,  
Kun

At 2014-11-03 00:00:29, “Aditya D.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

Hello Kun,

Could you please verify whether the input to the FFT call are supposed  
to be shifted or not?

Best,  
Aditya

On Sun, Nov 2, 2014 at 10:44 AM, xianda [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

Hello all:  
Thank you in advance.I have two questions about the symbol  
used in ofdm example.  
1.The first synchronization symbol is:  
n1=00000001.414213538169860-1.4142135381698601.414213538169860-1.414213538169860-1.414213538169860-1.4142135381698601.414213538169860-1.4142135381698601.414213538169860-1.414213538169860-1.414213538169860-1.414213538169860-1.4142135381698601.414213538169860-1.4142135381698601.4142135381698601.4142135381698601.414213538169860-1.4142135381698601.4142135381698601.4142135381698601.414213538169860-1.4142135381698601.4142135381698601.4142135381698601.41421353816986000000  
As the algorithm said,the first half of the symbol is same  
to the second half of the symbol.  
But i do ifft(n1) in matlab,and the result is  
0.0441941730678082 + 0.00000000000000i0.0644254533894132 +  
0.175326551876726i-0.0367461119467220 -  
0.0453679674017572i0.0265416620395810 +  
0.0320366536443552i-0.0985725617473446 -  
0.0915672254739864i-0.0570202679872770 +  
0.0717009594634221i0.00862185545503520 -  
0.0331748224844260i0.0431267759560735 -  
0.101430672698735i0.0937499983955371 +  
0.0624999989303581i-0.116910980048072 +  
0.0875939237146428i0.0433449944244991 +  
0.00659888247777708i0.0708002546250446 -  
0.00739045916472342i0.00700533627335824 -  
0.105577898020703i-0.0292347816053780 +  
0.0541379637893818i0.0245529670293908 -  
0.0678979614538899i-0.237561871221452 +  
0.0681675029413550i0.00000000000000 + 0.00000000000000i0.237561871221452

- 0.0681675029413550i-0.0245529670293908 -  
0.0678979614538899i0.0292347816053780 +  
0.0541379637893818i-0.00700533627335823 -  
0.105577898020703i-0.0708002546250446 -  
0.00739045916472342i-0.0433449944244991 +  
0.00659888247777708i0.116910980048072 +  
0.0875939237146428i-0.0937499983955371 +  
0.0624999989303581i-0.0431267759560735 -  
0.101430672698735i-0.00862185545503520 -  
0.0331748224844260i0.0570202679872771 +  
0.0717009594634221i0.0985725617473446 -  
0.0915672254739864i-0.0265416620395810 +  
0.0320366536443552i0.0367461119467220 -  
0.0453679674017572i-0.0644254533894132 +  
0.175326551876726i-0.0441941730678082 +  
0.00000000000000i-0.0644254533894132 -  
0.175326551876726i0.0367461119467220 +  
0.0453679674017572i-0.0265416620395810 -  
0.0320366536443552i0.0985725617473446 +  
0.0915672254739864i0.0570202679872770 -  
0.0717009594634221i-0.00862185545503520 +  
0.0331748224844260i-0.0431267759560735 +  
0.101430672698735i-0.0937499983955371 -  
0.0624999989303581i0.116910980048072 -  
0.0875939237146428i-0.0433449944244991 -  
0.00659888247777708i-0.0708002546250446 +  
0.00739045916472342i-0.00700533627335824 +  
0.105577898020703i0.0292347816053780 -  
0.0541379637893818i-0.0245529670293908 +  
0.0678979614538899i0.237561871221452 -  
0.0681675029413550i0.00000000000000 +  
0.00000000000000i-0.237561871221452 -  
0.0681675029413550i0.0245529670293908 +  
0.0678979614538899i-0.0292347816053780 -  
0.0541379637893818i0.00700533627335823 +  
0.105577898020703i0.0708002546250446 +  
0.00739045916472342i0.0433449944244991 -  
0.00659888247777708i-0.116910980048072 -  
0.0875939237146428i0.0937499983955371 -  
0.0624999989303581i0.0431267759560735 +  
0.101430672698735i0.00862185545503520 +  
0.0331748224844260i-0.0570202679872771 -  
0.0717009594634221i-0.0985725617473446 +  
0.0915672254739864i0.0265416620395810 -  
0.0320366536443552i-0.0367461119467220 +  
0.0453679674017572i0.0644254533894132 - 0.175326551876726i  
The first half of the symbol in time domain isn’t same to  
the second half of the symbol.It is a fault?  
2.I read the document fft\_vcc\_fftw.cc  
gr\_complex _dst = d\_fft-\>get\_inbuf();  
unsigned int len = (unsigned int)(floor(d\_fft\_size/2.0));  
// half length of complex array  
memcpy(&dst[0], &in[len], sizeof(gr\_complex)_(d\_fft\_size -  
len));  
memcpy(&dst[d\_fft\_size - len], &in[0],  
sizeof(gr\_complex)\*len);  
Before doing the ifft operation,should I first do this?  
Thank you very much.  
Best regards,  
kun

---

<div class="post-metadata">

**Author:** ![xianda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/b38774/32.png) [@xianda](https://www.ruby-forum.com/u/xianda)\
**Post date:** [November 3, 2014, 8:15am UTC](https://www.ruby-forum.com/t/question-about-the-synchronization-symbol-used-in-ofdm-example/232887/4 "2014-11-03T08:15:54Z")

</div>

On 11/02/2014 04:44 PM, xianda wrote:

> Hello all:  
> Thank you in advance.I have two questions about the symbol  
> used in ofdm example.  
> 1.The first synchronization symbol is:
> 
> n1=00000001.414213538169860[…]

Waah lots of numbers.

If the first half wasn’t identical to the second half, this wouldn’t  
work. Also, it’s a mathemetical necessity given every 2nd sub-carrier is  
zero that the halfs be equal.

However, they don’t have t have the same _sign_. See this line in the  
OFDM sync block:

64 gr::filter::fir\_filter\_ccf::sptr delay\_ma(  
gr::filter::fir\_filter\_ccf::make(  
1, std::vector(  
fft\_len/2, use\_even\_carriers ? 1.0 : -1.0  
)  
)  
);

The reason is basic FFT math (hint: phase shift in one domain equals  
what in the other domain?).

Literally all you needed to do was plot the ifft() results and you would  
have seen this.

> ```
> Before doing the ifft operation,should I first do this?
> 
> ```

It is unclear what you mean by “this”. My guess is, the answer is no.

M
