FluidPitch.kr won't go below 87 Hz

Greetings,

I was using FluidBufPitch recently and noticed that it never returned a frequency below about 87 Hz, even though I was pretty sure was some clear low tones in the sound file. So I ran this little test and found that it bugs out at about 87 Hz and won’t go lower. In this test, I included all three algorithms. Is there a way around this? Thanks!

(
{
	var freq = XLine.kr(300,20,20).poll(label:"freq");
	var sig = LFSaw.ar(freq);
	var one = FluidPitch.kr(sig,0)[0].poll(label:"algo0");
	var two = FluidPitch.kr(sig,1)[0].poll(label:"algo1");
	var three = FluidPitch.kr(sig,2)[0].poll(label:"algo2");
	0.poll(label:"                              ");
	//sig.dup;
	[freq,one,two,three];
}.plot(20,minval:15,maxval:310)
)

Hello!

87 Hz is the lowest freq an FFT of 1024 will give you indeed! With windowSize:4096 I have good results, and with 8192 it is more accurate in the low part… I think some of that information can be found here but let @weefuzzy and myself know if you struggle, we can make it more helpful with feedback.

1 Like

Ah yes, thank you. Is there an explanation for why it is 87 Hz in this case? If my math is correct, that’s the bottom end of the third bin (44100 / 1024 = 43.066 Hz). Why won’t the phase vocoder return the frequency in the lowest bins? Because of how the energy spreads out? I see your explanation in the link above, just trying to build some intuition.

Would a decent rule of thumb be that the frequency resolution of the bins should = the lowest freq you want to register / 4 ?

In any case, I bumped it up to 4096 and I’m covered now. Thanks for the reply!

I think @weefuzzy and @groma will have a better explanation than me, but I think the STFT envelop has something to do with this too… My experience was about 2 cycles at least in the analyser window, but Owen wrote 4, so I’m eager to hear his rationale.

Without looking at the algorithms or the code, the general idea of pitch detection is not based on a single bin of high magnitude, but on a periodicity in the spectrum that represents a harmonic relation. Intuitively, this requires at least an empty bin between two harmonics, which would explain the number you are seeing.
This should not be confused with the number of cycles required to detect a windowed sinusoid.

1 Like