All posts by John

About John

John has over 12 years of Research and Development experience in the field of Wireless Communications. He has worked for a number of companies around the world including Qualcomm Inc. USA. He has an MS in Electrical Engineering from Virginia Tech USA and has published his work in international journals and conferences.

BPSK Bit Error Rate Calculation Using Python

Have you ever thought about how life would be without MATLAB. As it turns out there are free and open source options such as Python. We have so far restricted ourself to MATLAB in this blog but now we venture out to find out what are the other options. Given below is a most basic Pyhton code that calculates the Bit Error Rate of Binary Phase Shift Keying (BPSK). Compare this to our MATLAB implementation earlier [BPSK BER].

There are various IDEs available for writing your code but I have used Enthought Canopy Editor (32 bit) which is free to download and is also quite easy to use [download here]. So as it turns out that there is life beyond MATLAB. In fact there are several advantages of using Python over MATLAB which we will discuss later in another post. Lastly please note the indentation in the code below as there is no “end” statement in a for loop in Python.

from numpy import sqrt
from numpy.random import rand, randn
import matplotlib.pyplot as plt
N = 5000000
EbNodB_range = range(0,11)
itr = len(EbNodB_range)
ber = [None]*itr

for n in range (0, itr): 
    EbNodB = EbNodB_range[n]   
    x = 2 * (rand(N) >= 0.5) - 1
    noise_std = 1/sqrt(2*EbNo)
    y = x + noise_std * randn(N)
    y_d = 2 * (y >= 0) - 1
    errors = (x != y_d).sum()
    ber[n] = 1.0 * errors / N
    print "EbNodB:", EbNodB
    print "Error bits:", errors
    print "Error probability:", ber[n] 
plt.plot(EbNodB_range, ber, 'bo', EbNodB_range, ber, 'k')
plt.axis([0, 10, 1e-6, 0.1])
plt.title('BPSK Modulation')
BPSK Bit Error Rate
BPSK Bit Error Rate



Knife Edge Diffraction Model

Diffraction is a phenomenon where electromagnetic waves (such as light waves) bend around corners to reach places which are otherwise not reachable i.e. not in the line of sight. In technical jargon such regions are also called shadowed regions (the term again drawn from the physics of light). This phenomenon can be explained by Huygen’s principle which states that as a plane wave propagates in a particular direction each new point along the wavefront is a source of secondary waves. This can be understood by looking at the following figure. However one peculiarity of this principle is that it is unable to explain why the new point source transmits only in the forward direction.

Image result for diffraction

The electromagnetic field in the shadowed region can be calculated by combining vectorially the contributions of all of these secondary sources, which is not an easy task. Secondly, the geometry is usually much more complicated than shown in the above figure. For example consider a telecom tower transmitting electromagnetic waves from a rooftop and a pedestrian using a mobile phone at street level. The EM waves usually reach the receiver at street level after more than one diffraction (not to mention multiple reflections).  However, an approximation that works well in most cases is called knife edge diffraction, which assumes a single sharp edge (an edge with a thickness much smaller than the wavelength) separates the transmitter and receiver.

The path loss due to diffraction in the knife edge model is controlled by the Fresnel Diffraction Parameter which measures how deep the receiver is within the shadowed region. A negative value for the parameter shows that the obstruction is below the line of sight and if the value is below -1 there is hardly any loss. A value of 0 (zero) means that the transmitter, receiver and tip of the obstruction are all in line and the Electric Field Strength is reduced by half or the power is reduced to one fourth of the value without the obstruction i.e. a loss of 6dB.  As the value of the Fresnel Diffraction Parameter increases on the positive side the path loss rapidly increases reaching a value of 27 dB for a parameter value of 5. Sometimes the exact calculation is not needed and only an approximate calculation, as proposed by Lee in 1985, is sufficient.

Fresnel Diffraction Parameter (v) is defined as:



d1 is the distance between the transmitter and the obstruction along the line of sight

d2 is the distance between the receiver and the obstruction along the line of sight

h is the height of the obstruction above the line of sight

and lambda is the wavelength

Diffraction Loss Using Knife-Edge Model

The MATLAB codes used to generate the above plots are given below (approximate method followed by the exact method). Feel free to use them in your simulations and if you have a question drop us a comment.

% Calculation of the path loss based on the value of
% Fresnel Diffraction Parameter as proposed by Lee
% Lee W C Y Mobile Communications Engineering 1985
% Copyright
clear all
close all


for n=1:length(v)

    if v(n) <= -1
    elseif v(n) <= 0
    elseif v(n) <= 1
    elseif v(n) <= 2.4

plot(v, G, 'b')
xlabel('Fresnel Diffraction Parameter')
ylabel('Diffraction Loss (dB)')
% Exact calculation of the path loss (in dB)
% based on Fresnel Diffraction Parameter (v)
% T S Rappaport Wireless Communications P&P
% Copyright
clear all
close all


for n=1:length(v)


plot(v, 20*log10(F),'r')
xlabel('Fresnel Diffraction Parameter')
ylabel('Diffraction Loss (dB)')

An interesting video explaining the phenomenon of diffraction.

Reflection vs Scattering in Ray-Tracing

In ray-tracing simulations one is faced with a complexity at points of intersection between rays and objects. How to handle the reflection, should it be specular or scattered. In this post we consider the two extreme cases; pure reflection vs scattering.

For this we consider that in the case of specular reflection the power of the ray is reduced by 3dB (that is R=0.5) and the ray continues as it would if there was no interaction with the object (off course direction would be changed with angle of reflection being equal of incidence).

In the case of scattered ray we assume that the point of interaction between the ray and the object is a point source from where the rays are regenerated. Therefore there is a rapid drop in the E-field strength as the ray propagates away from the point of interaction.

clear all
close all

r=[r1 r2];

Er=[Er1 Er2];

Es=[Es1 Es2];

hold on
hold off

xlabel('Distance (m)')
ylabel('E-field (V/m)')

Reflected vs Scattered Ray

The simulation code above considers that a ray travels unobstructed for 100 m and at this point comes in contact with an object and is reflected (reflection coefficient of 0.5 is assumed) or scattered. The ray then again travels for another 100 m without coming in contact with an object.

It is observed that there is a rapid decrease in E-field strength of the scattered ray beyond 100 m. This is because the E-field strength at the point of interaction is much lower than that at the source and when this is considered to be a point source, re-generating the rays, the resulting E-field decays quite rapidly.

We assume that the reflection is specular in most of our simulations as this is closer to reality than assuming a fully scattered ray.

How to Find Point of Intersection of Two Lines

Finding the point of intersection of two lines has many important application such as in Ray-Tracing Simulation.  Two lines always intersect at some point unless they are absolutely parallel, like the rails of a railway track. We start with writing the equations of the two lines in slope-intercept form.




Here m1 and m2 are the slopes of the two lines and b1 and b2 are their y-intercepts. At the point of intesection y1=y2, so we have.


But at  the point of intersection x1=x2 as well, so replacing x1 and x2 with x we have.






Once the x-component of the point of intersection is found we can easily find the y-component by substituting x in any of the two line equations above.


In future posts we would like to discuss the cases of intersection of two surfaces and the intersection of two volumes.

Shannon Capacity CDMA vs OFDMA

We have previously discussed Shannon Capacity of CDMA and OFMDA, here we will discuss it again in a bit more detail. Let us assume that we have 20 MHz bandwidth for both the systems which is divided amongst 20 users. For OFDMA we assume that each user gets 1 MHz bandwidth and there are no guard bands or pilot carriers. For CDMA we assume that each user utilizes full 20 MHz bandwidth. We can say that for OFDMA each user has a dedicated channel whereas for CDMA the channel is shared between 20 simultaneous users.

We know that Shannon Capacity is given as


or in the case of CDMA


where ‘B’ is the bandwidth and SINR is the signal to noise plus interference ratio. For OFDMA the SNR is given as


where ‘Pu’ is the signal power of a single user and ‘No’ is the Noise Power Spectral Density. For CDMA the calculation of SINR is a bit more complicated as we have to take into account the Multiple Access Interference. If the total number of users is ‘u’ the SINR is calculated as


The code given below plots the capacity of CDMA and OFDMA as a function of Noise Power Spectral Density ‘No’.

% u - Number of users
% Pu - Power of a single user
% No - Noise Power Spectral Density
% Copyright RAYmaps (

clear all
close all




plot(No,C_CDMA/1e6);hold on
plot(No,C_OFDMA/1e6,'r');hold off
xlabel('Noise Power Spectral Density (No)')
ylabel('Capacity (Mbps)')
Shannon Capacity of CDMA and OFDMA
Shannon Capacity of CDMA and OFDMA

We see that the capacity of OFDMA is much more sensitive to noise than CDMA. Within the low noise region the capacity of OFDMA is much better than CDMA but as the noise increases the capacity of the two schemes converges. In fact it was seen that as the noise PSD is further increased the two curves completely overlap each other. Therefore it can be concluded that OFDMA is the preferred technique when we are operating in the high SNR regime.

Sum of Sinusoids Fading Simulator

We have previously looked at frequency domain fading simulators i.e. simulators that define the Doppler components in the frequency domain and then perform an IDFT to get the time domain signal. These simulators include Smith’s Simulator, Young’s Simulator and our very own Computationally Efficient Rayleigh Fading Simulator. Another technique that has been widely reported in the literature is Sum of Sinusoids Method. As the name suggests this method generates the Doppler components in the time domain and then sums them up to generate the time domain fading envelope. There are three parameters that define the properties of the generated signal.

1) Number of sinusoids – Higher the number better the properties of the generated signal but greater the computational complexity
2) Angle of arrival – This can be generated statistically or deterministically, spread from –pi to pi.
3) Phase of the arriving wave – This is uniformly distributed between –pi and pi.

The MATLAB code below gives three similar sum of sinusoids techniques for generating a Rayleigh faded envelope [1].

% fd - Doppler frequency  
% fs - Sampling frequency
% ts - Sampling period
% N - Number of sinusoids

clear all
close all


% Method 1 - Clarke

for n=1:N;n

hold on

% Method 2 - Pop, Beaulieu

for n=1:N;n

hold on

% Method 3 - Chengshan Xiao

for n=1:N;n

hold off


All the three techniques given above are quite accurate in generating a Rayleigh faded envelope with the desired statistical properties. The accuracy of these techniques increases as the number of sinusoids goes to infinity (we have tested these techniques with up to 1000 sinusoids but realistically speaking even 100 sinusoids are enough). If we want to compare the three techniques in terms of the Level Crossing Rate (LCR) and Average Fade Duration (AFD) we can say that the first and third technique are a bit more accurate than the second technique. Therefore we can conclude that a statistically distributed angle of arrival is a better choice than a deterministically distributed angle of arrival. Also, if we look at the autocorrelation of the in-phase and quadrature components we see that for the first and third case we get a zero order Bessel function of the first kind whereas for the second case we get a somewhat different sequence which approximates the Bessel function with increasing accuracy as the number of sinusoids is increased.

Correlation of Real and Imaginary Parts
Correlation of Real and Imaginary Parts

The above figures show the theoretical Bessel function versus the autocorrelation of the real/imaginary part  generated by method number two. The figure on the left considers 20 sinusoids whereas the figure on the right considers 40 sinusoids. As can be seen the accuracy of the autocorrelation sequence increases considerably by doubling the number of sinusoids. We can assume that for number of sinusoids exceeding 100 i.e. N=100 in the above code the generated autocorrelation sequence would be quite accurate.

[1] Chengshan Xiao, “Novel Sum-of-Sinusoids Simulation Models for Rayleigh and Rician Fading Channels,” IEEE TRANSACTIONS ON WIRELESS COMMUNICATIONS, VOL. 5, NO. 12, DECEMBER 2006.

Noise Calibration in Simulation of Communication Systems

We have been using a wireless signal model in our simulations without going into the details of noise calibration for simulation. In this article we discuss this. Lets assume the received signal is given as


where r(t) is the received signal s(t) is the transmitted signal and n(t) is the Additive White Gaussian Noise (AWGN). Channel fading is ignored at the moment. Signal to noise ratio for simulation of digital communication systems is given as

ρ=Eb/No (1)

Where Eb is the energy per bit and No is the noise Power Spectral Density (PSD). We also know that for the case of Additive White Gaussian Noise the noise power is given as [Tranter]



Noise PSDWhere σ is the standard deviation of noise and fs is the sampling frequency.  Substituting in equation 1 we get

ρ=Eb/No=Eb/(2*σ^2/fs )


σ^2=(Eb*fs)/(2*Eb/No )

σ=√((Eb*fs)/(2*Eb/No ))

If the energy per bit and the sampling frequency is set to 1 the above equation reduces to

σ=√(1/(2*Eb/No ))

The simulation software can thus calculate the noise standard deviation (or variance) for each value of Eb/No in the simulation cycle. The following piece of MATLAB code generates AWGN with the required power and adds it to the transmitted signal.

s=sign(rand-0.5);      % Generate a symbol
sigma=1/sqrt(2*EbNo);  % Calculate noise standard deviation
n=sigma*randn;         % Generate AWGN with the required std dev 
r=s+n;                 % Add noise to the signal

How can we assume that energy per bit and sampling frequency is equal to one and are we breaking some discrete time signal processing rule here. This will be discussed in a later post.

Modified Young’s Fading Simulator

In the previous posts we had discussed generation of a correlated Rayleigh fading sequence using Smith’s method [1] and Young’s modification of Smith’s method [2]. The main contribution of Young was that he proposed a mechanism where the number of IDFTs was reduced by half. This was achieved by first adding two length N IID zero mean Gaussian sequences filtered by the filter F[k] and then performing the IDFT on the resulting complex sequence.

This was different to Smith’s method where the IDFT was performed simultaneously on two branches and then the outputs of these branches were added in quadrature to achieve the desired sequence with Rayleigh distributed envelope and Uniformly distributed phase. Another problem with Smith’s method was that the outputs of the two arms after performing IDFTs was assumed to be real which is not always the case in implementation and depends upon the combination of Doppler frequency (fm) and length of Gaussian sequence (N).

Young's Fading Simulator
Young’s Fading Simulator


Youngs Filter
Youngs Filter

Young’s technique is shown graphically in the above figure. Also shown is the definition of filter F[k] which depends upon N, fm and km (please note that the fm in the above equation is normalized by the sampling frequency fs). Here km = N*(fm/fs). We propose three modifications to Young’s technique which significantly reduces computation and at the same time maintains the statistical properties of the generated sequence. The modifications we propose are.

1. First modification has to do with the generated Gaussian sequence. It is observed that the filter F[k], at very high sampling rates, is mostly zero and there are very few points which have some non-zero value. So when we multiply the Gaussian sequence with the filter we mostly get zeros at the output. So we propose that the filter response in the frequency domain must be calculated first and the the Gaussian random sequence must be generated for only those points where the filter F[k] is non-zero e.g. for a sampling frequency of 7.68 MHz (standard sampling frequency for a BW of 5 MHz in LTE) and Doppler frequency of 70 Hz (corresponding to medium Doppler case in LTE) the filter F[k] has 99.9982% zeros in its frequency response and it would be a highly wasteful to calculate Gaussian RVs for all those values.

2. Secondly according to Clarke [3] the Doppler Spectrum measurements have “Marked disagreement at very low frequencies and at frequencies in the region of the sharp cut-off associated with the maximum Doppler frequency shift. At very low frequencies the spectral energy is always observed to be higher than that predicted by theory”. He goes on to add “The reason for this is that neither theoretical model takes into account the large scale variations in total energy which result from the changing topography between transmitter and mobile receiver”. This suggests that the Classical Doppler Spectrum might not be the best choice under all scenarios. This has also been noted in [4] where a flat fading model is evaluated in terms of its Level Crossing Rate and Average Fade Duration. Such a flat spectrum is especially suited to indoor scenarios as noted in [5] and [6].

We propose a filter that gives equal weight to all the frequencies up to the maximum Doppler frequency. So our filter is a box-type filter which applies a constant scaling factor to all the frequencies in the pass-band and zeros out all the frequencies in the stop-band. So in fact the Gaussian sequence that is generated in the in-phase arm may directly be added with the Gaussian sequence from the other arm without applying the frequency domain filter and then IDFT of the complex sequence is taken. We will look into the deviation from ideality  that this causes later.

3. The third modification that we propose is in the implementation of the IDFT. Here again we take into consideration that the complex sequence being fed to the IDFT is filled with zeros (as we noted earlier 99.9982% zeros for 7.68 MHz and even more for higher frequencies) so we can avoid a lot multiplications and summations. The IDFT is defined below and also given is our modification to it.

EquationsFurther improvement in computation time is achieved by implementing the above as a matrix multiplication. The matrix multiplication is implemented as H*X where H is the IDFT coefficients of size N x 2(km+1) and X is a vector of size 2(km+1) x 1 upon which the IDFT has to be performed.

Now let us look at the output sequence generated by using the above techniques. We consider the case of Medium Doppler Frequency of 70 Hz (EVA channel) as defined by LTE specifications. Sampling frequency is fixed at 10 kHz giving a normalized Doppler frequency of 0.007.  This was done due to limitation of memory on the machine. The author also experimented with a sampling frequency of 7.68 MHz but this did not yield enough samples for statistically accurate results. We did use a sampling frequency of 7.68 MHz for our bit error rate simulation which is shown in the end.

Rayleigh Fading Envelope fm=70Hz
Rayleigh Fading Envelope fm=70Hz
Distribution of Fading Envelope fm=70Hz
Distribution of Fading Envelope fm=70Hz

It is observed for fm=70 Hz the envelope of the output sequence using the proposed technique matches quite well with the envelope of the output sequence generated by the ideal filter proposed by Young. Also the phase and envelope of the sequence generated using the proposed technique has the desired distribution. Some of the other metrics that we can look at are the level crossing rate (LCR) and average fade duration (AFD) as well as the Auto Correlation of the real and imaginary parts of the complex sequence generated.

Parameter Young Modified
LCR (ideal) 48.1086 48.1086
LCR (sim) 48.1506 39.4348
AFD (ideal) 0.0018 0.0018
AFD (sim) 0.0018 0.0022

If we look at the results for LCR and AFD we see that the simulated results match reasonably well with the results predicted by theory. These results correspond to 100 snapshots of the fading sequence. It was important to take the average of several snapshots as results varied with each simulation run. Sometimes Young’s technique produced more accurate results while at other times the proposed technique was better. Again the limitations of computer memory and processing power dictated the length of the sequence that could be generated.

In general Young’s technique produced better results than our proposed technique. It was found that product of LCR and AFD for both cases matched quite well with the theoretical value. So the total time spent in a fade state per second was equal in both the cases. In the proposed method the duration of a single fading event was higher,  whereas the number of fading events per second was lower. This can be attributed to the fact that in our proposed technique higher weighting is given to lower frequency components and the fading sequence is smoothed out by these low frequency components. One technique to overcome this is spectral broadening as suggested by [4] but this is not the subject here and we postpone its discussion to another article.

Auto Correlation of Real Part fm=70Hz

Auto Correlation of Real Part fm=70Hz

Auto Correlation of Imaginary Part fm=70Hz
Auto Correlation of Imaginary Part fm=70Hz

The Auto Correlation of the real and imaginary parts of the generated sequences are also calculated for a Doppler frequency of 70 Hz. It is found that the Auto Correlation sequence for the two techniques matches quite well. However, the Auto Correlation sequence deviates from the theoretical value as calculated the by Bessel function of the first kind and zero order. Since we have used a flat spectral mask the Auto Correlation function resembles the sinc(x) function which is the same as zeroth order Spherical Bessel Function of the first kind (which is related to 1/2 order Bessel Function of the first kind).

It was found that when the Rayleigh fading sequence is generated by the program provided in Young’s thesis the shape of the Auto Correlation function depends upon the sampling frequency. At a normalized Doppler frequency of 0.05 and N=2^16 Young’s technique produces quite accurate results. We also measured the mean squared error (MSE) between the two Auto Correlations sequences and found it to be a function of the Normalized Doppler Frequency. It was found that as the Normalized Doppler Frequency was increased from 0.00007 to 0.0007 the MSE error dropped from 0.0277 to 0.0041. The relationship between the Normalized Doppler Frequency and MSE, for a fixed sequence length, seems to be resembling an exponential function. For more accurate results, at higher sampling frequencies, the number of samples would have to be increased considerably. In fact it was found that if the variable km (km=N*fm/fs) is maintained at around 20 the error between the two correlation sequences is less than 1% for all possible sampling rates.

MSE of Autocorrelation Sequence
MSE of Autocorrelation Sequence

We also compared the bit error rate (BER) performance of different QAM modulation schemes using both the techniques for fading envelope generation and found these to be matching quite well. A single tap was used which results in a flat fading channel. This is a simplistic channel model but it gives us some confidence that the proposed approach does have the desired statistical properties. A good test of a temporally correlated Rayleigh fading sequence is to test it on a system that implements interleavers and channel coders whose performance strongly depends upon factors such as the LCR and AFD e.g. a certain forward error correction (FEC) code might work well in high LCR and low AFD as this distributes out errors in different blocks and allows the code to correct them. In simulations done so far (not shown here) we have found that for a 1/2 rate convolutional encoder with Hard Viterbi Decoding the BER for the two schemes matches quite well. In general the results for correlated fading are much worse than uncorrelated fading.

BER of QAM fm=70Hz
BER of QAM fm=70Hz

In future we would also like to evaluate the bit error rate (BER) performance of an M-QAM OFDM system with Frequency Selective Rayleigh fading as described by the LTE fading channels EPA, EVA and ETU. This is probably a good scenario to compare the accuracy of the two techniques used to generate Rayleigh fading sequences above. One challenge in this regard is that the LTE channel taps are described in increments of 10 nsec whereas the LTE signal sampling rate is defined on a different scale (minimum Ts=32.5521 nsec corresponding to a sampling rate of 30.72 Msps). So we would have to do sample rate conversion to implement a time varying frequency selective Rayleigh fading channel.

[1] John I. Smith, “A Computer Generated Multipath Fading Simulation for Mobile Radio”, IEEE Transactions on Vehicular Technology, vol VT-24, No. 3, August 1975.

[2] David J. Young and Norman C. Beaulieu, “The Generation of Correlated Rayleigh Random Variates by Inverse Discrete Fourier Transform”, IEEE Transactions on Communications vol. 48 no. 7 July 2000.

[3] R. H. Clarke, A Statistical Theory of Mobile Radio Reception”, Bell Systems Technical Journal 47 (6), pp 957–1000, July 1968.

[4] Rosmansyah, Y.; Saunders, S.R.; Sweeney, P.; Tafazolli, R., “Equivalence of flat and classical Doppler sample generators,” Electronics Letters , vol.37, no.4, pp.243,244, 15 Feb 2001.

[5] JTC (Joint Technical Committee T1 RIP1.4 and TIA TR46.3.3/TR45.4.4 on Wireless Access): “Draft final report on RF channel characterization”. Paper no. JTC(AIR)/94.01.17-238R4, January 17, 1994.

[6] ETSI (European Telecommunications Standards Institute): “Universal mobile telecommunications system (UMTS); selection procedures for the choice of radio transmission technologies of the UMTS (UMTS 30.03 version 3.2.0)”. Technical Report, TR 101 112 V3.2.0 (1998-04),, 1998.


Theoretical BER of M-QAM in Rayleigh Fading

We have previously discussed the Bit Error Rate of M-QAM in Rayleigh Fading using Monte Carlo Simulation. We now turn our attention to calculation of Bit Error Rate (BER) of M-QAM in Rayleigh fading using analytical techniques. In particular we look at the method used in MATLAB function berfading.m. In this function the BER of 4-QAM, 16-QAM and 64-QAM is calculated from series expressions having 1, 3 and 5 terms respectively. These are given below (M is the constellation size and must be a power of 2).

if (M == 4)
     ber = 1/2 * ( 1 - sqrt(gamma_c/k./(1+gamma_c/k)) );
elseif (M == 16)
     ber = 3/8 * ( 1 - sqrt(2/5*gamma_c/k./(1+2/5*gamma_c/k)) ) ...
     + 1/4 * ( 1 - sqrt(18/5*gamma_c/k./(1+18/5*gamma_c/k)) ) ...
     - 1/8 * ( 1 - sqrt(10*gamma_c/k./(1+10*gamma_c/k)) );
elseif (M == 64)
     ber = 7/24 * ( 1 - sqrt(1/7*gamma_c/k./(1+1/7*gamma_c/k)) ) ...
     + 1/4 * ( 1 - sqrt(9/7*gamma_c/k./(1+9/7*gamma_c/k)) ) ...
     - 1/24 * ( 1 - sqrt(25/7*gamma_c/k./(1+25/7*gamma_c/k)) ) ...
     + 1/24 * ( 1 - sqrt(81/7*gamma_c/k./(1+81/7*gamma_c/k)) ) ...
     - 1/24 * ( 1 - sqrt(169/7*gamma_c/k./(1+169/7*gamma_c/k)) );

Although using these expressions we get very accurate BER but it is not that simple to calculate (the expressions become even more complicated for higher constellation sizes such as 256-QAM). Therefore we try to simplify these expressions by using only the first term in each expression. To our surprise the results match quite well with the results using the exact formulae. There is very minor difference at low signal to noise ratios but that can be easily bargained for the ease of calculation.

BER Equations

So here is our program for calculating the BER using the approximate method.

% M: Input, Constellation Size
% EbNo: Input, Energy Per Bit to Noise Power Spectral Density
% ber: Output, Bit Error Rate
function [ber]= BER_QAM_fading (M, EbNo)


if M==4
    ber = 1/2 * ( 1 - sqrt(gamma_c/k./(1+gamma_c/k)) );
elseif M==16
    ber = 3/8 * ( 1 - sqrt(2/5*gamma_c/k./(1+2/5*gamma_c/k)) );
elseif M==64
    ber = 7/24 * ( 1 - sqrt(1/7*gamma_c/k./(1+1/7*gamma_c/k)) );

axis([0 24 0.001 1])
grid on


QAM BER Approximate

So we see that the results match quite well with the results previously obtained through simulation. We will next tackle the problem of simplifying the expression for higher order modulations such as 256-QAM in both Rayleigh and Ricean channels.

Sizing Up a Solar System for a Cellular Base Station

Many operators are thinking of moving from the main grid to alternative energy sources such as wind and solar. This is especially true in third world countries where electricity is not available 24/7 and is also very expensive. This has forced operators to switch their base stations to diesel generators (which is also a costly option).

In this article we do a rough estimation of the size a solar system required to run a cellular base station. We start with the assumption that 20 Watts of power are transmitted from a single antenna of base station. For a 3 sector site there are 3 antennas giving us total transmitted power of 60 Watts. Now if 50% of the power is lost in cables and connections we would have to boost up the transmitted power to 120 Watts.

We know that power amplifiers are highly in-efficient (depending upon the load) and a large amount of power is lost in this stage. So we assume an efficiency of 12 % giving us a total input power of 1000 Watts. Another 500 Watts are given to Air Conditioning (200 W), Signal Processing (150 W) and Rectifier (150 W). So the combined AC input to the base station is 1500 Watts. Now we turn our attention to sizing up the solar system.

If we assume that the BS is continuously consuming 1500 Watts over a 24 hour period we have a total energy consumption of  36 kWh. If the solar panels receive peak sun hours of 5 hours/day we would require solar panels rated at 7200 Watts. This could mean 72 solar panels of 100 Watts each or 36 solar panels of 200 Watts each or any other combination. It must be noted that we have not considered any margins for cloudy days when peak sun hours would be reduced. Also, we have not considered any reduction in power consumption when there is no load (or very less load) on the BS.

Next we calculate the amount of batteries required. We assume that the batteries are rated at 200 AH and 12 V. This gives us a total energy storage capacity per battery of 2.4 kWh. So the number of batteries required is calculated as 36 kWh/2.4 kWh = 15. It must be noted that some of the energy would be consumed in real-time and the actual number of batteries required would be lesser. Furthermore we would need an inverter of at least 1500 Watts and charge controller of 125 Amps.