0
\$\begingroup\$

I'm an electronic musician and computer science student I have been tinkering a lot lately with Arduino and analog ways of sound synthesis. Mainly I've been using 4093 ICs (NAND gates) to make oscillators.

I've wanted for a long time now to turn on and off the oscillator at random intervals to make percussive beats.

After some research, I came up with some papers talking about the oscillator sampling method, which uses two oscillators (one fast, one slow) and a D Flip-Flop to generate a randomized signal. (Diagram shown below)

Oscillator sampling method

It is noted on the research that I found that

  1. The oscillators used are made using ring oscillators which I know nothing about.
  2. The slow clock is mentioned to be a jittered or noisy signal, which again I know nothing about.
  3. On some papers I've read that the frequencies must be related but that I'm am not sure what is the relation

Would I be able to use my NAND oscillators to create this random bitstream? If not, any help, reference or advice is very welcome.

Thanks

\$\endgroup\$
1
  • \$\begingroup\$ This relies strongly on the oscillators. Without enough care, digital switching noise can lock one to the other, and ... oops, no randomness. \$\endgroup\$
    – user16324
    Commented Feb 24, 2021 at 13:42

2 Answers 2

3
\$\begingroup\$

This circuit will produce bits that are best described as not 'completely deterministic', rather than random.

The 'better' the oscillators, the more deterministic the result will be. If you had two 10 MHz high quality reference oscillators, then the output of your d-flop would be a long stream of one bit, flipping to the other when there was enough phase drift between them.

Running the sample oscillator at a tiny fraction of the frequency of the other enhances the apparent non-determinism, by ignoring a large number of the identical bits between changes.

Using 'bad' oscillators, like RC schmidt oscillators or IC ring oscillators for instance, increases the non-determinism yet more.

For a large difference in frequency, and 'bad' oscillators, the output will be random enough for many applications. Be aware though that any unintentional coupling between the oscillators, or change of a noise source like a power supply being replaced with a better one, may make the bits less random than expected.

A scheme like this would never be good enough for cryptographic purposes, or for running Monte Carlo simulations, better solutions exist for both of those.

\$\endgroup\$
2
\$\begingroup\$

The principle is so simple. It comes from the old concept of Antoine Augustin Cournot who said that:

randomness is the encounter of two independent causal series

so you can use any independent oscillators and you will get random bits.

\$\endgroup\$
4
  • \$\begingroup\$ So, in other words, I should not really worry about the nuances of the oscillators? \$\endgroup\$ Commented Feb 24, 2021 at 7:07
  • \$\begingroup\$ Exactly. However you should take care of the frequencies so you do not exceed the time constraints of the flip-flop (in all cases you will still have random behavior but staying within the constraints helps you having almost same behavior when you replace the flip-flop). \$\endgroup\$ Commented Feb 24, 2021 at 7:14
  • \$\begingroup\$ Are these constraints available on the IC datasheet or where could I find those guidelines? \$\endgroup\$ Commented Feb 24, 2021 at 7:37
  • \$\begingroup\$ I don't think you must worry about it since your application is for sound synthesis so too low frequencies to worry about limits. But for the info yes you can deduce the maximum frequency from the datasheet using time characteristics. \$\endgroup\$ Commented Feb 24, 2021 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.