I don't know why I am having such a hard time with this math, but I am. I am doing phase-sensitive detection of a few sensors, which are triggered by a modulated light source. The modulation frequency f0 changes by up to several Hz over the course of the day based on ambient conditions, and is typically around 1370-1390 Hz. I'm doing an FFT to extract the sensor amplitudes at f0. With my system, I'm limited to an upper sampling rate of 10 kHz for up to 2 seconds, but no longer.
Given that I can dynamically change f0, sample rate, and window length, what is the formula for making sure that f0 is in the center of a bin?