# SNR problem with different sampling rates using innerproduct

I'm trying to measure the amplitude of a sinusoidal component in a noisy signal.

Since the signal frequency is known beforehand, I'm calculating scalar product with a sine and cosine base function at the given frequency (see this thread: Measuring amplitude of a spectral component)

$$a = \left<y,\cos(2\pi t f_c/f_s)\right>$$

$$b = \left<y,\sin(2\pi t f_c/f_s)\right>$$

Now the problem that I've noticed is that when i'm running the ADC at half speed (312Ksps) I get less noise (less variance over multiple measurements with the input signal being stable, and all other parameters staying the same) than with full speed (625Ksps) - in fact the standard deviation doubles.

I know that this noise is coming from the digital processing, not from the ADC chip, because if I'm running the chip at full speed doing a 2x decimation (while keeping the same number of samples), the standard deviation is the same as running the chip at half speed.

I tried to investigate the source of the variance. Since the input signal is very stable (I know this from other measurements), I suspect the variance is coming from out-of-band noise.

I tried to make a quick simulation to see how other frequencies around the base frequency affect the result. The base frequency was 7200 Hz. The curve below is generated by keeping the base functions constant, and generating input signals with frequencies running from 7 - 8 KHz in small steps.

The 0's of the curve seem to follow $f_s/N_{samples}$. That is to say if I’m taking 65536 samples @ 625Ksps, the distance between the 0's is about 9.53 Hz. With the same nr. of samples @ 312Ksps, the distance will be 4.77 Hz. This means that the width of the central lobe (where the signal pickup is maximal) is 2x in the case of 625K sample rate.

I suspect that this is why more noise is picked up (noise as components around the signal with varying amplitude). Now I understand that with the same nr. of samples and the lower fs you see more cycles of the singal.

However with the higher fs you see less cycles with more resolution. These should be equivalent right?

How do I get rid of the noise?