White Pink Noise Generator?

Started by ulysses, May 18, 2013, 06:00:24 PM

Previous topic - Next topic

ulysses

hey guys

long time no post. i've been busy in the real world ;) hope you are all well.

im in need of a white/pink noise generator for my moog sub phatty. the noise gen on the sub phatty is a weird sort of wooly brown noise

fortunately you can use the line-in and it will play whatever is coming in the line in when you press a key. awesome.

does anyone have a schem for a noise gen that they recommend? an awesome one that sounds gold. id love it if it had a mixer on it too to mix the noises. but i can add that if necessary ;)

OR if someone had the schem for the white/pink noise gen circuit for the minimoog that would be awesome. i cant find it on the net.

i realise you guys are mainly interested guitar effects but surely some of you you guys sideline in synths too ;)

cheers, ulysses.


WaveshapeIllusions

Welcome back. Here's a project for a pink noise generator: sound.westhost.com/project11.htm

Removing the filter section would make it into a white noise generator.

brett

Hi
RG Keen has a very simple noise generator (white?) on his geofex.com site.
I seem to remember that it's based on reverse biasing an Si junction. That's a common idea.
cheers
Brett Robinson
Let a hundred flowers bloom, let a hundred schools of thought contend. (Mao Zedong)


R.G.

Reverse broken semiconductor junctions make good white noise. Varies from junction to junction as to the "whiteness" of the noise. Some transistors are reputed to be better than others, and of course the "best" ones are no longer made.

If you want good, reliable, highly-white noise for further shaping into colors, you need long feedback shift registers.

At one time, I'd have done this with CMOS shift registers, but a six or eight pin PIC will do a shift register to do pseudorandom noise with a repeat cycle so long that you can't tell it from real noise by ear.

See Lancasters stuff on noise generators.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

ulysses


R.G.

This thread actually did get me off my duff and I wrote the dozen lines of code. I'm testing it now.

One 8-pin DIP, 78L05 regulator, 0.1uF decoupling cap. Output is pseudorandom noise on one pin, high "whiteness", repeat time about every 9 days. 5V peak to peak signal size.

Resistor/cap networks can make the other noise colors from it.

I'll probably see if small bear wants to sell them.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

artifus


R.G.

Yep. I took a 430 seminar/class from TI a ways back. That's an entirely viable alternate. The code is much the same, allowing only for quirks of the actual instruction set.

The target chip I picked was the 12F508, largely because I had some in hand and it's a DIP package, not SMD, and I used a PIC because I have the development tools. Pretty much every low-end uC is a candidate for this application, and the choice of a target controller is entirely based on secondary issues.

Here are some prices from Mouser for uCs I think would run this:

10F200                    6-pin SOT-23 SMD   $0.51
12F508                    8-pin SOIC SMD     $0.70
12F508                    8-pin DIP          $0.83
MSP430G2001IPW14          14-pin TSOP        $0.83
MSP430G2210               8-pin SOIC         $0.85


The 10F200 is cheapest from Mouser, but is an SMD part with 0.050" lead spacing. The 12F508 SMD costs another $0.19, also in a 0.050" spacing SMD package. The 12F508 in through-hole is $0.83 in ones. The 14-pin 430 is $0.83, and is a 14 pin 0.025" spacing SMD. The 8-pin 430 is an 8-pin SOIC, 0.050" spacing, for $0.85. All prices from stock, in ones. All prices go down if you order more than one at a time. The 100-unit price goes down: the 12F508 DIP is $0.53 in 100's, the 8-pin 430 is $0.43 in 100's.

Pretty much, pick the package you like and the development tools you like. The costs are trivially different and the code will run on all of them.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

artifus

new to uc's here but quite enjoying the journey. quite taken by msp due to cost and arduino code compatability for ease of learning - early pic experiences put me off somewhat initially and have found the msp native code somewhat more logical (to my mind) in learning and the arduino/energia compatibility has helped in getting things going project wise and led to further learning. dabbling with pics a little but asm still scares me. was not trying to undermine you, just alerting folk to available alternatives which these days appear to be getting cheaper and easier to use by the day.


R.G.

Quote from: artifus on May 24, 2013, 12:18:01 PM
new to uc's here but quite enjoying the journey. quite taken by msp due to cost and arduino code compatability for ease of learning - early pic experiences put me off somewhat initially and have found the msp native code somewhat more logical (to my mind) in learning and the arduino/energia compatibility has helped in getting things going project wise and led to further learning. dabbling with pics a little but asm still scares me. was not trying to undermine you, just alerting folk to available alternatives which these days appear to be getting cheaper and easier to use by the day.

And you are exactly right! Ease of programming and using the tools (that is, development expense, in all senses of the word) is a Big Deal in the programming business.

For one-off jobs, using whatever's easiest to use is a really, really good thing.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

R.G.

Did some code tinkering.

A quirk of the math is that computing the feedback for a 63-bit long LFSR is really easy. Adding three more bytes of shift register *reduced* the code size in the main loop down to under 20 instructions, and it executes faster, probably about 1uS per instruction. So it generates a new result every 20uS or so.

The loop repeats every (2^63)-1 iterations. You get 50,000 new "random" bits every second. 2^63 is 9.22 times 10^18. Doing the divide, that's 1.8x 10^14 seconds, 5.12 x 10^10 hours, 2.13 *billion* days, 5.8 million years.

I don't think I'm going to do an exhaustive test on this for looping.  :icon_lol:
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

artifus

certainly not when a single transistor suitably abused would do!  :P

puretube

Quote from: artifus on May 24, 2013, 06:33:09 PM
certainly not when a single transistor suitably abused would do!  :P

@ > 10V...

R.G.

Quote from: artifus on May 24, 2013, 06:33:09 PM
certainly not when a single transistor suitably abused would do!  :P
An abused transistor has some advantages, in that the noise from it is truly random, and never repeats, ever.

The problem with the single transistor with a zenered base-emitter is that it's not a complete solution. There's a few millivolts of noise there. It has to be amplified up by an external amplifier to usable levels. The amplifier is really part of the circuit as the noise is unusable without it.

The noise comes out of a pseudorandom generator as a string of high/low levels at 2 to 5 volts, and can be used after only some passive R-C filtering.

Trade offs! They're everywhere!  :)
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

PRR

> 5.8 million years.

Last time I made digi-noise, the chip was over a buck and it repeated with an obvious thump every 5 seconds. And we thought that was wonderful.
  • SUPPORTER

R.G.

Ah, progress. Now we can make noise longer than any living person will need it. What a glorious time we live in!   :icon_lol:
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

R.G.

It's strange how pulling on one thread pulls in more of the web (no, not the internet).

I went off looking for info on how to fix a quirk in my code simulation of the noise generator and wound up reading about Fibbonaci and Mersenne primes, Galois fields, statistical tests for randomness and breakability of ciphers based on feedback shift registers. It seems that this field has moved on a bit since I last touched it.  :icon_lol:

Anyway, I found some stuff that I think will improve the noise characteristics of the output stream at high frequencies with little or no code increase, just a bit of more clever coding. It turns out that if you use multiple shorter shift registers and let them muck with each other's output bits interactively, you get more unpredictability, better statistical results on the output, and nearly the same output sequence length. Things like shuffling the outputs of two or more registers like a deck of cards, using one shift register to determine whether one or more registers get clocked, combining the outputs with XORs, multiplexers, adders, multipliers, and so on are the modern thinking on how to get better seeming-randomness in the output of a noise generator. Kewl!

And here I thought "Galois" was a French cigarette.  :icon_lol:

R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

PRR

#18
> pulling on one thread pulls in more

Going the other way, borne back ceaselessly into the past, I found my old chip.

http://www.electricdruid.net/datasheets/NoiseGen1Datasheet.pdf
"MM5837 ...makes a noise like a broken recording of a steam train."
"It uses a 17-bit LFSR at a rate which is somewhere between 24KHz and 56KHz"

I see he proposes a full processor where we usta use a 17-stage shifter. With some of the modern frills you outline. However the "Pink" on page 4 looks awful red to me. NatSemi published a 4-R 3-C pinker which I can testify is mighty-pink across the audio band. If anybody cares.

"Gauloise". Évariste is some other guy.
  • SUPPORTER

R.G.

Quote from: PRR on May 27, 2013, 12:35:31 AM
http://www.electricdruid.net/datasheets/NoiseGen1Datasheet.pdf
"MM5837 ...makes a noise like a broken recording of a steam train."
"It uses a 17-bit LFSR at a rate which is somewhere between 24KHz and 56KHz"
I had and listened to one of those way back when. It did indeed sound like a repeating hiss-hiss-hiss... going forever.
It's probably good enough to get a minute or two of noise before a repeat, and an hour would be massive overkill. The human penchant for hearing repeats even in pseudonoise wouldn't likely pick that up.

QuoteI see he proposes a full processor where we usta use a 17-stage shifter. With some of the modern frills you outline. However the "Pink" on page 4 looks awful red to me. NatSemi published a 4-R 3-C pinker which I can testify is mighty-pink across the audio band. If anybody cares.
I'll have to go look at that.

The use of a very small processor instead of a 17 stage shift register is one of those economic things. Once you have the shift-shift-shift-shift-XOR/repeat loop done, It's easy to just extend the shift register, which is the difference between a 1/sec repeat and a 1/eon repeat. My first shot was a 47 stage simple loop, which gives a repeat time of (2^47)-1 = 1.41E14 states. At 50000/second, that's 28E6 seconds, 782,000 hours, 32578 days, and 89 years. I was unable to resist sticking in two more shift bytes to get to 63 stages, which upped the repeat time to over 5million years. I'd hate to play a show where that would matter.  :icon_eek:

Same math on a 17 stage gives 2.3-2.6 seconds.

The designers of the National noise chip sweated a chip floorplan and layout for getting those 17 flipflops and control logic into a silicon mask. Lot of work.

Hmmm. I wonder what the smallest repeat needed is. 17 stages is just over the 16 bits we get in two 8-bit registers (using 8-bit baby processors), so doing 17 bits already requires three registers. If we have 24 bits in three registers, the longest repeat sequence we could get would be 2^24-1, but calculating the feedback is half as hard for 23 stages, and we get 2^23-1 steps. This repeats every 2.8 minutes at a 50kHz step rate, and that's probably good enough for rock-n-roll. I'll go look at how fast I can calculate that on a cheap chip.

Quote"Gauloise". Évariste is some other guy.
Er, it's all  Greek to me.  :)  Sorry. I have a little French, but not enough to distinguish those names.   :icon_biggrin:


R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.