# Simulating noise in OFDM

I'd like to simulate a certain $E_s/N_0$ in a baseband OFDM MATLAB modem to generate SER curves.

I randomize 50 QAM symbols with $N$ subcarriers each in frequency domain, add null frequencies (guard bands) to each symbol, perform IFFT and then add CP. Then I convolve the "time domain" symbols with a certain channel with taps of my choice and then I want to add noise, but I'm not sure about how to normalize it so that I obtain the correct SNR as generally reported in theoretical curves.

I get funky results with just MATLAB's agwn function with the measured flag.

• Is your result worse or better than theory? How is symbol decision done? As you're using the measured flag you sould be independent from any scaling introduced by channel or IFFT. But to obtain more reliable results you should increase the number of symbols. – Deve Jan 14 '15 at 10:02

In theory, all you'd need to do is add Gaussian noise of the appropriate variance. Without seeing your code and without knowing what "funky" means, I would check for:

• when you do the convolution, scale the result by $\Delta t$, the time differential
• make sure the FFT scaling that Matlab performs is not throwing you off

One thing you can do, which is simple but not very elegant, is to add the noise to each symbol after the FFT in the receiver, but before running any decision rule on them. You can simply add one sample of complex noise of variance $N_0$ to each symbol; since you control their average energy, you can get any SNR you want.

You shouldn't do a measurement with only one OFDM symbol at first. Instead create some random data, perform QAM modulation, devide QAM symbols array in $N$ OFDM data blocks and make OFDM symbols. Then add CP and paste it together to form a frame. Now you can calculate its power,

$P_{signal} = 1 \div (N \cdot N_{FFT})\sum {s^2}$

estimate PAPR, add some noise to model frame spread over AWGN channel. Choose SNR of interest, you know your signal's power, so you can calculate power of noise to be added to satisfy SNR value you've choosen.

$P_{noise} = 10^{-SNR/10} \cdot P_{signal}$

Create complex-value noise with $randn$ function and scale it with

$\sigma = \sqrt{P_{noise}}/{\sqrt{2}}$

After that if you perform OFDM demodulation and than QAM demodulation you'll achive BER you're expecting to be for SNR you've choosen. If you want to have more precise measurement, do this routine for some times for one value of SNR and make average statistic. If you want to plot really good curves you need $1e+5...1e+6$ bits to measure BER for one SNR value. You can construct frame from about 5000...20000 bits (its common length for LDPC decoder used e.g. in the latest DVB-T, as I remember) and do measurements in $for$ loop. I advice you to generate random data at every iterarion.

So I don't see any problem in FFT normalization or with anything else. You construct a frame, estimate its power and insert noise according to average signal's power and SNR you want to achive.

Oh, I've forgotten. If you use only part of subcarriers during modulation, you should scale noise power as

$P_{noise} = P_{noise} \cdot N_{used} \div N_{FFT}$

to match the band where signal really exists and noise band.

• What is $s$ in your first equation? Why is the PAPR required? Also, if you estimate the mean signal power by "measurement" you must not scale the noise power as you do in your last step as the effect of zero subcarriers on the mean signal power is already taken into account by the signal power estimation. – Deve Jan 15 '15 at 8:34
• $s$ are samples of OFDM frame. PAPR is not required, it's possible to estimate it with the whole frame constructed. If you modulate e.g. only 1/4 or 1/8 of the total subcarriers band of such a signal will be much smaller so it gives BER improvement for the same SNR. So bandwidth reduction must be taken into account because BER curves are calculated for SNR in exact band of the signal – Serj Jan 15 '15 at 17:45
• I prefer to use the (analog) receiver bandwidth because I think DSP belongs to receive algorithms like equalization, decision and error correction. But depending on what you want to show or compare other definitons make sense, so it's a good point. – Deve Jan 16 '15 at 8:36