BER of OFDM, how scale correct after IFFT?
9 views (last 30 days)
Show older comments
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.
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
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.
Answers (1)
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
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.
See Also
Categories
Find more on Test and Measurement in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!