Pages: [1]   Go Down
Author Topic: White noise  (Read 2813 times)
0 Members and 1 Guest are viewing this topic.
London
Offline Offline
Edison Member
*
Karma: 48
Posts: 1491
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have an idea for a project but don't know how to go about it. I want to use a Uno to output short bursts (about one second each) of white noise to simulate the puffing of a steam locomotive. I presume I can't use a piezo as they only output one note at a time and white noise is many multiple notes. I also presume that I'd have to record and store a recording of white noise on an SD card. Can anyone give me some pointers, please.

Assuming that can be done, how could I get the output to fade from one speaker to another to simulate the locomotive moving? I envisage 3 or 4 speakers over a distance of about 16 feet.

The timing of the 'puffs' would be tied to the loco's speed, which is controlled by the Uno using a motor shield.
High fidelity isn't a problem here.  smiley
Logged

London
Offline Offline
Edison Member
*
Karma: 48
Posts: 1491
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After posting the above I found a white noise generator circuit here: http://www.google.co.uk/url?sa=i&source=images&cd=&cad=rja&docid=BI2WwFkVE9vZgM&tbnid=TwA8e64PSHiUDM:&ved=0CAgQjRwwAA&url=http%3A%2F%2Fwww.montalk.net%2Femwng.html&ei=xUQQUqeIBKXP0AWDwoD4Bg&psig=AFQjCNFb_etd9H3izj5hpMluxqmLihlVkg&ust=1376884293109042

So now it's only a matter of pulsing the output from the Uno with a transistor. I still have no idea how to cross fade the output from one speaker to another.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I remember reading an article in Wireless World many years ago in which a white noise generator was made by clocking a linear feedback shift register at an ultrasonic frequency. The shift register output was fed into a filter (AFAIR it was a simple low-pass filter) to give white noise. You could emulate the linear feedback shift register in software. See http://en.wikipedia.org/wiki/Linear_feedback_shift_register which even provides some C code.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 636
Posts: 34575
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes that is how random number generators work, which essentially is white noise.
However the quality of the noise to be steam like will depend on the attack and decay of the envelope so you will need some form of amplitude control to make it sound nice.
Maybe you would be better off with a wave shield and some audio samples of the noises you want.
Logged

Berea, KY, USA
Offline Offline
Jr. Member
**
Karma: 1
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you care, the shift register with feedback is simply pseudo-random, since it repeats. This is unlike the linked circuit (with paired transistors), which is truly random. If pseudo-random is good enough, it seems to me you could call a pseudo-random number generator at fixed intervals and output the resulting data exactly as you would the successive data points of a wave file. Envelope is simply a function of multipying by the appropriate (cosine?) function.
Logged

There are 10 kinds of people in the world, those who understand binary, and those who don't.

Berea, KY, USA
Offline Offline
Jr. Member
**
Karma: 1
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OR, output the series of pseudo-random numbers to a PWM pin connected to a low-pass filter. Now the values set the frequency, rather than amplitude. This is like a (digitally-driven) class-D audio amp!
Logged

There are 10 kinds of people in the world, those who understand binary, and those who don't.

In Front Of Computer
Offline Offline
Newbie
*
Karma: 0
Posts: 47
Resistance is futile, but only for less than ten ohms.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Henry, let me know what you did when you are finished.  I am thinking of trying the same thing for my railroad.
Logged

The Three Laws of Thermodynamics:
1. You can never get ahead, you can only break even.
2. You will only break even at absolute zero.
3. You

London
Offline Offline
Edison Member
*
Karma: 48
Posts: 1491
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Henry, let me know what you did when you are finished.  I am thinking of trying the same thing for my railroad.
The amplifier IC arrived today and I've breadboarded the circuit, but it's not working yet. smiley-cry
I'll have another try tomorrow. I think the 9V battery is a bit low on charge, but didn't have my meter handy to test it.

When I get it going, I know that I can switch it on and off with an Arduino pin through a transistor to produce the 'chuffs' and relate that to the speed of the motor. Long, slow 'chuffs' as it starts to move, faster, shorter 'chuffs' at full speed. What I've no idea how to do is cross-fading between two or more speakers. I'm thinking of using PWM, but I'll leave that until I have one speaker working properly.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
I'm patient of Misophonia and it is so much awful feeling for me so I try my best to help others who are suffering from same....
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please share summarized result & solution with me when you done. I need them for my college final year project...
Logged

Pages: [1]   Go Up
Jump to: