SM 5 BSZ - Weak signal software using Borland Turbo C / Assembler
(Sept 15 1997)

Old program, only for source code

If you just want to try this software on your computer, look here:
The 32 bit version (vers 1.00)
The 32 bit version (vers 1.10)
The 32 bit version (vers 1.11)

The material on this page is primarily for those having access to Borland 16 bit compilers, but not to Watcom 32 bit compilers. The .EXE file and the instructions are only to check that everything works as intended by comparision with new compiled files as a step towards making new software by changing the source code.

Performance

On a 200MHz pentium, the program can sample at 8kHz and produce 1024 FFT with a sine to the fourth window and an interleave factor (sliding FFT) of 16. With such a high number of FFT's the output approaches the output of a conventional digital filter. The frequency selected by the cursor is sent to the FM chip of the sound board to produce audio.

Since the output audio is produced from the fourier transforms the interleave factor must be at least 2 if no window is used, and with a sine^4 window, the quality becomes reasonable at interleave factors 8 and above.

The program uses no window if the interleave factor is 2, and a sine window when the interleave factor is 4. In this way some feeling for this software may be obtained on slower computers.

Minimum parameters for reasonable performance:
Interleave=2
Sampling frequency 4000
FFT size 128

The program should produce a readable signal at very low levels. It probably allows 3dB lower (or more) S/N than a conventional DSP such as Timewave 59+ when run on a Pentium 200MHz. This very early version is maybe not so straightforward to use, but for the experimenting amateur......

How to use the test program

You need the DSP.EXE (zip file) and a graphics driver Borland .BGI files (zip file)

When you start the program for the first time, you enter the parameter set-up routine. If you have a modern pentium, just press X to select them. If your computer is too slow the program will stop with a message telling just that (and what to change).

The parameters are saved in SIGPROC.INI and you have to select Set-up from the main menu if you want new parameters. The other option in the main menu is A=Run program.

Connect the output from your radio to the line input of your sound board. It probably has to be a genuine Creative Labs SB16. I have another computer with a compatible board - but it does not behave like the Soundblaster manual says it should.

When the program starts, you see the spectrum in real time like an oscilloscope image. The spectra are time averaged fourier transforms, and there are two, a fast (yellow) and a slow one (green).

Parameters

There are some parameters that can be changed, and they are indicated at the top of the screen.

The capital letter in each mode tells what character to press to enable change of that particular parameter.

dc Left Use + or - to make the peak at the centre of the spectrum disappear. The program uses complex FFT to save time, and the centre peak is an artefact arising from a DC offset in the A/D converter. Use / or * to make the step length smaller or larger.
dc Right No use yet, for stereo with cross yagis.
Graph gain Use * or / to change the vertical size of the graph. (+ or - for very small steps)
Audio gain Use * or / to change the output sound level. (+ or - for very small steps).
Max audio Maximum audio level. Use + or - to set the maximum sound level for a strong signal. (You may use "Audio gain" to make a weak signal saturate the signal processing - then set the limit volume with "Max audio" and finally set the noise floor to some weal level by stepping "Audio gain down".
Zero freq Centre frequency of signal sent to loudspeaker. Change with + - / *

When a parameter change is selected, the current value is displayed in green in the upper left corner of the screen.

Other keys

S To save currently selected options.
C To toggle between coherent detect and normal filtering.
X Exit.
Horisontal arrows Move cursor to select which frequency to listen to.
Vertical arrows Enable/disable automatic frequency adjustment to follow frequency drift of signal.
Alt Horizontal arrows Shift display horizontally if spectrum too wide to fit on screen.

The numbers on the third line are signal frequency and amplitude.

Source code

The complete source code DSPSRCE.ZIP is intended to run in its own subdirectory with the Borland include files and libraries in a separate directory /TOOLS directly under the root directory.

The files are:
MAIN.C Entry and exit routines (108 lines)
BLASTER.C High level set-up routines (471 lines)
GRAPH.C FFT Signal recovery and graphics (924 lines)
SBKINT.ASM Sound board manipulation and interrupt service routines. (1240 lines)
MON.H Header file for C programs (global variables) DSP.LNK Used by MAKE.EXE, specifies linking of .obj files

The code is straight forward, and it operates to a large extent with global variables which should make it relatively easy to manipulate. At the present state the code has a minimum of comments. Since most of it will probably be replaced I have not written much more comments than those I need myself to be able to work with the software.

Provided you have TCC.EXE, TASM.EXE and MAKE.EXE from Borland in your path, the command is MAKE -fdsp to produce the executable file DSP.EXE.

Code details

At this early stage, there are no version numbers. I had big difficulties making the sound board work. Presently only one mode operates, and that is 8 bit mono. (And only on one of my two sound boards)

The interrupt service routine makes a data reduction that is equivalent to frequency mixing with half the sampling frequency. The data is converted to 16 bit complex pairs ( I/Q ) allowing half the number of points in FFT's with unchanged performance and a significant speed improvement.

The user interface is very primitive. I guess a mouse driver would be a better way to move the cursor. The graphics uses fixed screen positions for the Y axis, it works fine on my screen - but I know very little about graphics.

Next step

The demo program presented on this page has convinced me that a really good receive system can be designed with the standard PC/Soundblaster computer.

The next step is to make the sound board interrupt routine work for 16 bit data in stereo. The conversion from real to complex data will lead to 32 bit integers which are (as I understand it) manipulated without any loss of speed if 32 bit instructions are used.

Liability, Copyright.....

The software on this page is completely my own. It is presented here to be used by anyone interested on his/her own risk. I take no responsibility for any damage that may be caused by malfunction of the software. The program uses dynamic memory allocation, and if you have many more programs loaded simultaneously it will use high memory with sometimes unpredictable results (The Borland C++ Assembly package is from 1988, long before MSDOS started using high memory)

I do not claim any copyright. The source code is here to encourage particularly radio amateurs to make their own additions and changes for whatever purpose of their own. If you make your own software from the source code here, please give it a new name of your own - even if you have changed only a single line.

To SM 5 BSZ Main Page