This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Measurement of the resonance curve (Acoustics)
#1
Sad 
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.


Attached Files Thumbnail(s)
       

.phyphox   Resonance 2(3).phyphox (Size: 116.61 KB / Downloads: 803)
Reply
#2
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).
Reply
#3
Sebastian, thanks for very fast answer!

I will try to use your suggestions.
Reply
#4
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...


Attached Files Thumbnail(s)
   

.phyphox   Resonance 2.1(4).phyphox (Size: 116.65 KB / Downloads: 644)
Reply
#5
That's weird. What browser are you using? I just tried and could set it without trouble.
Reply
#6
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
Reply
#7
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.
Reply
#8
Hello !

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

Thank you !
Reply
#9
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.
Reply
#10
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 !


Attached Files Thumbnail(s)
   
Reply


Forum Jump: