Reputation: 1
I am trying to simulate an 802.11 OFDM signal at 20/40/80 and 160 MHz bandwidths using GNURadio, starting with the ofdm_tx.grc example.
Using this example I can easily generate a 20 MHz signal simply by increasing the sample_rate to 20M. However I need help generating the higher bandwidth modes.
It is my understanding that the bandwidth is determined by the number of sub-carriers in the signal as well as the sample rate. Further research told me that for an 802.11n 40 MHz simulated channel I should use:
Along with changing these variables I modified the occupied_carriers, pilot_carriers and pilot symbols to be the following:
occupied_carriers = (range(-57,-51) + range(-50,-21) + range(-20,-7) + range(-6,0)+range(1,7)+range(8,21) + range(22,50) + range(52,57),)
pilot_carriers = ((-51,-21,-7,7,21,51),)
pilot_symbols = ((1, 1, 1, -1,1,1),)
I also removed the sync_words from the ofdm_carrier_allocator block.
After these changes I get an output that is 40 MHz wide but it is more of an 802.11b shape (more gaussian than square) as seen in this image.
Clearly I am missing something important but I have not been able to figure out what.
To clarify, I do not care about the data being sent, I just want to produce a signal of the correct shape and bandwidth. Also, to output the signal I am first using the example code to write data to a file, then writing that file directly to a USRP x300(UBX-160) using gnuradio.
Any help or clarification on the OFDM modulation process will be greatly appreciated. Thanks.
Upvotes: 0
Views: 1486
Reputation: 1
I knew I was missing something simple.
After a quick discussion on the usrp-users mail list I got the answer from Marcus D. Leech, I need to up-sample the data digitally before sending it to the usrp.
http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2018-May/056519.html
By adding a rational resampler into the flowgraph before writing the data to a file I pushed up the sample rate from 40 to 100 MS/s. The X300 was then able to produce a beautiful 40 MHz signal.
Upvotes: 0
Reputation: 36442
You're on the right path - the occupied bandwidth of an OFDM system is simply the full bandwidth as defined by the sampling rate.
So, 40 MS/s will give a bandwidth of 40 MHz.
For the correct spectral shape, i.e. correct subcarrier spacing and sidelobe behaviour, you'll also have to double the number of subcarriers (which in OFDM is simply the length of the (I)DFT/(I)FFT) and modify the channel mask, so that the center carrier and most importantly the correct number of edge carriers are still unused.
That of course implies that you'll also need larger number of data symbols per OFDM symbol.
Now, you're clearly not seeing what you want to see - and it even looks very much like an analog thing happening there. To rule that out, I'd recommend just taking the samples that you'd send to your USRP and saving them to a file and analyzing them. If their digital spectrum is correct, you've got a hardware or measurement problem. My first guess here would be underruns, i.e. instances where your PC is too slow at sending data to the USRP, and that leading to discontinuity.
Upvotes: 0