[sdiy] converting white noise to pink noise

Eric Brombaugh ebrombaugh at earthlink.net
Tue Mar 4 20:40:24 CET 2008


Tom Wiltshire wrote:
> 
> On 4 Mar 2008, at 15:53, Eric Brombaugh wrote:
> 
>> How about programming a PIC12C50x part with a nice 32-bit LFSR 
>> algorithm? Those will run at 4MHz, so the repeat rate would be 
>> something on the order of 12 hours assuming a 100kHz sample rate (not 
>> unreasonable for a PIC). The parts cost ~$2. The program would be 
>> maybe 20 - 30 instructions long. Noise would be white out to ~50kHz - 
>> well beyond human range.
>>
>> Eric
> 
> I second this approach! But then, I would, wouldn't I?!
> 
> You could easily program a LFSR onto a 8 pin DIP 12F/12C series PIC. I 
> recently did a 64-bit LFSR algorithm that doesn't repeat for 200,000 
> years at 20KHz, so don't worry about repetitive noise.
> Eric is right - the parts (all one of them) are cheap, the program is 
> simple, and you can have noise which is pure white to pretty much any 
> measure of accuracy if you care to.
> 
> The article Colin F posted (below) really does cover it. I learned quite 
> a bit about noise/random numbers from this page when I was looking into 
> the topic.
> 
> http://www.edn.com/article/CA313057.html

I just tried the code from that article in a PIC12F508 that I had laying 
around. It needed a few tweaks* but works just fine. Nice, smooth white 
noise with no audible repeats. Runs at just under 100kHz sample rate 
with VDD=5V on mine. Code uses a 2^31 register, so repeat period will be 
5.9 hours. I think that's probably sufficient...

Give it a shot! Don't forget to pull pin 3 high (enable input defined in 
program).

* Code I downloaded from the EDN site had a few issues:
- retarget from 12C509 to 12F508
- remove filename from header
- a few ';' comment markers missing
- needed ':' after labels
- Configuration bits aren't properly set in code

Eric



More information about the Synth-diy mailing list