1. Simple BPSK

NOTE: if your Excel is like mine, then it may run this simulation very slowly even on a very fast computer due to what appears to be a bug in Excel. In such a case please see When Excel runs simulations slowly.

A. The Letter

The following is an extract from a letter to my friend, attempting to explain in an accessible way the principle.

Dear Xxx,

This workbook implements a classic BPSK model where the signal is generated in the time domain and is modulated in the time domain by multiplying it with the data stream. Next, white noise is generated as random numbers with finite uniform amplitude distribution (therefore not quite white, but very much close to it), the signal is attenuated and Doppler shift is added too (the amount of Doppler shift is set in the channel model, but actually it is referred back to the carrier generator, whose initial frequency is changed with the value of the Doppler shift). Finally, the signal is demodulated. The problem with writing software model for BPSK demodulators is that one will need to write all the routines for synchronisation between the transmitter and the receiver, which may take a lot of effort. However, if we use FFT we could calculate the phase of the received signal immediately and therefore we could simply compare this phase to zero. If it is greater than zero, then we assume that "1" has been sent, else that "0" has been sent. Of course, real BPSK demodulators usually do not use FFT, they use PLL and discriminators, but like we said, if we were to model a PLL we would need to write some routines to model the initial synchronisation, and the transmission and reception of a training sequence in the signal or sending and receiving pilot signal, etc., and this would require more work than just writing and FFT routine. By using FFT we simply apply an easy method for deriving phase information from the signal. The implications of using FFT (rather than modelling a real BPSK demodulator) are:

a) The results are valid for the case of perfect synchronisation between the transmitter and the receiver. If a real system has a poorly-designed synchronisation function then it may show worse results than those obtained here (however, a system with good synchronisation, such as a mobile cellular system, where the design of the hardware has been optimised and the protocol perfected, will produce results very close to those modelled here);

b) The results are valid for perfect receiver filtering. The receiver filter is assumed to be able to separate the useful signal from the interference without suppressing (or cutting-off) its sidebands.

See below a diagram of the setup. In order to start a simulation, please select the simulation worksheet, enter appropriate values in the cells with white background (please do not change the values in any of the coloured cells -- they contain formulae). Press [F9] key to recalculate.

You can press several times [F9] key to see several different realisations of the signal and the interference. You may even press and hold down [F9] key and then, if you have a fast computer, you will see everything "live" like on a digital analyser.

Each time you press [F9] a new instance of the signals is generated, a new FFT is calculated and one bit of information is sent and is received. The interference between different pressings of F9 is uncorrelated, and the phase of the signal is discontinuous. Hence this model calculates the bit probability of error, not the system probability of error.

The best way for running the worksheet is to click on the RUN button. It will then run automatically. You can change the values of the different parameters while the worksheet is running and immediately see the effect of the change.

Most of the signals are displayed as graphs and as tables. Where FFT is used its formula is entered as an Excel Array Formula. Please read Excel Help on how to work with Array Formulas and how to enter or edit them -- this will require some attention to detail. (In a nutshell -- this is very much like working with ordinary formulas, but you have first to select all cells with the same formula, then edit the formula in the first selected cell, and at the end you MUST press [Ctrl-Shift-Enter] and NOT just [Enter] key).

Inside the Excel workbook there is an FFT module, which you may look at and use in a different way within this simulation or even use it in your other work. To see it go to Tools menu, Macro, Visual Basic Editor (or simply press [Alt-F11] key). In Excel 2007 and later you should better enable the so-called "Developer" tab in the ribbon. To do this go to Options and follow Excel's help -- yes, it is a bit complicated (used to be very simple in Excel 2003 and prior, but now it is no longer).

There is a lot more to this model than what I explained above. Please look inside the workbook and use your own judgement. It is impossible to say everything and to explain everything here.

Yours truly,

Plamen

16-27/Apr./2005 (last updated 18/May/2007)

B. The Setup

This is a static picture illustrating the structure of the simulation (click on it to see it in true scale):

C. The Simulation Displays

This is a screenshot of the simulation display with its input and output parameters (click on the image to see it in true scale).

In Excel this turns into an all-dancing and all-singing show when you click on the RUN button or when you hold down the [F9] key.

D. The Workbooks

Two workbooks are attached below and available for downloading. They are largely identical and the main difference is that one is for Excel 2003 and earlier, while the other is for Excel 2007 and later.

Both workbooks contain VBA code, which is required for them to perform the simulation. The Excel spreadsheet contains barely any calculations and almost everything is done in VBA, so if VBA code (also known as 'macros') is disabled, then the workbooks will be static and of little use. Please make sure that you do not disable macros when you open the workbooks.

The latest edition of the workbooks has a feature which will not show the simulation worksheets if macros are disabled. So if after opening the downloaded workbook you only see a single sheet with a warning that macros are disabled, then please follow the instructions on that worksheet and enable the macros in order to see the simulation running and play with it.

E. How to Download a Workbook or Leave a Comment

You can download the workbooks by clicking on the small arrow icon on the far right end in each line [].

You are also very welcome to leave a comment. To do so, you need to sign in to your Google Account (or create one): Sign in

Thanks for looking here and eventually downloading a simulation workbook. I hope you find something useful in them. Enjoy!