I have some signal source, that can be in one of two states -- it is either emitting constant value 1.0 or oscillating in the way very close to sinus function from time.
The period can have some deviations. The constant 1.0 in the first state can also have constant deviation (0.98 for example).
I can read the value several times with any time delays I want.
The main goal is to detect, if emitter is in oscillating state.
Another goal that would be nice to solve is to check, that range is close to 0..1.
I know, that theoretically the period can be small enough and it is something about common divisors, that I can miss the oscillation. So the solution would rely on statistics.
What are the best time delays to check the value to minimize number of checks and maximise solution reliability? Lets say possible periods are between 0.01 and 100 seconds, and I want to detect it in less than 10 seconds.
A single measurement of a value significantly below 1.0 should indicate oscillation. And if you want to detect a 100 second period withint 10 seconds, we must consider $\cos 18^\circ\approx 0.951$ as significant. So one way is to make measurements at certain point sin time and say that the system is in oscillation if at least one of the measurements is $<\cos18^\circ$. (Strictly speaking, a constant emitter would result in all measurements being equal, but I am not sure how constant your constant really is; so let's assume that arbitrary changes within the $0.951\,\ldots\, 1.0$ range are compatible with "constant").
So let's measure at $t=0$ and $t=10$. This will also detect a period $T=100$ because the difference is at least $10\%$ of the period, hence our $\cos 18^\circ$ bound applies. This will also detect $T$ is not of the form $10 = (k+\delta)T$ with $k\in\mathbb N$ and $-\frac1{10}<\delta<\frac1{10}$, i.e. we will also detect $$T\in [\frac{100}{9},100]\cup [\frac{100}{19},\frac{100}{11}]\cup [\frac{100}{29},\frac{100}{21}]\cup [\frac{100}{39},\frac{100}{31}]\cup\ldots $$ Let's make another measurement at $t=\frac{10}9$. By the same argument as above, this will detect $$T\in [\frac{100}{81},\frac{100}{9}]\cup [\frac{100}{171},\frac{100}{99}]\cup [\frac{100}{261},\frac{100}{189}]\cup \ldots $$ so that both conditions together cover at least $[\frac{100}{89},100]$, which suggests another measurement at $t=\frac{10}{89}$. That will detect $$ T\in[\frac{100}{801},\frac{100}{89}]\cup\ldots$$ so that the next suggested measurement is at $t=\frac{10}{809}$, which will already take us quite close to the lower bound on $T$. In summary, we need at most six measurements to distinguish a periodic sine-shaped signal (with possible period lengths ranging over four orders of magnitude) from a noisy constant signal.