[sdiy] Best software noise algorithm?

Antti Huovilainen ajhuovil at cc.hut.fi
Thu Feb 18 07:52:35 CET 2010


On Wed, 17 Feb 2010, Tom Wiltshire wrote:

> Ah, yes! That's another approach I hadn't thought of. It's true that if you 
> do an FM(PM) feedback loop on a oscillator, the number of sidebands increases 
> to the point at which you've got noise. And I don't suppose it is spectrally 
> perfect, but I'm not being fussy.
>
> So - can it be done in better than 19 cycles?! It's almost enough of a 
> challenge to do it just to see...

Dunno about PM, but the 16 & 32 bit linear congruential generator 
combination takes a bit over two cycles per sample with block processing. 
If that isn't fast enough for you, I don't know what is :). It certainly 
will sound better than any aliasing based method.

The repeating period is N*2^32, which ought to be long enough unless you 
mind it repeating faster than once every hundred thousand years.

Example code for the in-loop part follows:
; calculate seed = (seed * a + c) & 65535
; w0 = seed
; w1 = temp
; w2 = a = 20077
; w3 = c = 12345

; setup
mov     w2, 20077
mov     w3, 12345

; loop
mul.uu  w0, w2, w0
add     w0, w3, w0


Antti

"No boom today. Boom tomorrow. There's always a boom tomorrow"
   -- Lt. Cmdr. Ivanova



More information about the Synth-diy mailing list