I have been working with digital signals for quite some time and this fencepost-error issue when taking a simple example of sample frequency and sample spacing always trips me up (and I must say drives me completely crazy):
$f_s$: sampling frequency, number of samples per second
$t_s$: sampling spacing, $1/f_s$
This is all very neat. The time points of a 4 Hz signal collected over 1 second:
[0, 0.25, 0.5, 0.75]
This is 4 samples, with sample spacing 0.25, lasting.... 3*0.25 = 0.75 s!
Okay, lets try 0.25*4 = 1 s
[0, 0.25, 0.5, 0.75, 1]
now we have 5 samples!
All these problems go away if we take the first sample at 0 as known and fixed, then sample from there, and this is a clear example of fencepost error. But this is an issue I always get confused about and can never find much discussion or references on, so would like the conventions explained to me here so I can refer back in future and save me a headache :)
Thanks, Joe