Estimate digital signal
If X plus Y is longer than twice your sample rate, 20 seconds, but not an exact rational multiple of your sample rate, then with a large enough number of samples you might be able to make a frequency and duty cycle estimate by calculating the statistics and spectrum of the sample vector.