Just wanted to say thanks for the responses; especially from Gerry.
@Gerry: I think your comments about correlation have pushed me in the
right direction.
On 5/12/2011 8:49 PM, Gerry Beauregard wrote:
Hi Anthony,
For pitch analysis, what technique to use depends a lot on the specific
application and the expected signal.
Some considerations... Is the input monophonic (e.g. one singing voice or
single pitched instrument) or polyphonic (piano, orchestra, etc.)? Does the
pitch analysis need to happen in real-time (i.e. from a live source), or can it
be done in a batch/non-real-time fashion (from a recording)? What frequency
and time resolution do you need? How computationally-intensive can it be?
Counting zero crossings is simple and efficient, but I wouldn't recommend it.
It'll work fine on sine tones, but on signals with any significant energy at
harmonics above the fundamental (i.e. virtually any real-world sound), it'll
tend to give you pitch estimates that are multiples of the actual pitch.
Low-pass filtering the input can alleviate that problem a bit.
Personally I've found that for most monophonic signals, auto-correlation-based
methods work best. I can send you a well-commented C++ example that I coded up
a while ago.
For polyphonic pitch-detection, spectral-based methods are the way to go.
Typically the first stage of these is a windowed FFT, though some folks use
wavelet or constant-Q transforms instead. I have a decent AS3 FFT here:
http://gerrybeauregard.wordpress.com/2010/08/03/an-even-faster-as3-fft/
Even for monophonic sources, if the fundamental is substantially stronger than
the other harmonics, simply using the biggest spectral peak may work. My AS3
spectrum analyzer project would be a good place to start if you want to try
this approach. Code is here:
http://gerrybeauregard.wordpress.com/2010/08/06/real-time-spectrum-analysis/
Live version here:
http://www.audiostretch.com/spectrum/
BTW, are you working on a commercial project? If so, I'd be happy to do some
consulting/contracting work! ;-)
Cheers,
Gerry Beauregard
g.beaureg...@ieee.org
On 2011-05-12 , at 04:12 , Anthony Pace wrote:
Hello list,
I have been doing some experiments, but although my stuff is working, it isn't
optimized at all, and I would to try a reliable lib that uses zero crossings
for analysis, if one exists.
Any suggestions?
I am really just interested in pitch analysis with very small sample chunks.
Timber is not really necessary, so I, with my limited DSP knowledge, think the
FFT is overkill; however, I absolutely admit I could be wrong and not seeing
something important.
Another thing is that I was thinking a good/cheap way to get rid of some low
level background noise would be to normalize all values within the time domain
with a very high gain factor, and just give max and min values for the zero
crossings( e.g +3, -3 respectively... I know the numbers would obviously not be
these ones). I know know frequency analysis would have to be preformed in
order to remove a voice, but I am thinking that this could allow me to zero
out/ignore, really low level/really high level background noise. Should I try
something different?
Again, I have just started reading through a copy of 'DSP: a computer science
perspective', that someone gave me, and it seems like what I am talking about
would work; yet, if not, and you have experience with signals analysis, I would
appreciate the heads up.
Thank you,
Anthony
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders