DSPRelated.com
Forums

Secondary path identification in Anti noise control..

Started by knaresh.eee September 13, 2006
hello..
 i am working on ANC. here I need to identify the secondary path, directly
i can say that it is a system identification..For this i need to generate
white noise in C program.And generated signal is given to loud speaker and
output is collected from microphone..this input and out put data must be
used to train my system( system model is FIR)...

here my first problem is i am not able to generate gaussian white noise in
C program and second problem is i have used (rand()/rand_max) to generate
white noise..but my algo(LMS) is not able to estimate the filter
coefficients even if i change updating coefficient(MU)...i mean error is
almost = 50%....

 please help out ....

regds 
Naresh.


Dear Naresh,

You should not work on LMS if you don't know how to generate the 
gaussian noise. Go learn the basics.

VLV


knaresh.eee wrote:

> hello.. > i am working on ANC. here I need to identify the secondary path, directly > i can say that it is a system identification..For this i need to generate > white noise in C program.And generated signal is given to loud speaker and > output is collected from microphone..this input and out put data must be > used to train my system( system model is FIR)... > > here my first problem is i am not able to generate gaussian white noise in > C program and second problem is i have used (rand()/rand_max) to generate > white noise..but my algo(LMS) is not able to estimate the filter > coefficients even if i change updating coefficient(MU)...i mean error is > almost = 50%.... > > please help out .... > > regds > Naresh. > >
> i am working on ANC.
Amazing! You're working on this and you don't know it means *Active* Noise Control (and not Anti, as the subject says) :-)
> here my first problem is i am not able to generate gaussian white noise
Of course you are able -- you just have not found the way (more below).
> C program and second problem is i have used (rand()/rand_max) to generate > white noise..
Ok. Sanity check: You obviously didn't use exactly the above expression, since it wouldn't compile; but did you mean that you're using *exactly* the expression, rand()/RAND_MAX in your program? You are aware that that expression unconditionally evaluates to 0, right? (hint: integer division). Also, that does not produce *zero-mean* white noise. You'd have to subtract 0.5 to the above. But while you're at it, you could add several randomly generated, uniformly-distributed values to obtain a quasi- Gaussian (the more you add, the better it approximates a Gaussian distribution). I have this example that I've used with good results: double g_rand (double mean, double variance) { double rnd = 0; for (int i = 0; i < 48; i++) { rnd += drand48(); } return mean + (rnd - 24) * sqrt (variance / 4); } Notice that I'm using drand48(), which does a better job at producing pseudo-random numbers (I believe it's only available on Unix-like platforms), and gives me a floating-point value between 0 and 1 (0 inclusively, 1 non-inclusively). Worst-case, you could replace the above drand48() by (rand() / (1.0 + RAND_MAX)) I think you can get a good approximation with much less than 48 instances. HTH, Carlos --
Carlos Moreno wrote:
>
...
> I think you can get a good approximation with much > less than 48 instances.
IIRC, 12 is considered deluxe, and 6 is fine for most work. Google gives definitive discussion. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins wrote:

>> I think you can get a good approximation with much >> less than 48 instances. > > IIRC, 12 is considered deluxe, and 6 is fine for most work.
Exactly -- it depends on what you're doing with it; the code I posted was used in a simulation where I needed to guarantee that I would get values of noise extremely large *with the right probability* (for that application, 24 did count as extremely large). Cheers, Carlos --