Page 1 of 1

Example Audio Files

Posted: 26 Dec 2023, 04:18
by NuclearPhoenix
Hi guys,

what are the common audio formats for saving the data from spectrometers?
For example, when you take the audio inputs from the GS-Pro in PRA.
Can you please attach some example files and maybe also the spectrum that would result from the file?

I'm currently looking into how to process audio and I'll need some references to get started, so thanks.

Re: Example Audio Files

Posted: 27 Dec 2023, 09:24
by Sesselmann
Matthias,

The audio format we use to record the sound of our scintillation detectors is just your common .wav format, but typically we don't store the file in that format. PRA which was the first program to have decent resolution stores the file as a .pls, which is a format Marek invented. But as you know I now save the files in your JSON scheme.

Regular .wav sound files typically save left and right channels as a 48 kHz stream into a buffer which then writes the whole thing in a binary array, but once you open and read the file it is essentially an array where left and right channel is written as every second number, so when we are reading the stream we usually just read the left channel (unless we are doing coincidence counting).

Once you pull out the left channel, all you get is the sound, a stream of numbers representing the voltage from the line in left channel.

All the filtering and pulse height processing is done on the PC, but it's not as simple as just picking the height of the pulse peaks, this naive approach was tried by many and it doesn't work very well, it produces a useless spectrum.

Theory says that for a given hardware setup, the pulse shape is invariant, that means the pulse height may vary but the overall shape of the pulse is close to constant.

So we obtain a mean "shape" by sampling a bunch of pulses normalising, summing and taking the mean. This mean shape file is a simple list of n samples which sum to zero.

Now we square all the samples in the shape file and take the mean to get a large positive number which in itself has no real meaning, but it is useful as we will later use this number to filter the pulses.

Now we stream the audio, pick the pulse, normalise, square, sum and divide each one in real time so we can compare the shape number with our mean sample, and the shape number falls outside the tolerance we reject the pulse.

Then it is just a matter of taking the pulse height of the accepted normalised samples by sample(max) - sample(min) and binning it into a histogram.

Steven

Re: Example Audio Files

Posted: 27 Dec 2023, 09:47
by NuclearPhoenix
Steven,

I know that it's not the usual way to go and also thanks for the additional info. I'm sure your reference and then the PRA manual are enough to get a good idea on what to give a try to succeed eventually.

However, since I don't have a soundcard spectrometer (yet) and still want to give this a try, I need some example files that I can load into my program and compare the output to a known good spectrum. At least this way I can look at the audio processing first without going into actually getting a soundcard testing jig and worrying about microphone input for now.

Matthias