DSPRelated.com
Forums

Noise modeling ideas

Started by brent June 9, 2011
On Jun 9, 7:54&#4294967295;am, Rune Allnor <all...@tele.ntnu.no> wrote:
> On Jun 9, 1:50&#4294967295;pm, brent <buleg...@columbus.rr.com> wrote: > > > > > > > > > > > I am working on a program to display a noise signal. &#4294967295;It contains 100 > > random amplitude sine waves and 100 random amplitude cosine waves from > > 1-100 Hz. &#4294967295;I am trying to refresh the screen with the wave form as > > fast as I can. &#4294967295;each waveform is 400 points long. &#4294967295;This is > > computationally a real processor hog. &#4294967295;I have stored all 100 sine > > waves and 100 cosine waves in an array so I am just applying the > > random number creation to each wave and summing them up. &#4294967295;I am doing > > this brute force, but i have somewhat optimized what I have done thus > > far. (BTW my random amplitude is done by summing three random number > > generations together to try to achieve a more Gaussian distribution on > > the amplitudes) > > > I am using 40% of my computer processor to refresh this 1 time per > > second. ( I deliberately use a somewhat crummy computer when doing > > this) > > > Any ideas for creating a computationally efficient noise in the time > > domain that contains 100 frequencies and actually looks like noise > > when its done? > > If you want a *noise* signal, use a random number generator. > > If you want a sum-of-sines signal, use a look-up table. > > Rune
I am currently doing a sum of sines and I am using a lookup table to store all the sine values of the 200 sine/cosine waves from 1-100 Hz. I want to use sum of sines so that the end user (this will be a noise tutorial) can take out frequencies (use filtering) and see the effect on the noise signal. I apply a random process to apply an aplitude to each sine/cosine. I see a lot of good information in this thread about how to properly build noise with random processes, but i think i need the sum of sines/cosines approach. Oh well, I will probably have to limit the update rate to once per second. Thanks all.
You could use an inverse FFT to generate a time waveform with defined frequency content. Apply your random numbers to the complex bin values.

john
On Jun 11, 7:13&#4294967295;am, John <sampson...@gmail.com> wrote:
> You could use an inverse FFT to generate a time waveform with defined frequency content. Apply your random numbers to the complex bin values. > > john
I have thought about that a little bit. I would need a 512 point FFT. I have written a 64 point FFT that comfortably runs 10-15 times per second. I have not looked up how much extra processing a 512 point would take, but I am afraid that a 512 is more than 10 times longer than a 64 point FFT. thanks for the idea brent
On 11-06-2011 @ 12:54:28 brent <bulegoge@columbus.rr.com> wrote:

(...)
> I want to use sum of sines so that the end user (this will be a noise > tutorial) can take out frequencies (use filtering) and see the effect > on the noise signal.
(...) So you don't need sum of sines to filter out a little bit of perfect noise. Or you measure the energy of noise.... I'm interested about effects of filtering noise and what it has common to do with a method of generating it. -- Mikolaj
>On Jun 9, 2:45=A0pm, "taks" <mtakatz@n_o_s_p_a_m.verasent.com> wrote: >> >Z1 =3D sqrt(-2 * log(R1)) * cos(2 * pi * R2); % MATLAB syntax >> >Z2 =3D sqrt(-2 * log(R2)) * sin(2 * pi * R2); >> >> I should add that though these equations can be found on the web in
vario=
>us >> places, I actually got them out of "Discrete-Event System Simulation"
by
>> Jerry Banks, et al. =A0Not a bad text I might add. >> >> Mark > >Is there a typo in these equations (as published in comp.dsp) >or are they an exact copy of what is in the text cited, in which >case the typo is in the textbook, and is being reproduced here?
Typo - my bad. The 2nd equation should be log(R1). Mark
>1. Your formulae are wrong.
Only the typo is incorrect. If this is being generated on a floating point machine, the use of doubles will resolve the tails issue. Mark
>>1. Your formulae are wrong. > >Only the typo is incorrect. If this is being generated on a floating
point
>machine, the use of doubles will resolve the tails issue. > >Mark >
One problem you need to be aware of is the possibility of actually getting a 0 in R1. The frequency of such an occurrence is obviously reduced with higher precision in R1 (the "tails" issue.) I saw an iterative approach online once but I don't recall if it was simply checking for a 0 (IIRC, it was a bit more than that.) I have not tried VV's approach before - this was in a class I taught out of the text I referenced (Banks did not refer to it as the B-M method, oddly, though I have seen that online as well.) Mark
On Jun 11, 12:54&#4294967295;pm, brent <buleg...@columbus.rr.com> wrote:
> On Jun 9, 7:54&#4294967295;am, Rune Allnor <all...@tele.ntnu.no> wrote: > > > > > > > On Jun 9, 1:50&#4294967295;pm, brent <buleg...@columbus.rr.com> wrote: > > > > I am working on a program to display a noise signal. &#4294967295;It contains 100 > > > random amplitude sine waves and 100 random amplitude cosine waves from > > > 1-100 Hz. &#4294967295;I am trying to refresh the screen with the wave form as > > > fast as I can. &#4294967295;each waveform is 400 points long. &#4294967295;This is > > > computationally a real processor hog. &#4294967295;I have stored all 100 sine > > > waves and 100 cosine waves in an array so I am just applying the > > > random number creation to each wave and summing them up. &#4294967295;I am doing > > > this brute force, but i have somewhat optimized what I have done thus > > > far. (BTW my random amplitude is done by summing three random number > > > generations together to try to achieve a more Gaussian distribution on > > > the amplitudes) > > > > I am using 40% of my computer processor to refresh this 1 time per > > > second. ( I deliberately use a somewhat crummy computer when doing > > > this) > > > > Any ideas for creating a computationally efficient noise in the time > > > domain that contains 100 frequencies and actually looks like noise > > > when its done? > > > If you want a *noise* signal, use a random number generator. > > > If you want a sum-of-sines signal, use a look-up table. > > > Rune > > I am currently doing a sum of sines and I am using a lookup table to > store all the sine values of the 200 sine/cosine waves from 1-100 Hz. > I want to use sum of sines so that the end user (this will be a noise > tutorial) can take out frequencies (use filtering) and see the effect > on the noise signal. &#4294967295;I apply a random process to apply an aplitude to > each sine/cosine. &#4294967295;I see a lot of good information in this thread > about how to properly build noise with random processes, but i think i > need the sum of sines/cosines approach. &#4294967295;Oh well, I will probably have > to limit the update rate to once per second.
If this is a demo, I'd rather relax on the on-line requirement. Instead of an online app, I'd model the data in memory once (maybe 30-60 seconds worth of data) and then display those data in a loop. If / when the user plays with the bandwidth, model again and start a new loop. Rune