Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform

Sponsor

Evaluate multicore with Texas Instruments:
Low-cost evaluation module & free software development kit available NOW.

Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Comp.DSP | Most accurate method of fundamental frequency determination ?

There are 43 messages in this thread.

You are currently looking at messages 0 to 10.


Most accurate method of fundamental frequency determination ? - jwes - 2005-10-27 20:45:00

   I am looking for a very accurate method for fundamental frequency
determination. There is no realtime requirements. The input will be
high quality single note musical instrument samples. The desired output
is an estimate of frequency every few milliseconds for the length of
the sample. I have  "A high resolution fundamental frequency
determination based on phase changes in the Fourier transform" by
Judith Brown, but before I start implementing it, I would like to know
if there is open source code for this, or if there is a better method.

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Most accurate method of fundamental frequency determination ? - robert bristow-johnson - 2005-10-27 20:58:00



in article 1...@z14g2000cwz.googlegroups.com, jwes at
j...@gmail.com wrote on 10/27/2005 20:45:

> I am looking for a very accurate method for fundamental frequency
> determination. There is no realtime requirements. The input will be
> high quality single note musical instrument samples. The desired output
> is an estimate of frequency every few milliseconds for the length of
> the sample. I have  "A high resolution fundamental frequency
> determination based on phase changes in the Fourier transform" by
> Judith Brown,

i don't think i have that one.  can you tell me where to find it on the web?


-- 

r b-j                  r...@audioimagination.com

"Imagination is more important than knowledge."


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Most accurate method of fundamental frequency determination ? - Joerg - 2005-10-27 21:43:00

Hello,

>    I am looking for a very accurate method for fundamental frequency
> determination. There is no realtime requirements. The input will be
> high quality single note musical instrument samples. The desired output
> is an estimate of frequency every few milliseconds for the length of
> the sample. I have  "A high resolution fundamental frequency
> determination based on phase changes in the Fourier transform" by
> Judith Brown, but before I start implementing it, I would like to know
> if there is open source code for this, or if there is a better method.
> 

The way that is often done in the RF world is by timing the zero 
crossings. However, this requires a really pure signal with a good SNR 
which could be achieved by proper filtering before the zero crosser.

If you roughly know the expected frequency: Phase change of the input 
signal versus a stored pattern would also give you a clear measure to 
which side the input frequency deviates and by how much. Look under "FM 
detection". For really, really stringent accuracy check the geologist's 
methods. They have to measure down to milli-Hertz deviations. I have a 
book but it won't help you unless you can read German (by Dr.Burkhard 
Buttkus, no idea if it was ever translated).

Then there is, of course, the brute force method to run a very high 
resolution FFT and interpolate between the output bins. But this can 
burn a lot of processor MIPS.

Regards, Joerg

http://www.analogconsultants.com
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Most accurate method of fundamental frequency determination ? - rhnlogic@yahoo.com - 2005-10-28 01:40:00

jwes wrote:
> I am looking for a very accurate method for fundamental frequency
> determination. There is no realtime requirements. The input will be
> high quality single note musical instrument samples. The desired output
> is an estimate of frequency every few milliseconds for the length of
> the sample.

The problem is defining exactly what you mean by "fundamental
frequency".  The wrong definition might produce a result slightly
sharp or flat or even octaves different from what a human would
report as the pitch of the note.  The definition might even change
for different types of musical instruments and in different listening
situations.

Note that a few milliseconds of a note produced by  the lowest strings
of a bass guitar or piano contains less than one full cycle.

> I have  "A high resolution fundamental frequency
> determination based on phase changes in the Fourier transform" by
> Judith Brown, but before I start implementing it, I would like to know
> if there is open source code for this, or if there is a better method.

Her method looks similar to, and perhaps more computationally
efficient than, using phase vocoder analysis techniques to measure
frequencies between FFT bins.  There is public code available for
phase vocoders; but you can easily see how this technique works
by observing the phase changes in the results from successive
complex FFTs at known sample offsets, given a frequency input not
exactly centered on any bin.


IMHO. YMMV.
-- 
rhn A.T nicholson d.O.t C-o-M

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Most accurate method of fundamental frequency determination ? - rhnlogic@yahoo.com - 2005-10-28 01:58:00

Joerg wrote:
> Then there is, of course, the brute force method to run a very high
> resolution FFT and interpolate between the output bins. But this can
> burn a lot of processor MIPS.

Note that if you know what two bins your frequency is between, you
don't need to do a whole FFT, but only a partial DFT with the fewer
frequencies in the gap between the bins you wish to interpolate.
You might even be able to use successive approximation techniques
to generate a converging sequence of frequencies to correlate, instead
of doing a partial DFT with the whole series of all frequencies
between two bins at the desired higher resolution.  Might be a much
more computationally efficient method to give you identical results
with an extremely high resolution FFT on a single frequency peak
with low enough noise to make any of this worthwhile.


IMHO. YMMV.
-- 
rhn A.T nicholson d.O.t C-o-M

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Most accurate method of fundamental frequency determination ? - glen herrmannsfeldt - 2005-10-28 04:47:00

r...@yahoo.com wrote:

(snip)

> The problem is defining exactly what you mean by "fundamental
> frequency".  The wrong definition might produce a result slightly
> sharp or flat or even octaves different from what a human would
> report as the pitch of the note.  The definition might even change
> for different types of musical instruments and in different listening
> situations.

As I understand it, people can hear the fundamental even when
it isn't there.  That is, if you have the harmonics but no n=1
term it still sounds like it does.

-- glen

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Most accurate method of fundamental frequency determination ? - Karin Dressler - 2005-10-28 07:15:00

"robert bristow-johnson" <r...@audioimagination.com> schrieb im Newsbeitrag 
news:BF86F012.B9E0%r...@audioimagination.com...
> in article 1...@z14g2000cwz.googlegroups.com, jwes at
> j...@gmail.com wrote on 10/27/2005 20:45:
>
>> I am looking for a very accurate method for fundamental frequency
>> determination. There is no realtime requirements. The input will be
>> high quality single note musical instrument samples. The desired output
>> is an estimate of frequency every few milliseconds for the length of
>> the sample. I have  "A high resolution fundamental frequency
>> determination based on phase changes in the Fourier transform" by
>> Judith Brown,
>
> i don't think i have that one.  can you tell me where to find it on the 
> web?
>

I have http://www.wellesley.edu/Physics/brown/pubs/hrFreqV94P0662-P0667.djvu 
in my reference manager for this one. It is very nice, though the frequency 
estimation method is similar to the method presented by Charpentier in 
"Pitch detection using the short-term phase spectrum"
I like this method a lot, because it needs only one FFT-frame for its 
frequency estimation. (But you have to use windowing in the frequency 
domain.) 


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Most accurate method of fundamental frequency determination ? - Karin Dressler - 2005-10-28 07:23:00

"jwes" <j...@gmail.com> schrieb im Newsbeitrag 
news:1...@z14g2000cwz.googlegroups.com...
>   I am looking for a very accurate method for fundamental frequency
> determination. There is no realtime requirements. The input will be
> high quality single note musical instrument samples. The desired output
> is an estimate of frequency every few milliseconds for the length of
> the sample. I have  "A high resolution fundamental frequency
> determination based on phase changes in the Fourier transform" by
> Judith Brown, but before I start implementing it, I would like to know
> if there is open source code for this, or if there is a better method.
>

If you want to try the phase vocoder method for the instantaneous frequency 
estimation (IF), have a look at www.dspdimension.com. Try the tutorial 
"4-Pitch Shifting Code". It includes a really nice description of the phase 
vocoder technique. And the pitch shifting code also includes IF estimation.
Of course IF estimation does not solve the problem of the perceived pitch 
height,  but it is a starting point :-)

Good luck,
Karin 


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Most accurate method of fundamental frequency determination ? - fizteh89 - 2005-10-28 09:29:00

Go to http://www.soundmathtech.com/pitch to get a paper and Matlab
demo.

You can also read US Patent Application 20030088401 at
www.uspto.gov/patft
(non-commercial use is fine)

Trust me, this is as good as it gets: there will be no better method
for detecting fundamental frequency/period of a signal with least
possible amount of data.

Start reading it now. You can safely put all other papers on this
subject, including the paper you mentioned, where they belong - in a
trash can :-)

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Most accurate method of fundamental frequency determination ? - Jim Adamthwaite - 2005-10-28 09:30:00

I had some success with correlating a buffer with itself, once I made a few
mods to the standard algorithm.  It was used on a lekky guitar.

A beating effect was found to be caused by the arbitrary phase alignment of
the signal waveform in successive sample buffers.

I increased the size of the buffers to acommodate a little more than 2 full
cycles of the lowest anticipated frequency.  I ignored the first peak at 0
samples offset and looked for the next one.  This was used that as the
starting reference from which the next major peak was determined.

The period thus reported has a time resolution in integer steps of 1/Fs,
which was too coarse (about 0.5 semitone rounding error towards the top of
the guitar neck).

This was overcome by finding the left & right shoulders of the 1st & second
correlation peaks & doing a little arithmetic to determine the peak's
center position with fractional sample time resolution.

After that, the straight & synthesized guitar pitch were compared & found to
match within a few cents.

There were a few drawbacks though.  If the sample buffer captures the
initial attack of the string only, the DC thump & plectrum scratch can give
wild pitch determination errors (frequency from DC to light).  This is
immediately corrected when the next sample buffer is processed.

I was using a 20MHz 56002, & it took about 30mS processing time to get a
pitch, uselessly slow for live playing.

The more MIPs the better.  If you have enough of them, you can capture
overlapping buffers (size is fixed by frequency) and deliver pitch updates
more often, thereby reducing the duration of the errored pitch.

I am guessing here, but I imagine that as you use more liquid nitrogen and
asymptotically approach a complete pitch determination every sample, even
the attack noise will probably be correctly reproduced.

I found lowpass filtering above 1.5KHz was useful for noise reduction.  I
was able to find a missing fundamental, because the waveform repeats at
that period.

Have fun.
Jim Adamthwaite.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

| 1 | 2 | 3 | 4 | 5 | next