Creating formula from musical bar test population

Click For Summary

Discussion Overview

The discussion revolves around the creation of a musical device using stainless steel bars, focusing on how to derive a formula that relates the pitch of the bars to their lengths. Participants explore statistical tools for curve fitting based on experimental data, while also addressing the complexities of perceived pitch versus actual frequency in musical tuning.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning
  • Experimental/applied

Main Points Raised

  • One participant describes their process of testing 50 stainless steel bars of the same length but varying widths, using a tone analyzer to measure pitch and seeking to fit a curve to the data.
  • Another participant suggests that the relationship between frequency and length could be modeled by the equation $$L = \frac{A}{\sqrt f}$$, noting a slight deviation in the exponent from expected values.
  • A question is raised about whether the tone analyzer provides information on harmonics, indicating a potential limitation in the data collected.
  • Concerns are expressed about the accuracy of pitch measurements, particularly at higher frequencies, and the potential for errors in curve fitting methods.
  • Discussion includes the idea that perceived pitch does not always align with measured frequency, particularly across the range of an instrument, and mentions historical tuning practices such as "German tuning."
  • Participants discuss the need for a temperament in tuning, with various temperaments mentioned, and the implications of perceived pitch on tuning adjustments.
  • One participant suggests that comparing pitches with a tone generator requires specific frequencies and acknowledges the complexity of achieving a desired temperament.
  • Another participant proposes plotting errors between measured and theoretical frequencies to refine the curve fitting process, suggesting that polynomial fits might be more appropriate than power laws.
  • Practical tuning methods are discussed, including adjusting the thickness of the bars to raise or lower pitch after cutting.

Areas of Agreement / Disagreement

Participants express differing views on the relationship between perceived pitch and actual frequency, as well as the necessity of a specific temperament for tuning. There is no consensus on the best statistical tools or methods for curve fitting, and the discussion remains unresolved regarding the optimal approach to achieve accurate pitch measurements.

Contextual Notes

Limitations include potential errors in the initial data collection, the dependence on the specific tone analyzer used, and the unresolved nature of how perceived pitch affects tuning across different temperaments.

preston8
Messages
18
Reaction score
0
Hello,

I'm creating a musical device which has stainless steel bars cut with a laser cutter. They are all the same length but vary in width. I created a set of test lengths (50 in total) and tested the pitch of each one using a tone analyzer. Now I'm looking to fit a curve to the data so that I can put in any pitch I want and get a length that the bar needs to be to achieve that pitch.

I know that the equation I generate won't be spot-on, but I would like to get as close as possible.

Here's the test data for each bar:
bars_zpsdddfe05a.png


I mapped a "power" curve to the data set:
graph_zps7012f1d8.png


The curve yielded these results, but there is a significant error in the higher pitches:
results_zps877caa5e.png


I'm wondering what types of statistical tools I can use to perhaps reduce the error in the calculations.

-P
 
Physics news on Phys.org
If the data is basically transverse vibrations of beams, you would expect the frequencies and lengths to be related by
$$L = \frac{A}{\sqrt f}$$
and your fitted curve is close to that (the exponent is -0.505 not -0.5).

I don't understand what you did to get your final table. Presumably you started from the "desired pitch" and got the "Estim length" somehow, and then converted that length to the "Hz" value using a different formula. But you have only showed us one formula, on your chart ... :confused:
 
Does your tone analyzer show the frequencies of the harmonics?
 
@AlphaZero:
I actually used the formula you posted to derive the lengths for my initial set. I found that the lower pitch bars were spot-on, but pitch error became more pronounced as I tested higher pitched bars. I was hoping that by using a curve fit, I could get even more accurate.

I apologize for not showing the source of the data in the last photo. I plotted Pitch vs. Time instead of Time Vs. Pitch and created another power curve fit. I reversed the data to see what the result would be. This may be erroneous and not a good method of prediction.
reverse_zpse83558b3.png


@bahamagreen:
My tone analyzer only shows the fundamental.
 
If your intent is to produce a musical instrument, you should know that perceived pitch and actual measured frequency are not going to match across the whole range of the instrument. The lower "correct" frequencies are going to sound sharp and the "correct" higher frequencies are going to sound flat. A few moments with a tone generator that shows frequency will demonstrate this immediately - that frequency doubling and halving does not result in what sounds like octaves.

Tuning for pianos, for example, compensates for this by tuning the low strings a little flatter than the frequency figure would suggset, and likewise tunes the higher notes progessively sharper than the frquency would suggest. Do a search on "German tuning" to find out more.

If you create your instrument to produce perfect frequencies where each octave is an exact doubling of frequency, the result will be pretty unusable and unlistenable. Also, you will need to choose a temperament for the instrument.
 
@bahamagreen

Are there devices that can identify the "perceived" pitch of my bars instead of the "correct" pitch? Or is this something that is done by ear? My particular device only shows the true pitch.
 
By ear... do you hear the pitches of the metal bars when you strike them?
 
I'm probably not the best person to perform the tuning. So, I would need to strike every bar, compare it with a tone generator, and tune the bars in the same session?

I'm confused why a temperment is needed when we're just going to change the pitches based on what sounds correct. Based on a particular temperment, can't I follow the rules for the temperment or do I need to do the perceived tuning as well?
 
Comparing the pitches with a tone generator won't tell you how to adjust the pitches to tune unless you use specific frequencies from the tone generator... and those are going to be some temperament.

The choice of temperament is going to determine how the result is going to sound... the idea of "what sounds correct" is really the whole problem. Some make the fifth intervals sound better, some make the thirds sound better, some only sound good when restricting the key signatures played, or restricting the harmonies employed.

Historically, there have been dozens of temperaments, but the main ones in Western music have been these:

Pythagorean tuning
Quarter-comma meantone temperament
Syntonic-diatonic just intonation
Well temperaments
Equal temperament

If you look at the Wikipedia page "Musical temperament", you can find out more and jump to specific temperaments you might want to consider - you will find frequencies and ratios of frequencies used to build them, but the relationship of temperament to the shifting of perceived pitch approaching the extremes of frequency range is a further complication.

In practice, the temperament maps to the perceived pitches, not the frequencies. Yet, most of the analysis of temperaments is done with frequency ratios as if the perceived shift doesn't exist... some of the temperament schemes involve multiple octaves in the frequency construction process, so the perceived shift may be confounded with the various "problems" associated with some of them.

What might be very helpful when you are doing your final tuning is to have a musician friend help out in the last stages. You need to have a methodology that includes recognizing when the temperament you select is achieved. For example, if just try it by ear you will naturally attempt the Pythagorean temperament because it is based on the harmonic series and is pleasant to the ear. But if you try to fine tune it for different tonal centers (key signatures), you will find that corrections are needed every time you switch to another key, and you will go round and round trimming the bars futilely until the whole thing is messed up beyond recovery.
 
  • #10
preston8 said:
I actually used the formula you posted to derive the lengths for my initial set. I found that the lower pitch bars were spot-on, but pitch error became more pronounced as I tested higher pitched bars. I was hoping that by using a curve fit, I could get even more accurate.

I apologize for not showing the source of the data in the last photo. I plotted Pitch vs. Time instead of Time Vs. Pitch and created another power curve fit. I reversed the data to see what the result would be. This may be erroneous and not a good method of prediction.

If the data points were exactly on the curve, the two equations you got would be mathematically equivalent. if ##y = ax^b##, then ##x = (1/a)^{1/b}y^{1/b}##.

But your points don't lie exactly on the curve, so when you fitted the two curves you got slightly different results.

There is no obvious reason why the measured data should fit a curve of the form ##y = ax^b## exactly, with b slightly different from = -0.5. If you want to correct the lengths of your bars, it might be better to actually plot the errors, for example plot (measured freq - theoretical freq) against measured freq or maybe ((measured - theoretical)/measured) against measured. Then fit a curve to that graph - not necessarily a power law, maybe a polynomial will fit better.

Then, to get the "real world" frequency you want, you would find the theoretical frequency from that curve, and then the length from your theoretical ##A/\sqrt f## formula.

Note, you can also tune these type of bars after you have cut them. If you make the middle of the bar slightly thinner by filing away some material, you will lower the pitch. If you make the ends slightly thinner, you will raise it. That might be a more practical way to make the final adjustments than by trying to cut the exact "correct" length.
 
  • #11
Thank you for clearing this up and providing additional information that I was not aware of.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
4K
  • · Replies 6 ·
Replies
6
Views
8K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 9 ·
Replies
9
Views
3K