Newsgroups: comp.speech
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!gatech!rutgers!uwvax!sinetnews!news.u-tokyo.ac.jp!wnoc-tyo-news!aist-nara!wnoc-kyo-news!atrwide!atr-la!mac51.itl.atr.co.jp!user
From: lenzo@itl.atr.co.jp (Kevin A. Lenzo)
Subject: Re: Looking for white/pink noise C-Algorithms
Message-ID: <lenzo-2411941555020001@mac51.itl.atr.co.jp>
Sender: news@itl.atr.co.jp (USENET News System)
Nntp-Posting-Host: mac51
Organization: Interpreting Telecom. Research Labs of ATR
References: <plaggmi.7.000EBFC2@asterix.uni-muenster.de>
X-Rank-And-File: Never
Date: Thu, 24 Nov 1994 06:55:02 GMT
Lines: 33

In article <plaggmi.7.000EBFC2@asterix.uni-muenster.de>,
plaggmi@asterix.uni-muenster.de (Michael Plagge) wrote:

> I need C-Algorithms to produce white and pink noise signals for a 
> psychological experiment. So if you know a ftp-site for source-code or if you 
> know algorithms yourself, please send them to me. Thank you :-)

I once participated in an experiment with speech.  There is a 
known name for this technique, as simple as it is, but it
escapes me right now.

What they did was choose a weighting factor, which was essentially
the probability that the sign of each sample in the input would be
flipped.  This preserves magnitude information but breaks up the
continuous signal.  It may not be what you are looking for, since
you are asking for white or pink noise, but give it a try.  Perhaps
some kind soul will post a reference for the phenomenon in follow-up.


pseudocode:

choose probability of flipping -> call if p_flip

for i = 1 to # of samples in target region
{
   if (random >= p_flip) sample[i] = -sample[i];
}


That's it.  

kevin
lenzo@itl.atr.co.jp
