Pulsar folding with sound

To explain to my girlfriend and our children some more about pulsars, I decided to take our captured data and add a visual and audio interpretation of the pulsar.
From the period data 100 to 545 (fig1) we took the short range 100 to 200 periods; fig 2.


Fig.1 - Multiplot-100-545.


Fig.2 - Multiplot-100-200.

Next we selected periods 100 to 200 of the datastream and folded/added it in real time every period. You can see in the video that the pulse is rising from the noise. At thesame time the peak above a certain level will generate a tone. This tone can also be so low in frequency that it gives the 'thumb' sound of a pulsar. The background sound can be set to a loud noise sound level or it can be set to attenuate completely.
The total presentation time is 100 periods of the B0329+54 pulsar, so about a minute.

Configuration is done with the Ap.cfg file; it contains the following:

0.------pulsar audio folding------------
1.pulsar name = B0329 SGRT
2.pulsar period time [s]=0.71463071463
3.spectrum file name without extension=z-100bt
4.fold period from =105
5.fold period to =200 pulse squelch level (0..1)=0.998 noise volume (0..1)=0.1
8.graph select (0:off, 1 or 2 or 3(both))=1

On item nr 8;
Select 1 to see only the stacked pulsar profile.
Select 2 to see only each period profile.
Select 3 to see both.
If the pulsar is fast; like Vela, Then the graphs give too much delay. You can turn the graphs off by selecting "0", and only hear the audio.The final result graphs will show at the end

The tones were generated with an online tool from
Also we ripped sound from a youtube track with Audacity.

We used the python pygame modules to handle the sounds. To run the python script yourself you need pygame installed; see

More specific info:
The data captured in this session had a lot of RFI (Radio Frequency Interference ). Later we could trace that back to the LAN (Local Area Network) cables.
The source period files or spectrum files were generated by the 3pt-calc.exe program. Each file consists of a number of spectra for each bin range and one sum spectrum bin range. The sum of the spectra is also available in the sum bins (nr 10 or nr 20). The latest 3pt calc program splits the spectrum from 10 into 20 parts.
This audio script is loading the successive period files and scans the bins for the maximum value. Next it scans again to flag every bin with an amplitude higher than the squelch level. This flagged bin will generate an audio tone.
In the right side monitor window of 'spider' you can see info of each period.
The first value is the period number (from 100 to 200).
The second value is the bin number of the maximum found amplitude. In the beginning the bin numbers vay, but later, from period 130, the bin number is the stable number 65.
The third value is the period time of the audio period.
The horizontal line is the squelch level; noise can be heard when the amplitude rises above this level.

The video can be seen here
pulsar-folding-and-sound 1.mp4  

A second video shows thesame folding, but now the individual periods are also shown in red.
The amplitude of the individual period is actually 4 times larger, but in the graph reduced for clearity.
pulsar-folding-and-sound 2.mp4  

We could bring down the size of the Windows executable from 1GB to 35MB.
A method was found here;

Step-by-Step method by Rangsiman Ketkaew:

1. Create new conda environment:
conda create -n NAME_OF_NEW_ENV

2. Install pip using conda:
conda install pip

3. Install other packages that your application requires using pip, for example:
pip install numpy
pip install matplotlib

4. Use conda or pip to show all packages installed in environment:
conda list
pip list

5. Install PyInstaller using pip
pip install pyinstaller

6. Now you are ready to make executable file from Python source code using PyInstaller:
pyinstaller --onefile
After closure; re-enter your virtual environment by 'conda astivate NAME'

Together with the period files generated by 3pt.exe, the Ap.cfg, and the .wav files, etc; are compressed in a zip file here  
To use it; unzip in a folder and run pa22.exe.
A window shows information, and while running, the period number, the bin number, and the period time are displayed.
Via the config file Ap.cfg other parameters can be set.
This version of the program pa22.exe runs ok in Windows-10 64 bit.

Michiel Klaassen Januari 2022