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.
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.