BER of OFDM, how scale correct after IFFT?

9 views (last 30 days)
Bernd
Bernd on 21 Feb 2012
Edited: Image Analyst on 19 Oct 2013
Hi
I want to simulate the Bit Error Rate of OFDM and compare it to the theoretic max.
After the IFFT of the Symbol I want to add noise to my time Signal. Without noise it works fine (BER = 0). When I checked the amplitudes I get a higher noise than signal. Here I think I should scale the signal correct but i don't know how to do this.
I tried this Scaling the FFT and the IFFT but it didn't work.
Thanks a lot!
Bernd
nSubcarriers = 1000;
nFFT = 2^(nextpow2(nSubcarriers) + 1);
data = rand(nSubcarriers,1) > 0.5;% BPSK
modSymbol = 2*data - 1; % OFDM Symbol
H = 1; % ideal channel
modSymbol = H.*modSymbol; % multiply with my channel
Y_f = [0; modSymbol; 0; conj(flipud(modSymbol))];
y_t = ifft(Y_f,nFFT); % get time signal
snr = 0:10;
for ii = 1:length(snr)
sigma = sqrt(1./(2*10.^(snr(ii)/10))); % AWGN Noise
n_t = sigma * (randn(length(y_t),1) + 1i*(randn(length(y_t),1)));
r_t = y_t + n_t; % add noise to signal
receivedSymbol = fft(r_t,nFFT); % FFT
receivedSymbol = receivedSymbol(2:nSubcarriers+1);
received_bits = 2*floor(real(receivedSymbol + 1 )) > 0;
error_bits = sum(xor(received_bits,data));
BER = error_bits/length(data);
BER_theo = 0.5*erfc(sqrt(10.^(snr(ii)/10)));
fprintf('SNR: %d dB, BER: %d, BER theoretic: %d\n', snr(ii), BER, BER_theo );
end
  2 Comments
Dr. Seis
Dr. Seis on 21 Feb 2012
I am a bit confused with what you are doing here.
What from that post on scaling the FFT and IFFT didn't work?
You have real/complex data in the frequency domain with symmetry about 0 frequency, but then you are adding complex noise to the time data. Shouldn't the time domain data be all real?
Why are you padding your frequency domain data before you transform it back to the time domain? You lose your symmetry when you do this, which will lead to complex time domain data.
Bernd
Bernd on 21 Feb 2012
I didn't work with Fourier for long time...
- I don't know how to get my correct scale-factor, that's my main problem. I can't just say 45 works so i'll take it. I need to know how to get the factor.
- Isn't noise always complex? I got real time domain data when i use QPSK, now i use BPSK -> complex.
- I want to use QPSK, too.

Sign in to comment.

Answers (1)

Dr. Seis
Dr. Seis on 21 Feb 2012
I use the FFT for a much different problem. In my case, the time domain data are always real and the frequency domain data are always real/imaginary and symmetric/anti-symmetric.
In your case, what is the time increment (dt) or sampling frequency (Fs = 1/dt) in the time domain? Here is what I typically do:
If:
Fs = 100; % samples per second
N = 128; % Number of samples
data_time = randn(1,N);
Then:
data_freq = fft(data_time)*1/Fs;
and:
data_time = ifft(data_freq)*Fs;
When Matlab takes the IFFT of data, it will automatically normalize the output amplitudes by "N".
  2 Comments
Bernd
Bernd on 22 Feb 2012
Well I got a sampling frequency of 10 MHz - that's why i'm confused that this should work...
Dr. Seis
Dr. Seis on 22 Feb 2012
The Fourier transform involves integration. What we are doing is the discrete Fourier transform, which means integration over a discrete set of data. In order to do discrete integration, one must know both the amplitudes and the interval spacing between discrete data points (area = height of amplitude * width of interval spacing). The FFT implemented by Matlab assumes the data were sampled once every second. The discrete integral (or discrete area under the curves) will be way off if the width of the interval spacing is significantly different from 1. In your case, Fs = 10e6 samples/sec is significantly different from Fs = 1.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!