phyphox Forums
Measurement of the resonance curve (Acoustics) - Printable Version

+- phyphox Forums (https://phyphox.org/forums)
+-- Forum: Discussion (https://phyphox.org/forums/forumdisplay.php?fid=1)
+--- Forum: Experiments and Ideas (https://phyphox.org/forums/forumdisplay.php?fid=4)
+--- Thread: Measurement of the resonance curve (Acoustics) (/showthread.php?tid=460)

Pages: 1 2 3 4 5 6 7


Measurement of the resonance curve (Acoustics) - solid - 11-03-2019

The idea is to measure the acoustic resonance curve of a Helmholtz resonator.
The frequency of the output signal from an earphone put directly into the resonator (see figure) should be sweep between two values and the sound intensity should be measured by a microphone (also put to the resonator).
I did not find how to sweep the frequency by itself and realized a code using the phyphox editor (‘Resonance 2(3).phyphox’) with the time t taken from the timer module and a calculation of the frequency via f = f_start + df*t…
The realized program has two fails:
1. The peak position is delayed by some Hz (a problem of the synchronization of the sound reading and generation).
2. At the peak there is an instability of the registered sound intensity.


Remarks:
1. For the phyphox code I was inspired by the given phyphox experiments.
2. I find that my problem is similar to a problem given in the forum in German: ‘Frequenzgang eines Lautsprechers messen’.


Attached:
1. Phyphox code.
2. Obtained screen.
3. Photo of the experiment.


RE: Measurement of the resonance curve (Acoustics) - Sebastian Staacks - 11-03-2019

Very cool, thanks for sharing.

At the moment, the tone generator in fact needs to be reused like you did. The problem is that phyphox currently only supports playing back a sound wave that has been calculated by the analysis modules of the experiments. This is slow, requires pre-calculation (an analysis run) before playback and has plenty of problems if the frequency does not perfectly match into the playback period. We are planing on adding a parametric sound generator output, so you just need to send the parameters of the tone to an output and phyphox will process everything in the background, which should be faster and independent of a buffer period.

Because of the current limitations, there is one thing that you could change which might help with your problems:
At the moment, you have set the "sleep" attribute of your analysis block (found on the main tab) to zero, which means that in theory a new audio snipped will be calculated as fast as possible and that the analysis is not waiting for the audio buffer to be actually filled. Therefore, depending on the phone (this can differ heavily between different systems due to different minimum recording buffers and processing speed), you might have one or multiple of the following problems:
- Your analyzed recording might contain multiple frequencies
- Your frequencies might change extremely fast with crackling sounds since there is no control over phase changes or gaps between playbacks.
- The analysis process might run a few times with an empty buffer before running with a rather well-filled buffer.

So, setting sleep to a value of 0.2 "might" solve these problems and your experiment should run almost identically, with the only difference that you get "only" about 5 values per second, which is probably plenty (not sure about your requirements, though).


RE: Measurement of the resonance curve (Acoustics) - solid - 11-04-2019

Sebastian, thanks for very fast answer!

I will try to use your suggestions.


RE: Measurement of the resonance curve (Acoustics) - solid - 11-04-2019

I have added "sleep" for the program and "loop" for the sound generation. The result is perfect (see attached the ecran capture).

Unfortunately I was not allowed to give "sleep" less than 1 second (while 0.2 s was recommended) and the measurements are somewhat too slow...


RE: Measurement of the resonance curve (Acoustics) - Sebastian Staacks - 11-04-2019

That's weird. What browser are you using? I just tried and could set it without trouble.


RE: Measurement of the resonance curve (Acoustics) - solid - 11-05-2019

I am using Firefox. When I try "sleep" less than 1 s the field for it becomes red and the value returns to 1s...

I GOT IT! The decimal comma is used. Sorry.. )) 0,2 s is too nosy, 0,5 s OK


RE: Measurement of the resonance curve (Acoustics) - Sebastian Staacks - 11-05-2019

Hm. Did not expect that. On my German system it only accepts the decimal point but not the comma (which I would prefer as the page is using English and therefore turns it into a decimal point anyway). Am I assuming correctly that your system is set to French? I have to test this...

Anyways, I am glad that this solved your problem.


RE: Measurement of the resonance curve (Acoustics) - julien - 01-03-2020

Hello !

Is it possible to create a QR-code to share this nice experiment easily ?

Thank you !


RE: Measurement of the resonance curve (Acoustics) - Sebastian Staacks - 01-03-2020

Sure. We have a script that automatically adds a menu for links to phyphox file which allows generating a qr code. This did not work for forum attachments, but I have now updated it. So, if you now click on the attachments, it should give you the option to generate a QR code.


RE: Measurement of the resonance curve (Acoustics) - julien - 01-03-2020

Thank you Sebastian !

I think there is a problem, when i try to scan the qr-code, phyphox returns an error message. It says that phyphox can't recognize a proper phyphox experiment...

i have created one with the editor. It seems ok. 

I should have thought about it earlier !