# Would unstable sample rate affect spectrum after FFT?

The system samples analog input and then conduct FFT on the samples and then display the spectrum. Currently, the issue is the displayed spectrum line position is keeping shift between each scan. After examining the whole system, I found all the components in the system are consistency except the sample rate which varies between 9B~10B, but it always satisfies the Nyquist sampling rate(2B). My question is whether the unstable sample rate may lead to the frequency shift?

• Holy crap! Yes. The FFT is an algorithm "tweaked" to take advantage of symmetries and identities to arrive at a fast transform. One assumption that underlies probably every FFT algorithm I've experienced is that the sample rate can be considered to be "fixed-spaced." That doesn't mean someone couldn't find a "semi-fast" algorithm that accepted delta-time values, as well. But I've not seen it. So, it most certainly will affect your results. When I design scientific instrumentation, I make certain the sampling is rock-solid (50ns jitter may be too much.) Or else scientists would complain.
– jonk
Jun 17, 2020 at 1:33
• @jonk, 50 ns or 50 ps? Jun 17, 2020 at 3:44
• @ThePhoton For most of the equipment I worked on 50 ns was sufficient. As always, though, context matters. So I was only making the point that "rock-solid" is the requirement. That meaning varies with context.
– jonk
Jun 17, 2020 at 3:50

## 2 Answers

My question is whether the unstable sample rate may lead to the frequency shift?

Since the frequency bins in the FFT are proportional to the sampling rate, if you change the sampling rate, you change the frequency of those bins. If you know what the sampling rate is on every particular data set, you can resample it to be consistent between all of them.

That 9bandwidth to 10bandwidth variation will cause 10% spreading of the spectral lines.

If you have 100,000 Hz Nyquist, and you expect a clean frequency line at 25,000 Hz, expect the 25,000 Hz to be 2,500 Hz wide.

If you gather 0.1 second of samples, you can expect 10 Hz frequency bins.

Thus 2,500 Hz line spreading should be very observable.