For fs = 20 Hz, winlen = 10 s, and winover = 0.9, sampinc is calculated as 19 samples — but it should be 20. This then bleeds into the output time vector, t, for this example causing its sampling interval to be 0.95 s rather than 1 s as expected. This causes large timing errors for long array processing routines if users naively calculate a 1 s sampling rate (as I did!).
Changing to
sampinc = int(round((1 - winover) * winlensamp))
fixes the above issue. There may be other examples as well.
The Python
int()
command truncates values. So, e.g., the following occurs:this is relevant to _ltsarray e.g. in this line: https://github.com/uafgeotools/lts_array/blob/4f85442a1d4e821fb5e6bcf45e5a649e8db8f56f/lts_array/ltsva.py#L55
For
fs = 20
Hz,winlen = 10
s, andwinover = 0.9
,sampinc
is calculated as 19 samples — but it should be 20. This then bleeds into the output time vector,t
, for this example causing its sampling interval to be 0.95 s rather than 1 s as expected. This causes large timing errors for long array processing routines if users naively calculate a 1 s sampling rate (as I did!).Changing to
fixes the above issue. There may be other examples as well.