Jspice3
Main Page
Data Structures
Files
File List
Globals
noisedef.h
Go to the documentation of this file.
1
/***************************************************************************
2
JSPICE3 adaptation of Spice3e2 - Copyright (c) Stephen R. Whiteley 1992
3
Copyright 1990 Regents of the University of California. All rights reserved.
4
Authors: 1987 Gary W. Ng
5
1992 Stephen R. Whiteley
6
****************************************************************************/
7
8
#ifndef NOISEDEFS
9
#define NOISEDEFS
10
11
#include "
analysis.h
"
12
13
14
/* structure used to carry information between subparts
15
* of the noise analysis code
16
*/
17
18
typedef
struct
{
19
double
freq
;
20
double
lstFreq
;
21
double
delFreq
;
22
double
outNoiz
;
/* integrated output noise as of last frequency point */
23
double
inNoise
;
/* integrated input noise as of last frequency point */
24
double
GainSqInv
;
25
double
lnGainInv
;
26
double
lnFreq
;
27
double
lnLastFreq
;
28
double
delLnFreq
;
29
int
outNumber
;
/* keeps track of the current output variable */
30
int
numPlots
;
/* keeps track of the number of active plots so we can
31
close them in loop. */
32
unsigned
int
prtSummary
;
33
double
*
outpVector
;
/* pointer to our array of noise outputs */
34
GENERIC
*
NplotPtr
;
/* the plot pointer */
35
IFuid
*
namelist
;
/* list of plot names */
36
}
Ndata
;
37
38
39
/* structure used to describe an noise analysis */
40
41
typedef
struct
{
42
int
JOBtype
;
43
JOB
*
JOBnextJob
;
/* pointer to next thing to do */
44
char
*
JOBname
;
/* name of this job */
45
char
*
Noutput
;
/* name of the noise output summation node */
46
char
*
NoutputRef
;
/* name of the noise output reference node */
47
char
*
Ninput
;
/* name of AC source used to input ref. the noise */
48
double
NsavOnoise
;
/* integrated output noise when we left last time */
49
double
NsavInoise
;
/* integrated input noise when we left last time */
50
int
NStpsSm
;
/* number of steps before we output a noise summary report */
51
Ndata
*
NdataPtr
;
/* pointer to substructure for subroutines */
52
int
NposOutNode
;
/* node numbers for output */
53
int
NnegOutNode
;
54
int
Nstep
;
/* step count, for summary print */
55
struct
sACprms
AC;
/* AC parameter storage */
56
struct
sDCTprms
DC;
/* DC parameter storage */
57
}
NOISEAN
;
58
59
60
/* codes for saving and retrieving integrated noise data */
61
62
#define LNLSTDENS 0
/* array loc that log of the last noise density stored */
63
#define OUTNOIZ 1
/* array loc that integrated output noise is stored */
64
#define INNOIZ 2
/* array loc that integrated input noise is stored */
65
66
#ifndef NSTATVARS
67
#define NSTATVARS 3
/* number of "state" variables that must be stored for
68
each noise generator.
69
in this case it is three: LNLSTDENS, OUTNOIZ
70
and INNOIZ */
71
#endif
72
73
/* noise analysis parameters */
74
75
#define N_OUTPUT 1
76
#define N_OUTREF 2
77
#define N_INPUT 3
78
#define N_PTSPERSUM 4
79
80
81
/* noise routine operations/modes */
82
83
#define N_DENS 1
84
#define INT_NOIZ 2
85
#define N_OPEN 1
86
#define N_CALC 2
87
#define N_CLOSE 3
88
#define SHOTNOISE 1
89
#define THERMNOISE 2
90
#define N_GAIN 3
91
92
93
/* tolerances and limits to make numerical analysis more robust */
94
95
#define N_MINLOG 1E-38
96
/* the smallest number we can take the log of */
97
98
99
#define N_MINGAIN 1E-20
100
/* the smallest input-output gain we can tolerate
101
* (to calculate input-referred noise we divide
102
* the output noise by the gain)
103
*/
104
105
#define N_INTFTHRESH 1E-10
106
/* the largest slope (of a log-log noise spectral
107
* density vs. freq plot) at which the noise
108
* spectum is still considered flat. (no need for
109
* log curve fitting)
110
*/
111
112
#define N_INTUSELOG 1E-10
113
/* decides which expression to use for the integral of
114
* x**k. If k is -1, then we must use a 'ln' form.
115
* Otherwise, we use a 'power' form. This
116
* parameter is the region around (k=) -1 for which
117
* use the 'ln' form.
118
*/
119
120
121
/* misc constants */
122
123
/* maximum length for noise output variables we will generate */
124
#define N_MXVLNTH 64
125
126
127
#ifdef __STDC__
128
extern
int
NOISEan
(
GENERIC
*,
int
);
129
extern
int
NOISEaskQuest
(
GENERIC
*,
GENERIC
*,
int
,
IFvalue
*);
130
extern
int
NOISEparse
(
GENERIC
*,
GENERIC
*,
int
,
GENERIC
*,
char
**,
GENERIC
*,
GENERIC
*);
131
extern
int
NOISEsetParm
(
GENERIC
*,
GENERIC
*,
int
,
IFvalue
*);
132
extern
void
NevalSrc
(
double
*,
double
*,
CKTcircuit
*,
int
,
int
,
int
,
double
);
133
extern
double
Nintegrate
(
double
,
double
,
double
,
GENERIC
*);
134
#else
135
extern
int
NOISEan
();
136
extern
int
NOISEaskQuest
();
137
extern
int
NOISEparse
();
138
extern
int
NOISEsetParm
();
139
extern
void
NevalSrc
();
140
extern
double
Nintegrate
();
141
#endif
142
143
144
#endif
/* NOISEDEFS */
Ndata::delLnFreq
double delLnFreq
Definition:
noisedef.h:28
NOISEparse
int NOISEparse()
Ndata::outpVector
double * outpVector
Definition:
noisedef.h:33
NOISEAN::Ninput
char * Ninput
Definition:
noisedef.h:47
Ndata::lstFreq
double lstFreq
Definition:
noisedef.h:20
NOISEAN::NnegOutNode
int NnegOutNode
Definition:
noisedef.h:53
CKTcircuit
Definition:
cktdefs.h:62
Ndata::lnLastFreq
double lnLastFreq
Definition:
noisedef.h:27
Ndata::namelist
IFuid * namelist
Definition:
noisedef.h:35
NevalSrc
void NevalSrc()
sACprms
Definition:
analysis.h:59
Ndata::lnGainInv
double lnGainInv
Definition:
noisedef.h:25
NOISEAN::JOBtype
int JOBtype
Definition:
noisedef.h:42
sJOB
Definition:
cktdefs.h:23
NOISEAN::JOBnextJob
JOB * JOBnextJob
Definition:
noisedef.h:43
IFuid
GENERIC * IFuid
Definition:
ifsim.h:72
Ndata::prtSummary
unsigned int prtSummary
Definition:
noisedef.h:32
Ndata::NplotPtr
GENERIC * NplotPtr
Definition:
noisedef.h:34
NOISEAN::NoutputRef
char * NoutputRef
Definition:
noisedef.h:46
NOISEAN::Nstep
int Nstep
Definition:
noisedef.h:54
analysis.h
NOISEAN
Definition:
noisedef.h:41
Ndata::lnFreq
double lnFreq
Definition:
noisedef.h:26
Nintegrate
double Nintegrate()
NOISEan
int NOISEan()
Ndata::GainSqInv
double GainSqInv
Definition:
noisedef.h:24
NOISEAN::JOBname
char * JOBname
Definition:
noisedef.h:44
Ndata::outNumber
int outNumber
Definition:
noisedef.h:29
NOISEAN::NposOutNode
int NposOutNode
Definition:
noisedef.h:52
uIFvalue
Definition:
ifsim.h:231
Ndata::numPlots
int numPlots
Definition:
noisedef.h:30
NOISEAN::NStpsSm
int NStpsSm
Definition:
noisedef.h:50
NOISEAN::NsavOnoise
double NsavOnoise
Definition:
noisedef.h:48
NOISEsetParm
int NOISEsetParm()
Ndata::delFreq
double delFreq
Definition:
noisedef.h:21
Ndata::outNoiz
double outNoiz
Definition:
noisedef.h:22
Ndata::inNoise
double inNoise
Definition:
noisedef.h:23
Ndata::freq
double freq
Definition:
noisedef.h:19
sDCTprms
Definition:
analysis.h:26
NOISEAN::NsavInoise
double NsavInoise
Definition:
noisedef.h:49
NOISEaskQuest
int NOISEaskQuest()
NOISEAN::Noutput
char * Noutput
Definition:
noisedef.h:45
NOISEAN::NdataPtr
Ndata * NdataPtr
Definition:
noisedef.h:51
GENERIC
char GENERIC
Definition:
ifsim.h:27
Ndata
Definition:
noisedef.h:18
src
include
noisedef.h
Generated by
1.8.11