Generation of Pink Noise using 3dB/octave filters on digital white noise

Started by bademiya July 10, 2006
Hi guys.

I want to know how is it possible to generate digital white noise in a
ADSP-BF561 board? I have tried searching for algorithms on digital white
noise generation but i have been getting a lot of variations on the
algorithms and the source codes.

My intention is to generate digital white noise and use 3dB/octave filters
to make the output into a digital pink noise. This output will then be
transmitted to loudspeakers connected to the BF561 board. Could anyone
help me out here by pointing out some websites that discuss about this and
maybe previous posts about this? I have tried searching the post but there
are thousands of them. Its not very convenient for me to go through
everyone of them. 

Thank you and regards.

Amit aka bademiya.


Amit aka bademiya wrote:
>I want to know how is it possible to generate digital white noise in a >ADSP-BF561 board? I have tried searching for algorithms on digital white >noise generation but i have been getting a lot of variations on the >algorithms and the source codes. > >My intention is to generate digital white noise and use 3dB/octave
filters You just need to produce random numbers. If you produce a sequence of random numbers (and you don't need anything fancy, with good statistical properties, the most simple rng will do fine), you have white noise. A good description for the generation of pink-noise is here: http://www.firstpr.com.au/dsp/pink-noise/ [ I hope the date of my mail will be set correctly. My apologies to all, for a previous mail by me, which came from the future. I checked the system clock. It is ok. I don't know what happend. ] gr. Anton
bademiya wrote:
> Hi guys. > > I want to know how is it possible to generate digital white noise in a > ADSP-BF561 board? I have tried searching for algorithms on digital white > noise generation but i have been getting a lot of variations on the > algorithms and the source codes. > > My intention is to generate digital white noise and use 3dB/octave filters > to make the output into a digital pink noise. This output will then be > transmitted to loudspeakers connected to the BF561 board. Could anyone > help me out here by pointing out some websites that discuss about this and > maybe previous posts about this? I have tried searching the post but there > are thousands of them. Its not very convenient for me to go through > everyone of them. > > Thank you and regards. > > Amit aka bademiya.
Hi Amit, I thought Steve Parks' site has some excellent information, including C source code, on this topic: http://www.cs.wm.edu/%7Eva/software/park/park.html --Randy
banton wrote:
> Amit aka bademiya wrote: >> I want to know how is it possible to generate digital white noise in a >> ADSP-BF561 board? I have tried searching for algorithms on digital white >> noise generation but i have been getting a lot of variations on the >> algorithms and the source codes. >> >> My intention is to generate digital white noise and use 3dB/octave > filters > > You just need to produce random numbers. > If you produce a sequence of random numbers (and you don't need > anything fancy, with good statistical properties, the most > simple rng will do fine), you have white noise. > > A good description for the generation of pink-noise is here: > http://www.firstpr.com.au/dsp/pink-noise/
Amit, Just so there are no hidden invalid assumptions, know that the noise generated by a stream of random numbers from a typical (linear congruential, say) random number generator is white but not Gaussian. If you need Gaussian noise, ask. Otherwise, there's no need to go into it. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Thank you guys. You have been a great help. However, i'm still a bit new to
this. When you generate random numbers to produce white noise, does it
extend to all frequencies? Meaning, more or less almost infinite bandwidth
or is there some limitation to the bandwidth? Also, i'm only interested in
generating white noise and not gaussian as explained in the following
website: http://www.firstpr.com.au/dsp/pink-noise/. 

Thank you and regards.

Amit.

Amit wrote:
>Thank you guys. You have been a great help. However, i'm still a bit new
to
>this. When you generate random numbers to produce white noise, does it >extend to all frequencies? Meaning, more or less almost infinite
bandwidth
>or is there some limitation to the bandwidth?
No digital signal can have unlimited bandwidth. But it covers the whole range up to 1/2 of your samplerate. gr. Anton
bademiya wrote:

> I want to know how is it possible to generate digital white noise in a > ADSP-BF561 board? I have tried searching for algorithms on digital white > noise generation but i have been getting a lot of variations on the > algorithms and the source codes.
The most simple way is to just call the function random() from libc: #include <stdlib.h> void createWhiteNoise(double amplitude, double* data, unsigned int num) { for (unsigned int i = 0; i < num; ++i) data[i] = amplitude * 2 * (((double)random() / (double)RAND_MAX) - 0.5); }
> My intention is to generate digital white noise and use 3dB/octave filters > to make the output into a digital pink noise.
Since I knew no better way I did the filtering in the frequency domain: I did an FFT of the white noise data, multiplied each bin with an appropriate factor and then did an inverse FFT. Of course this is a time consuming task. bye Andreas -- Andreas H&#2013266172;nnebeck | email: acmh@gmx.de ----- privat ---- | www : http://www.huennebeck-online.de Fax/Anrufbeantworter: 0721/151-284301 GPG-Key: http://www.huennebeck-online.de/public_keys/andreas.asc PGP-Key: http://www.huennebeck-online.de/public_keys/pgp_andreas.asc
bademiya wrote:

> Also, i'm only interested in generating white noise and not > gaussian as explained in the following website: > http://www.firstpr.com.au/dsp/pink-noise/.
Those terms describe two different aspects. Spectral shape is about the relation between values at different times (correlation structure) while distribution is about possible observed values at a single time. In any case, the noise source and the filter output won't generally have the same distribution. You needn't worry about it if you're just after the sound, though. Martin -- Quidquid latine scriptum sit, altum viditur.
bademiya wrote:
> Thank you guys. You have been a great help. However, i'm still a bit new to > this. When you generate random numbers to produce white noise, does it > extend to all frequencies? Meaning, more or less almost infinite bandwidth > or is there some limitation to the bandwidth? Also, i'm only interested in > generating white noise and not gaussian as explained in the following > website: http://www.firstpr.com.au/dsp/pink-noise/. > > Thank you and regards. > > Amit.
Hi Amit, May I ask what you intend to do with this noise signal? --Randy
>Hi Amit, > >May I ask what you intend to do with this noise signal? > >--Randy
Hi Randy. I intend to use the noise signal to measure the room impulse response and to calibrate the speakers accordingly after detection. Thanks a lot for your help so far. I have been able to generate white noise from the link and the rngs file provided at http://www.cs.wm.edu/%7Eva/software/park/park.html. However at the moment, i am having cable problems. As you all know, the BF-561 board outputs audio signal through the RCA jacks. However, the PC speakers i am using uses the standard 3.5mm stereo jack as input. So whenever i use the adaptor cable for RCA to 3.5 mm female, i only get the noise from 1 speaker only. In other words, from stereo i end up getting mono. From what i have known and heard, these kind of cables are actually pretty useless. I have heard lots of complains that this happens all the time. Now i am tryong to get speakers that have RCA inputs and independent power source. Hopefully i can do it. I have another query though. At the moment when i generate the white noise, it plays for an infinite amount of time. Does anyone know how i can limit the playback period to a much shorter time? Thanks! Amit.