phyphox Forums

Full Version: Acoustics
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, 
I would like to know more about the programming logic behind the Audio Spectrum Experiment!
It's for a project from Electrical Engineering's Department of my University.
The FFT Fast Fourier Transform was used, right? To do the measures of the sound recorded with the microphone.  
How the audio was recorded in blocks (to be analised later)?

Thank You.
Well, if you want to know every detail, you can have a look at the source (https://phyphox.org/source/) and especially the definition of the audio spectrum experiment (https://github.com/Staacks/phyphox-exper...um.phyphox). You could also load it in our editor (https://phyphox.org/editor), but since the original experiments were not created with the new editor, the initial layout will be random and hard to read.

That being said, I know that it will be hard to get everything from source, especially since the logic of the experiment is defined in our own file format and interpreted by the app, so I will try to answer some of your questions directly.

When an experiment configuration uses data from the microphone, phyphox will record data from the microphone into a buffer of finite size. Phyphox executes the analysis steps defined in our file format periodically (you might want to have a look at the intro for the editor to understand the principles of our file format: https://phyphox.org/wiki/index.php?title...is_modules) and each time this happens, the recorded data is taken from the buffer. Also, if the buffer overflows, old data is simply replaced.

The Audio Spectrum Experiment sets the analysis interval large enough, so that the buffer always gathers at least as many new data points as defined by the user under "settings" (this also means that some data will almost certainly be dropped). The buffer is then cut down to the desired size and then fed into our FFT module (we do not apply any windowing function aside from the unavoidable rectangular window).