# OFDM example from gr-digital with UHD

**URL:** <https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464>\
**Category:** GNU Radio\
**Created:** [June 25, 2015, 2:23pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464 "2015-06-25T14:23:33Z")\
**Posts on this page:** 14\
**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:** [June 25, 2015, 2:23pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/1 "2015-06-25T14:23:33Z")

</div>

Hello, I was interested to test tx\_ofdm.grc and rx\_ofdm.grc from  
gr-digital, at the same time using USRP N200 devices.

TX OFDM:

The changes that I did were, removing throttle block and adding an UHD  
Sink instead, with center frequency 430 MHz, which is the frequency band  
for which my department has license to transmit.

RX OFDM:

In this case I removed all blocks before throttle (included), and placed  
there an UHD Source at the same center frequency.

Flow graphs attached in the files.

I monitored the output signal and the received signal. I also used a  
spectrum analyzer to check the actual signal that is being transmitted.  
Pics are attached.

In the tx signal measured by a spectrum analyzer, we can see that the  
spectrum is not that we desire. I would like to ask if I am doing  
something wrong with the configuration. Before transmission there was no  
signal at that frequency and tx and rx antennas are suitable for the  
carrier frequency.

In addition I tried to transmit a file instead of just random bits. In  
reception I was not receiving the file. The config was just adding a  
file sink at the end of the rx block and a file source at the beginning  
of the tx block. Could you please help me with some tip?

---

<div class="post-metadata">

**Author:** ![gabri187](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gabri187](https://www.ruby-forum.com/u/gabri187)\
**Post date:** [June 25, 2015, 3:08pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/2 "2015-06-25T15:08:56Z")

</div>

Hi Gabriele,

have you tried adding more gain on the TX side?  
Also, you will need to increase sampling rate. Right now, you’re using  
100kHz, which is 1/1000 of the master clock rate of the N200. If I’m not  
mistaken, the maximum decimation for the N200 is 512, and hence the  
minimum rate would be 100MHz/512 = 195.3125kHz. You probably just want  
to use 200kHz or something similarly practical.

I hope that helps!

Best regards,  
Marcus

---

<div class="post-metadata">

**Author:** ![gabri187](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gabri187](https://www.ruby-forum.com/u/gabri187)\
**Post date:** [June 25, 2015, 6:26pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/3 "2015-06-25T18:26:23Z")

</div>

On 25.06.2015 06:07, Marcus M. wrote:

> Hi Gabriele,
> 
> have you tried adding more gain on the TX side?

…or less gain?

> Also, you will need to increase sampling rate. Right now, you’re using  
> 100kHz, which is 1/1000 of the master clock rate of the N200. If I’m not  
> mistaken, the maximum decimation for the N200 is 512, and hence the  
> minimum rate would be 100MHz/512 = 195.3125kHz. You probably just want  
> to use 200kHz or something similarly practical.

Or even more, like 1-2 Msps.

I haven’t tried a combo of N-Series specifically with this example, but  
I’ve tried X-Series + B-Series, so I’m confident it’s all OK. However,  
OFDM is sensitive to distortions, so you need to play around with the  
amplitude multiplier before tx’ing as well as the gain for your specific  
setup to get a good transmit spectrum.

Since you have a spectrum analyzer, that’s pretty useful for getting  
those settings right.

You might also try playing with the rolloff length and/or adding more  
empty carriers left and right of your tx spectrum while experimenting  
with settings.

Cheers,  
Martin

---

<div class="post-metadata">

**Author:** ![gabri187](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gabri187](https://www.ruby-forum.com/u/gabri187)\
**Post date:** [June 26, 2015, 12:54pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/4 "2015-06-26T12:54:41Z")

</div>

Thanks Marcus and Martin. I finally increased the sample rate up to 1  
Msps and decreased the amplitude multiplier. Now I can see a clear ofdm  
spectrum with no distortion at all.

Did some of you tried file transmission from one end to the other? I did  
it for GMSK before. Now when it comes ofdm and I open the receiving file  
while transmitting there is no printed information in the received file.

In that configuration I replaced the random source by a file source and  
a file sink after constellation decoder.

Again thanks for your help. It was so useful

---

<div class="post-metadata">

**Author:** ![gabri187](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gabri187](https://www.ruby-forum.com/u/gabri187)\
**Post date:** [June 29, 2015, 9:46pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/5 "2015-06-29T21:46:43Z")

</div>

Hi,

Gabriele, do you have news about this? I am trying to do the same.

And I have another question (if Marcus can help) … what is the  
modulation  
in this example (QPSK, QAM)?

Sorry for my bad english

Thanks

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/OFDM-example-from-gr-digital-with-UHD-tp54446p54503.html](http://gnuradio.4.n7.nabble.com/OFDM-example-from-gr-digital-with-UHD-tp54446p54503.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![gabri187](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gabri187](https://www.ruby-forum.com/u/gabri187)\
**Post date:** [June 29, 2015, 10:12pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/6 "2015-06-29T22:12:25Z")

</div>

Hi Jose,

> And I have another question (if Marcus can help) … what is the modulation  
> in this example (QPSK, QAM)?  
> You can set that yourself in the OFDM Transmitter Block, separately for  
> header and payload.

> Sorry for my bad english  
> Your English is really fine, don’t worry. If we don’t understand  
> something, we will just ask 🙂

Best regards,  
Marcus

---

<div class="post-metadata">

**Author:** ![gabri187](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gabri187](https://www.ruby-forum.com/u/gabri187)\
**Post date:** [June 26, 2015, 1:28pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/7 "2015-06-26T13:28:27Z")

</div>

Hi Gabriele,  
if there is no output, chances are the receiver side packet detector  
doesn’t see any valid packets.  
Make sure tx and rx parameters match, and adjust the RX gain. Make sure  
no under/overflows happen. There’s quite a lot of things that can go  
wrong in a real-world transceiver, but these are the most likely to  
happen in my experience.

Greetings,  
Marcus

---

<div class="post-metadata">

**Author:** ![gabri187](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gabri187](https://www.ruby-forum.com/u/gabri187)\
**Post date:** [June 30, 2015, 8:06pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/8 "2015-06-30T20:06:54Z")

</div>

Hi Marcus,

Thanks so much for the answer. But like in the screenshots of Gabriele,  
the  
blocks OFDM Transmitter e OFDM Receiver are off. And I can’t visualize  
four  
symbols (QPSK) or 2 symbols (BPSK) in the output of QT Constellation  
just a  
big one (see the screenshot), is this correct?

Thanks again.

[http://gnuradio.4.n7.nabble.com/file/n54530/ofdm\_tx-\_constellation.ofdm\_tx-\_constellation](http://gnuradio.4.n7.nabble.com/file/n54530/ofdm_tx-_constellation.ofdm_tx-_constellation)

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/OFDM-example-from-gr-digital-with-UHD-tp54446p54530.html](http://gnuradio.4.n7.nabble.com/OFDM-example-from-gr-digital-with-UHD-tp54446p54530.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![gabri187](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gabri187](https://www.ruby-forum.com/u/gabri187)\
**Post date:** [June 30, 2015, 8:31pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/9 "2015-06-30T20:31:27Z")

</div>

I am plotting the signal after the Multiply Const Block … the signal  
that I  
will transmitt with USRP.  
Isn’t correct?

[http://gnuradio.4.n7.nabble.com/file/n54534/ofdm\_tx.png](http://gnuradio.4.n7.nabble.com/file/n54534/ofdm_tx.png)

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/OFDM-example-from-gr-digital-with-UHD-tp54446p54534.html](http://gnuradio.4.n7.nabble.com/OFDM-example-from-gr-digital-with-UHD-tp54446p54534.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![gabri187](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gabri187](https://www.ruby-forum.com/u/gabri187)\
**Post date:** [June 30, 2015, 8:15pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/10 "2015-06-30T20:15:40Z")

</div>

On 30.06.2015 10:41, Jose Perez wrote:

> Hi Marcus,
> 
> Thanks so much for the answer. But like in the screenshots of Gabriele, the  
> blocks OFDM Transmitter e OFDM Receiver are off. And I can’t visualize four  
> symbols (QPSK) or 2 symbols (BPSK) in the output of QT Constellation just a  
> big one (see the screenshot), is this correct?

Are you plotting the output of the IFFT by any chance?

M

---

<div class="post-metadata">

**Author:** ![gabri187](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gabri187](https://www.ruby-forum.com/u/gabri187)\
**Post date:** [June 30, 2015, 9:07pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/11 "2015-06-30T21:07:05Z")

</div>

On 30.06.2015 11:06, Jose Perez wrote:

> I am plotting the signal after the Multiply Const Block … the signal that I  
> will transmitt with USRP.  
> Isn’t correct?

If what you want to plot is your constellation, then no, it’s not. This  
is all modulated, pulse shaped and all.

Cheers,  
M

---

<div class="post-metadata">

**Author:** ![gabri187](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gabri187](https://www.ruby-forum.com/u/gabri187)\
**Post date:** [June 30, 2015, 9:37pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/12 "2015-06-30T21:37:28Z")

</div>

So … Is it possible to see the Constellation points like QPSK in this  
flowgraph?  
Sorry for so many questions!

Thanks Martin!

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/OFDM-example-from-gr-digital-with-UHD-tp54446p54537.html](http://gnuradio.4.n7.nabble.com/OFDM-example-from-gr-digital-with-UHD-tp54446p54537.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![gabri187](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gabri187](https://www.ruby-forum.com/u/gabri187)\
**Post date:** [July 1, 2015, 12:01am UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/13 "2015-07-01T00:01:12Z")

</div>

On 30.06.2015 12:12, Jose Perez wrote:

> So … Is it possible to see the Constellation points like QPSK in this  
> flowgraph?  
> Sorry for so many questions!

On TX, you can plot the complex symbols before they go into the carrier  
allocator. On the receive side, you can do the same after the carrier  
serializer. This won’t exactly plot 1 OFDM symbol at a time, if that is  
what you want.

Also, in both cases, the output will be pretty boring. On TX, it’s just  
your constellation; on RX, it’s already equalized, so it’s also just the  
constellation.

M

---

<div class="post-metadata">

**Author:** ![gabri187](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gabri187](https://www.ruby-forum.com/u/gabri187)\
**Post date:** [June 30, 2015, 10:51pm UTC](https://www.ruby-forum.com/t/ofdm-example-from-gr-digital-with-uhd/242464/14 "2015-06-30T22:51:05Z")

</div>

Jose,

we’re talking about this flow graph, right?  
[http://gnuradio.4.n7.nabble.com/file/n54534/ofdm\_tx.png](http://gnuradio.4.n7.nabble.com/file/n54534/ofdm_tx.png)

In this flow graph, you’re trying to find the individual symbols in time  
domain; that’s not possible, they only exist clearly distinguishable in  
frequency. That is why there is an DFT (in this implementation, the FFT)  
in OFDM!

Best regards,  
Marcus
