project MK4: CFRAD2.exe; Capture and Fast Fourier Transform Radio Astronomy Data with a RTL dongle (Software)

For those amateurs who want to try to receive the hydrogen line signals with a RTL dongle on a windows machine; here is a method to do so. This program captures and calculates FFT and add them in a file; 100000 spectra are avaraged in 5 minutes Sharp# is used for the settings.


Fig.3 - Sharp# screen.

Download the zip file from here  

1. You need to unzip the CFRAD file to a folder and copy the libusb-1.0.dll to the systems32 folder.

2. Start your Sharp# program, select your RTL usb dongle and select play.

3. You can select any sample rate, AGC settings etc for your need.

4. Bring up the task manager by pressing ctrl alt delete.

5. Go to the window "processes" tab in the task manager.

6. Right click SDRsharp.exe and click "end process", and again "end process"

7. Go to your cfrad2 folder and start cfrad2.exe

Immediately a raw file is written; you can open it with an editor and check the first two values in the file. These values are the highest and lowest value the program received from the dongle. minimum is 0 and maximum is 255. The middle value is 127. Best is, to use the whole range of the a/d converter; so a range of 5 to 250 is preferred. If way off, add more or less gain to your system.

After 5 minutes the first FFT .txt file will be written in the same folder as the cfrad application was located. There are 2048 bins. Dependend on your setting of the SDR# sw, these bins cover the selected bandwidth (quad mod). Example: If you selected 1024MS/s Quadmod, then the output range is 1.024MHz, and each bin is 1024/2048=500Hz wide. In total 288 text files will be written in 24 hours.

The output value is rms voltage.

You can stop the program any time by terminating it in the taskmanager.


The most important specification for FFT programs is that they produce as much spectra/s as possible. So best is to use a fast machine and not waste PC time on other tasks. This can be checked in the taskmanager; the processor core must be loaded 100%, and your fan has to ramp up after some time.

A quad core 1.8GHz, 2.5GB machine was used with W7 os.

Sample ratenumber of obtained spectraefficiencyreal integration time
[MS/s]in 5 minutes[%]minutes

Fig.1 - Efficiency Result Table.

Calculation method.

For each spectrum 2048 samples I and 2048 samples Q are used. These samples are obtained in pairs at thesame moment.

In the ideal case, when sampling with 1.048MS/s, a total of 1048000/2048= 512 spectra/s should be produced. However we obtain only 96057 spectra in 5 minutes = 320 spectra/s. So the efficiency of our capture and fft program is 320/512 = 0.63 for this sample rate. So when you analyse your measurements you can correct it for the integration time. Other PC based programs do not specify their effiency, or specify GEFY.

What if you get an error message

1-error: no backend available. Reason; libusb-1.0.dll was not copied to the windows system32 folder.

2-error: operation timed out. Reason; Sharp# was not started.

3-error: access denied. Reason; Sharp# was started, but not halted in the right way

4-error: operation timed out. Reason; Sharp# was started, but stopped in the task application manager instead of the processes section.

5-error; ValueError: No backend available. Reason; the windows version msvcr100.dll ( or msvcr90.dll) was not available in the cfrad start-up directory.

6-error; TypeError: 'NoneType' object has no attribute '__getitem__'. Reason; bad/loose usb connection.



Fig.2 - Even a 55x60cm dish can be used for neutral hydrogen detection.


Fig.3 - Measured with a 55x60cm offset dish and python postprocessing.


Fig.4 - 55x60cm dish contour.

Two example data files measured with an 80cm dish can be downloaded from here;



You can postproces this data using python or excel(mind the decimal seperator). You can find more on postprocessing in another project.


Fig.5 - Measured with an 80cm offset dish and python postprocessing.


Fig.6 - Measured with an 80cm offset dish and excel postprocessing (no filtering applied yet).


Fig.7 - measured by Hans Smit with his 3m dish .

More on post processing can be found in another project file

Michiel Klaassen nov-2013