fourier

coinflip.randtests.fourier.spectral(series, candidate)[source]

Potency of periodic features in sequence is compared to expected result

The binary values are treated as the peaks and troughs respectively of a signal, which is applied a Fourier transform so as to find constituent periodic features. The strength of these features is referenced to the expected potent periodic features present in a hypothetically truly random RNG.

Parameters:
  • sequence (array-like) – Output of the RNG being tested
  • candidate (Value present in given sequence) – The value which is considered the peak in oscillations
Returns:

TestResult – Dataclass that contains the test’s statistic and p-value

Raises:

NonBinaryTruncatedSequenceError – When odd-lengthed sequence is truncated there is only one distinct value present

coinflip.randtests.fourier.fft(array) → pandas.core.series.Series[source]

Performs fast fourier transform

Parameters:array (array-like) – Input array
Returns:Series – Fourier transformation of array

See also

numpy.fft.fft()
Method adapted to return a Series as opposed to an ndarray