Hello, Frank —

I tentatively ask what the "value under the curve would be" up to this
> zero-crossing.  If the value is close enough to zero, then I treat the
> difference between this interpolated crossing and the first as a candidate
> wavelength.
>

If you're doing this, you certainly want to do some kind of high-pass
filter to remove low frequencies from your signal.  Over a sufficiently
short interval of time, low tones look like DC and they'll offset your
integral.

I would caution you against setting your ambitions too high with a design
based on zero-crossings.  That technique might work well enough within
certain parameters (high SNR, low harmonic brightness) but you'll quickly
run into a need for more sophistication if you are attempting to implement
a more general-purpose pitch analyzer.  (Alternative techniques worthy of
note include autocorrelation, cepstrums and adaptive filters.)

However when run on the Hammond recording, it's detecting a wavelength of
> perhaps 0.7 cent off.  And this probably accounts for an entire wall of
> ghost frequencies to be detected as well.
>

Any noise in your signal can potentially offset the signal near your
zero-crossing, pushing that crossing forward or backward in time.  This
problem worsens with the level of noise in the signal, especially if the
tone is dark.  Suppressing the noise requires an estimate of the pitch,
creating something of a chicken-and-egg problem — but you can refine an
estimate over time.

– Evan Balster
creator of imitone <http://imitone.com>


On Tue, Jan 1, 2019 at 6:48 PM Frank Sheeran <fshee...@gmail.com> wrote:

> Summary
>
> I'm having trouble identifying exact frequencies in what should be an
> extremely easy-to-process WAV file, as  a first step to doing a harmonic
> analysis with a Fourier transform.
>
>
>
> Details of Project
>
> I have a file which contains a second's worth of sound of each of the 91
> tonewheels of  a Hammond B-3 organ in order.  (Hammonds have spinning disks
> whose edge is fluted in a shape of a desired output sound wave.  This spins
> in front of a mechanical pickup, which converts that undulating edge into
> an electronic signal.)
>
> I want to do a harmonic analysis of each disk in turn.
>
> Given the volume of example sounds, I'm hoping for the utility program
> doing this analysis to be as automated as possible.  I see the first
> project as a first step towards a utility that will let me conveniently
> analyze other sounds as well going forward, such as guitar notes.
>
>
>
> Current Status
>
> I'm properly detecting the notes' start and end, with a heuristic of
> looking for a running string of individual samples less than some
> threshold.  By experimentation, length and threshold values that work were
> obtained.
>
> Since the Hammond sounds don't change from beginning to end, except for
> some instability at the start and finish, I'm taking the middle 80% of each
> detected note.
>
> I'm currently then scanning that range for an upwards zero-crossing.  I
> linear-interpolate that starting value, so that if say sample 100 is -.04
> and 100 is +.01, I assume the waveform starts at 100.8.
>
> I then keep a running "value under the curve", manually
> piecewise-integrating the waveform, as I scan forward for more upwards
> zero-crossings.
>
> For each subsequent upwards zero-crossing, I again linear-interpolate a
> fractional sample value.  This is possibly the end of the waveform.  I
> tentatively ask what the "value under the curve would be" up to this
> zero-crossing.  If the value is close enough to zero, then I treat the
> difference between this interpolated crossing and the first as a candidate
> wavelength.
>
> When run on test tones I compose of sine waves at various harmonics, the
> method succeed to 5-6 decimal places.  The resulting harmonic analysis
> gives the proper strengths of the Harmonics I put in, and detects the other
> harmonics at values of -90dB or so.  When allowed to continue on and detect
> a candidate wavelength in fact twice the actual, the noise floor drops to
> -195dB.  Three wavelengths
>
> However when run on the Hammond recording, it's detecting a wavelength of
> perhaps 0.7 cent off.  And this probably accounts for an entire wall of
> ghost frequencies to be detected as well.
>
> SO........ Am I going about this totally wrong?  Is there a different and
> better approach to use?  Or do I just need to keep tweaking, such as adding
> a DC filter, an 60Hz AC hum filter (I see some in an FFT at maybe -95dB),
> additionally using a low-pass filter before the pitch-detection stage but
> don't use once I've detected a wavelength, and so on?  One idea I have is
> that I should use the detected wavelength to select the closest known
> wavelength (I know the exact frequency of each wheel) but to do so would
> make the utility program less general-purpose.
>
> Best regards,
> Frank Sheeran
>
> _______________________________________________
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Reply via email to