# Question regarding sampling rate of sine wave

I am trying to determine my sampling rate, or the delay between each sample, but I am a little unsure if my math is correct.

I have generated a sine wave

f = 1000 Hz

which gives me T = 1 ms

I am sampling the sine wave and imported the data into matlab.

From the graph I can see that I have 51 samples per period.

I then calculated the time between the samples to:

T / 51 = 19.6 us

But I am wondering whether this is the correct way to do so?

• There are many different ways of doing this. What's your criteria for "correct"? As far as I can tell, it's a bit unusual but not wrong. Apr 13 at 11:34
• Strictly speaking you found the sampling interval; that is, the time between two samples. The sampling rate is given by 51/T.
– MBaz
Apr 13 at 13:14
• Thank you for your replies. Great, I was looking for the sampling interval, but confused myself whether or not it actually was true. I have a Teensy connected and in the code I have a delay of 10 microseconds, so I wanted to determine if it in fact is around 10 microseconds. Apr 13 at 13:37

Such algorithms for determining the frequency of a single tone are well documented (see Question regarding estimation of signal tone parameters (frequency, amplitude, and phase) using Macleods algorithm). The approach would be to use these techniques with a scaled frequency designating the tone frequency to be determined as a frequency ratio relative to the sampleing rate $$(f/f_s)$$ rather than absolute frequency. Thus once $$f/f_s$$ is determined with such estimators, and with $$f$$ known, $$f_s$$ can be accurately determined.