DSPRelated.com
Forums

AGC before FFT in piano frequency analysis

Started by Robert Scott March 3, 2004
 Very tricky area, this. A few observations...
 
 All measurement/analysis methods will stretched to the max.  You may be
 better off trying to recreate the entire 6 secs by software until it
 matches the sound sample file.  You'll need a Cray.
 
 The asymptotic decay itself is amplitude modulation, and will introduce its
 own sidebands around every other component.  The natural sound includes
 these sidebands.  Any ultimate synthesis probably needs to include them.
 
 Because the higher harmonics or partials decay faster, they will have
 different sideband spacing around themselves, complicating the matter.
 
 I have noticed on a CRO the effect of what "should have been" harmonics
 clambering slowly (0.1 - 0.5Hz) over the fundamental waveform as it decayed
 (single string).  I did not think further about it at the time, just
 dismissing it as 'wandering phase relationship'.  The inharmonic partial
 effects referred to are real, audible and measurable.  I still do not know
 what causes it.
 
 An AGC system could have problems with 'pumping' as the sum of the
 fundamental amplitude and the harmonic peaks change as their relative
 phases change.  You may have to isolate the fundamental to derive your AGC
 control value.  This will then iron out the amplitude modulation referred
 to above.
 
 ====================================
 On the subject of tuners, a steady tone might be made by using 2 guitar
 pickups and an amplifier.  Please note I have not done this yet, but I
 expect it would allow analysis to any required accuracy once you are no
 longer constrained by decay.
 
 The 1st pickup acquires the string signal.
 The second pickup (re-wound for a lower impedance so that it will pass a
 useful drive current) is used as a motor coil to drive the string.  I
 expect the amp would not need much power (<1W).
 
  COLI1   AMP    COIL2
           |\
   +-------| >----+
   |       |/     |
   (              )
   (              )
   (              )
   |              |
   0V             0V
 
 The system would be akin to a tuning fork oscillator, using the string as
 the freq-determining element.  The magnets are needed to polarise/bias the
 system to prevent frequency doubling akin to full wave rectification.
 
 The 2 coils will need to be very rigidly clamped to the piano frame to
 prevent acoustic oscillations that are not controlled by the string.  The
 coils will need to be separated/isolated to prevent magnetic coupling. 
 Placing them at opposite ends of the string may be sufficient.
 
 To limit oscillation to the fundamental, you may need to have a descending
 frequency/amplitude response and adjust a gain control to stop gross
 overload.  I will need to think about the importance of phasing.  The thing
 will probably oscillate regardless, but the frequency may be slightly
 pulled be an unknown amount if the system phase is wrong.
 
 Jim Adamthwaite

Jerry Avins wrote:
(snip)

> Relative to its middle ranges, the lowest notes of a piano are about 2% > flat, and the highest, as much sharp. To distinguish about a third of a > semitone is hard. The actual inharmonicity of any one string is likely > to be less than that. If I wanted to measure the natural resonances of > any object -- string, bell, Helmholz resonator -- I imagine that I would > get a better result by rigging up some kind of continuous exciter than > by attempting to analyze an impulse response.
Assuming steel strings that would be easy to do with an iron core electromagnet connected to an oscillator. Maybe even a system that would lock onto the peak of a resonance when set to a nearby frequency. It might be, though, that there are non-linear effects that need to be measured. The tension will change slightly through the vibration cycle, and that would then affect the other modes. (Large-signal model in EE terms.) -- glen
Jerry Avins wrote:

> Passing a current through the string and sensing its motion with a > pick-up coil is another low-noise way to implement part of this. I would > certainly try to excite and measure the partials separately, as you > propose.
If they are steel wires, a coil wrapped around a permanent magnet will do it. This is how electric guitar pickups work. If the wires are not steel then the current through the wire method would be the next one to try. -- glen
robert bristow-johnson wrote:

(snip)

> false or true (whatever that means) a beat is a beat and your model of > closely-spaced frequency components (for a single harmonic) is equivalent to > a single frequency component with a complex (as opposed to "simple") > amplitude envelope. so you won't wanna throw the amplitude information > away.
If you have a signal that has, say Fourier components of 210Hz and 213Hz you will hear a beat frequency at 3Hz. That doesn't mean that there are any 3Hz components in the signal. If that signal goes through a non-linear circuit there will be 3Hz components in the result. Maybe that is related to true or false beats. -- glen
In article HhV3c.4706$mM.60633@attbi_s02, glen herrmannsfeldt at
gah@ugcs.caltech.edu wrote on 03/11/2004 03:18:

> robert bristow-johnson wrote: > > (snip) > >> false or true (whatever that means) a beat is a beat and your model of >> closely-spaced frequency components (for a single harmonic) is equivalent to >> a single frequency component with a complex (as opposed to "simple") >> amplitude envelope. so you won't wanna throw the amplitude information >> away. > > If you have a signal that has, say Fourier components of 210Hz > and 213Hz you will hear a beat frequency at 3Hz. That doesn't > mean that there are any 3Hz components in the signal.
but how about a 3 Hz component to the envelope of the 211.5 Hz component? (assuming that the amplitude of the 210 and 213 are about the same. if they are not, then it's different, but there would still be, from the POV of a 15 ms window, a single component somewhere between 210 and 213, and it would have a slowly varying amplitude.)
> If that signal goes through a non-linear circuit there will > be 3Hz components in the result.
there could be.
> Maybe that is related to true or false beats.
i would call it a true beat in both cases. r b-j
In article <HhV3c.4706$mM.60633@attbi_s02>,
glen herrmannsfeldt  <gah@ugcs.caltech.edu> wrote:
>robert bristow-johnson wrote: >> false or true (whatever that means) a beat is a beat and your model of >> closely-spaced frequency components (for a single harmonic) is equivalent to >> a single frequency component with a complex (as opposed to "simple") >> amplitude envelope. so you won't wanna throw the amplitude information >> away. > >If you have a signal that has, say Fourier components of 210Hz >and 213Hz you will hear a beat frequency at 3Hz. That doesn't >mean that there are any 3Hz components in the signal. > >If that signal goes through a non-linear circuit there will >be 3Hz components in the result. > >Maybe that is related to true or false beats.
The human ear is a pretty non-linear circuit component and will most probably hear a 3Hz modulation of a single tone between G# and A. However the Fourier spectrum over a long enough time interval will show something different (2 separate frequencies, neither of which is 3 Hz). IMHO. YMMV. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ #include <canonical.disclaimer> // only my own opinions, etc.
In article <45ks409hvl6id440h70tl5rd2agf2l6csl@4ax.com>,
Tony  <tony_roe@tpg.com.au> wrote:
>On Tue, 09 Mar 2004 18:44:01 GMT, no-one@dont-mail-me.com (Robert Scott) wrote: >>>> I am not interested in the amplitudes of the harmonics at all. I am >>>> only interested in their frequencies. Due to the stiffness of the >>>> piano wire, the harmonics are not really harmonics, but are >>>> near-harmonic frequencies called partials. > >Just in case you haven't already been there, the Reyburn Cyber Tuner (RCT) >claims to have all this down pat - looks like an excellent tool..
Not of much use to Mr. Scott, because Reyburn and Scott appear to be competitors in the same piano tuning business. http://www.tunelab-world.com/ http://www.reyburn.com/ (And I'm just small potatoes as a developer of a guitar tuner for PalmOS http://www.aerodrome.us/index.html#products ) IMHO. YMMV. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/palm #include <canonical.disclaimer> // only my own opinions, etc.
In article <c2jsi4$113$04$1@news.t-online.com>,
Wolfgang <never@nowhere.com> wrote:
>Despite the fact that AGC changes freq. content a little bit I want to >point out that mostly the "tone" of an instrument is not constant over >playing it. >Some years ago I wanted to write a note recognition system for a guitar >and I found out that the harmonic content is dramatically changing over >time. Nevertheless you don't look at harmonics also your content of interest >may change over time.
I've also done some analysis of guitar sound and found that not only does the harmonic content of a plucked string change over time, but that the fundamental pitch can change between the attack and decay portions of the waveform, especially true of the lowest notes on a bass guitar with their larger strings. Makes it an interesting question to decide when an instrument is "in tune"... I wonder is the low notes of some pianos may have the same behavior? Or is it an effect caused by "pluck" versus "hammer". IMHO. YMMV. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ #include <canonical.disclaimer> // only my own opinions, etc.
Ronald H. Nicholson Jr. wrote:

> In article <c2jsi4$113$04$1@news.t-online.com>, > Wolfgang <never@nowhere.com> wrote: > >>Despite the fact that AGC changes freq. content a little bit I want to >>point out that mostly the "tone" of an instrument is not constant over >>playing it. >>Some years ago I wanted to write a note recognition system for a guitar >>and I found out that the harmonic content is dramatically changing over >>time. Nevertheless you don't look at harmonics also your content of interest >>may change over time. > > > I've also done some analysis of guitar sound and found that not only does > the harmonic content of a plucked string change over time, but that the > fundamental pitch can change between the attack and decay portions of > the waveform, especially true of the lowest notes on a bass guitar with > their larger strings. > > Makes it an interesting question to decide when an instrument is > "in tune"... > > I wonder is the low notes of some pianos may have the same behavior? > Or is it an effect caused by "pluck" versus "hammer". > > > IMHO. YMMV.
The average tension of a string must be lower when it's at rest than when it's vibrating vigorously. There must be an affect from that, but I've not seen a systematic treatment. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
In article <BC7361EB.940E%rbj@surfglobal.net>,
robert bristow-johnson  <rbj@surfglobal.net> wrote:
>you got some of this down right. you might want to go to the >harmony-central.com site and check this out: > >> http://www.harmony-central.com/Synth/Articles/Wavetable_101/Wavetable-101.pdf > >if you can make a pretty good pitch detector (that is really a period >estimator), you can measure the change of phase of each harmonic and use >that to compute how much each one is detuned from the exact harmonic value.
How accurate is "pretty good"? The specsmanship in the electronic guitar tuner business is usually in the range of 1 to 5 cents accuracy (corresponding to about +-0.2 to 1 Hz at 330 Hz). In the professional electronic piano tuner business, I've been told they spec frequency standards to 0.1 cents accuracy (+-0.02 Hz at 330 Hz). I have no idea if 0.1 cent of frequency difference is audible to humans. It's certainly near the limit of the cheap non-temperature compensated crystal oscillators used on most PC's and DSP boards. * a "cent" being defined as the ratio pow(2.0, (1.0/1200.0)) IMHO. YMMV. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ #include <canonical.disclaimer> // only my own opinions, etc.