Actual repetition period of noise generator algorithm.

Algorithm development and general DSP issues

Moderator: frank

Post Reply
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Actual repetition period of noise generator algorithm.

Post by Digital Larry »

I've used the noise-24 generator to make a "wind machine" with filters and delays and it sounds pretty nice. I also used it at the heart of a sample/hold filter and it sounds great there, too, but you can tell that the filter pattern repeats every few seconds. At least, I think so, but I might be imagining it. :lol:

Here it is:

http://www.soundclick.com/bands/page_so ... D=13045093

Long time ago I wrote a pseudo-random number generator which was something like:

Next = Current * X1 + Y1

and then limit the result to 8 bits or 16 or whatever I was doing. I tried different values out of thin air and used the computer to see how long it took to get back to the initial value. I think I got up to something like 25,000 before I decided that was good enough.

In this case though, while I like the sound, it's not truly random. I thought, well, I could filter it, and put it through some delays, but ultimately the DSP is still very deterministic and likely not to have a truly random sequence like you'd hope to get with something like the diode-junction noise generator from the analog side of the fence.

I haven't actually gone through the noise generator code to understand how it works, but it does seem to depend on some variation coming from the analog input to trigger it one way or the other.
slacker
Posts: 116
Joined: Tue Feb 01, 2011 1:13 pm

Post by slacker »

If you mean the code from Frank in this thread http://www.spinsemi.com/forum/viewtopic ... r&start=15 that is a 24 LFSR bit noise generator so it should have a pattern 16,777,216 steps long which if you update it every cycle will take about 8 minutes to repeat. It uses the analogue input to get its starting value at start up, this makes it start the pattern in a different place every time which makes it "more random" than if it started from the same place every time.

Can you run your noise generator code and output the results? That way you can look at it and see if it is repeating. What you might find is there are similar patterns every few seconds but not actual repeats.
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Post by Digital Larry »

Hmmm, I guess I can look at the waveform but that's gonna be pretty tough to see if it repeats somewhere. At least let's just say I don't think I'm going to invest the several hours to do it!

Maybe next time I get my scope hooked up I'll think of a way.

Here's the theoretical background which I'm gonna read now.

https://en.wikipedia.org/wiki/Linear_fe ... t_register

DL
slacker
Posts: 116
Joined: Tue Feb 01, 2011 1:13 pm

Post by slacker »

Sorry, what I meant was can you make SpinCAD output the value of the "lfsr" register, or the value of your sample and hold? If you can, just run it until you think it's repeating and look at the values to see if it is.
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Post by Digital Larry »

Hey Slacker,

Y'know for some reason SpinCAD doesn't want to work with the noise generator in simulation! So many other problems and opportunities abound that it's not near the top of my list to deal with.

Btw I finally added support for chorus/flange blocks. :D
Post Reply