Laptop engineering scholar and digital audio hobbyist Stefan Antoszko has constructed a “pink noise” generator, utilizing a Texas Devices MSP430G2231 microcontroller as a white noise supply and constructing a three-stage filter to attain the specified pink output.
“I used an MCU [Microcontroller Unit] as a white noise supply utilizing a 32-bit Linear Suggestions Shift Register (LFSR),” I handed it right into a three-stage high-shelf filter with offset frequencies to approximate a -3dB slope which is attribute of pink noise. My essential aim from this undertaking was to learn the way the values for [others’] shelf filters have been chosen so I made a decision to derive the equations for them by hand.”
With a TI MSP430 and some capacitors and resistors, this “pink noise” generator can soothe you to sleep. (📷: Stefan Antoszko)
To start out, Antoszko needed to get the TI MSP430 to generate white noise — selecting to make use of a linear suggestions shift register, through which a mix of upper bits are XORed collectively after which pushed to the entrance of the register. “For the reason that MSP430 is a 16-bit MCU, initially I attempted the 15-bit loop the place you XOR the primary and fifteenth bit and push that to the entrance,” Antoszko notes. “Nevertheless, this had a very quick cycle size and I may clearly hear the sequence repeating.”
Selecting a 32-bit variant with two 16-bit registers, Antoszko had an appropriate supply of white noise — however desired pink noise, often known as fractional noise and likened to the sound of a waterfall. To get that required filtering the microcontroller’s output, utilizing “a handful of resistors and capacitors.”
Antoszko calculated the values required within the filter by hand, and simulated the circuit previous to constructing. (📷: Stefan Antoszko)
For the expertise, Antoszko calculated what every stage required by hand — taking into consideration how every prior stage has already affected the sign — and got here up with a three-stage filter utilizing 5 resistors and 5 capacitors.
“[The MSP430] is nicely fitted to this software as a result of I solely want one shift register, one output pin, and a 1MHz clock is greater than adequate,” Antoszko concludes. “Moreover, it operates at a low Vcc voltage [of] <3.3V which is useful if I need plug the ultimate sign proper into Line In.”
The total undertaking write-up is on the market on Antoszko’s Hackaday.io web page.