Csound Csound-dev Csound-tekno Search About

pitchamdf improvement

Date1999-09-10 11:54
FromPeter Neubacker
Subjectpitchamdf improvement
I have changed pitchamdf for better resolution
in pitch detection at higher frequencies.

Maybe you find it in the next release - if you want to
compile yourself, you can find source and desription at:

http://www.harmonik.de/femc/femcdown.html

Here are the changed sections of the manual entry:


kcps, krms   pitchamdf   asig, imincps, imaxcps
                          [, icps][, imedi][, idowns][, iexcps][, irmsmedi]

(In INITIALIZATION:)
idowns   -  downsampling factor for asig. A factor of idowns>1 results in
            faster performance but may result in worse pitch detection.
            Useful range for downsampling is 1...4 (integer values).
            If negative, upsampling is performed for better pitch resolution.
            Useful range for upsampling is -2...-10 depending on the expected
            pitch. Note that for idowns = 1, 0, or -1 no upsampling or
            downsampling is performed. (Default = 1)
irmsmedi -  size of median filter applied to krms output.
            In fact, the resulting size of the filter will be irmsmedi*2+1.
            If 0, no median filtering will be applied. As krms will nor be
            used as often as kcps, irmsmedi is set to 0 by default.

(In PERFORMANCE:)
Pitch resolution considerations: Pitch resolution is always 1 sample due
to the amdf mechanism. For lower pitches this is quite good, e.g. for a
100 cps signal at sr = 44100, resolution would be about 4 cent.
For higher pitches it is quite bad,  e.g. for 600 cps, resolution would be
about 26 cent. You can improve resolution by  giving idowns a negative value
for upsampling, e.g. with idowns = -3, a signal of 600 cps would be detected 
with a resolution as if it were 200 cps. Upsampling will  slow down
performance drastically, but if you set imincps to a appropriate high value, 
this will be compensated.

-- Peter