Re: [ng-spice] Inconsistent repeat noise analyses
> In testing the problem I discovered a more glaring error, namely that the
> results of two identical noise analyses performed in succession do not
> necessarily yield the same results. This sounds like an error caused by
> uninitialised variables or storage. In fact I have just tried running the
> same analysis three times in succession, all noises in the second analysis
> are double those of the first, and in the third analysis are three times
> the noise of the first. This pattern pattern is, however, not in itself
> consistent.
I'm not sure if my information is directly related to this problem or not.
When I was working with the original Berkeley 3F5 source code (not sure how
close the ng-spice noise analysis is to this), I found that the noise
analysis was making use of uninitialized memory during its calculation. I
discovered this error when I was running the simulation engine in a loop and
the noise analysis was causing segmentation faults. I'm not sure why it does
not segfault during a single run because the array indexing done in the noise
analysis goes beyond the bounds of the malloc'ed memory.
Anyway, at the time I was more interested in getting the thing to run and not
so much in getting correct results. I simply extended some of the arrays and
the problems disappeared. I never had a chance to return to the problem to
verify whether everything was correct.
Reid
Partial thread listing: