On Jun 9, 7:54�am, Rune Allnor <all...@tele.ntnu.no> wrote:> On Jun 9, 1:50�pm, brent <buleg...@columbus.rr.com> wrote: > > > > > > > > > > > I am working on a program to display a noise signal. �It contains 100 > > random amplitude sine waves and 100 random amplitude cosine waves from > > 1-100 Hz. �I am trying to refresh the screen with the wave form as > > fast as I can. �each waveform is 400 points long. �This is > > computationally a real processor hog. �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. �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. > > RuneI 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.
Noise modeling ideas
Started by ●June 9, 2011
Reply by ●June 11, 20112011-06-11
Reply by ●June 11, 20112011-06-11
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
Reply by ●June 11, 20112011-06-11
On Jun 11, 7:13�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. > > johnI 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
Reply by ●June 13, 20112011-06-13
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
Reply by ●June 13, 20112011-06-13
>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 invario=>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
Reply by ●June 13, 20112011-06-13
>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
Reply by ●June 13, 20112011-06-13
>>1. Your formulae are wrong. > >Only the typo is incorrect. If this is being generated on a floatingpoint>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
Reply by ●June 13, 20112011-06-13
On Jun 11, 12:54�pm, brent <buleg...@columbus.rr.com> wrote:> On Jun 9, 7:54�am, Rune Allnor <all...@tele.ntnu.no> wrote: > > > > > > > On Jun 9, 1:50�pm, brent <buleg...@columbus.rr.com> wrote: > > > > I am working on a program to display a noise signal. �It contains 100 > > > random amplitude sine waves and 100 random amplitude cosine waves from > > > 1-100 Hz. �I am trying to refresh the screen with the wave form as > > > fast as I can. �each waveform is 400 points long. �This is > > > computationally a real processor hog. �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. �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.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






