Jump to content

Generating white noise with cut-off frequency

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
elsesma

elsesma

    Newbie

  • Members
  • Pip
  • 4 posts
Hi to all,
i'm a phisicist and i need to generate in c, c++ a source of white noise but with a cut-off frequency.
Can anybody help me?

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Before worrying about the language, I would worry about the algorithm. Perhaps selecting 20 random frequencies/amplitudes and merging them together? You would need to characterize what counts as "white noise" a little more precisely for those of us who are not physicists.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
look up the Boxcar algorithm. normally used in WAV samples, but it can be applied to near any waveform.

#4
elsesma

elsesma

    Newbie

  • Members
  • Pip
  • 4 posts
yes, sorry, i wasn't that clear, also becouse there are a lot of misunderstanding about what white noise would mean.
In my case i mean a signal made (theoretically) of the whole continuum spectrum of frequencies in the range (0:F], where F is my cutoff frequency and with each frequency having the same intensity (so that the power spectrum is constant and, in particular, i will require that the integral over the spectrum is one ).
In the case i don't have a cutpff frequency, i would just use the pseudo-random number generator of c/c++.
So, what do you think is the best way to implement it?
Thank you

#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I would use the pseudo-random number generator, which produces a number in the range [0,1] if I remember correctly, and multiply the result by F.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#6
elsesma

elsesma

    Newbie

  • Members
  • Pip
  • 4 posts
mmm, that not for shure. That way i will get i a pseudorandom number between 0 and F...

Anyway i'm doing this by fourier trasformation and some integrals, but it's sooo sloooowwww

#7
elsesma

elsesma

    Newbie

  • Members
  • Pip
  • 4 posts
ah, i was forgetting:
i look up for the boxcar algorithm, but didn't find anything about wave form. Do you have some direct link?