noise simulation examples
This commit is contained in:
parent
d53acbed8e
commit
33e17fa969
|
|
@ -0,0 +1,25 @@
|
|||
baker-252 enhanced
|
||||
* simple noiseless opamp with RC feedback
|
||||
* compare E source and code model gain stage
|
||||
* ngspice-40+ required
|
||||
|
||||
.control
|
||||
set sqrnoise
|
||||
noise V(vout) Vplus dec 100 1 1000G
|
||||
print all
|
||||
noise V(vouta) Vplusa dec 100 1 1000G
|
||||
print all
|
||||
.endc
|
||||
|
||||
Vplus Vplus 0 dc 0 ac 1
|
||||
Rf vout vminus 100k
|
||||
Cf vout vminus 1000p
|
||||
Eopamp vout 0 vplus vminus 100Meg
|
||||
|
||||
Vplusa Vplusa 0 dc 0 ac 1
|
||||
Rfa vouta vminusa 100k
|
||||
Cfa vouta vminusa 1000p
|
||||
a1 %vd(vplusa, vminusa) vouta amp
|
||||
.model amp gain(gain=1e8)
|
||||
|
||||
.end
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
* noise of a resistive divider
|
||||
* noise of a resistive divider, lower resistor noiseless
|
||||
* noise of a resistive divider with filter
|
||||
* 'set behavior = lta' is required
|
||||
|
||||
V1 1 0 dc 0 ac 1
|
||||
R1 1 2 10k
|
||||
R2 2 0 10k
|
||||
|
||||
V11 11 0 dc 0 ac 1
|
||||
R11 11 12 10k
|
||||
R12 12 0 10k noiseless
|
||||
|
||||
V21 21 0 dc 0 ac 1
|
||||
R21 21 22 10k
|
||||
R22 22 0 10k
|
||||
C22 22 0 1u
|
||||
|
||||
.control
|
||||
noise v(2) V1 dec 10 1 100k
|
||||
echo **resistive divider**
|
||||
print onoise_total inoise_total
|
||||
setplot noise1
|
||||
print onoise_spectrum[0] inoise_spectrum[0]
|
||||
noise v(12) V11 dec 10 1 100k
|
||||
echo **resistive divider, lower resistor noiseless**
|
||||
print onoise_total inoise_total
|
||||
setplot noise3
|
||||
print onoise_spectrum[0] inoise_spectrum[0]
|
||||
noise v(22) V21 dec 10 1 100k
|
||||
echo **resistive divider with filter**
|
||||
print onoise_total inoise_total
|
||||
setplot noise5
|
||||
print onoise_spectrum[0] inoise_spectrum[0]
|
||||
set xbrushwidth=2
|
||||
plot onoise_spectrum inoise_spectrum xlimit 1 1e5
|
||||
.endc
|
||||
|
||||
.end
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
*noise of a resistive divider
|
||||
*noise of a resistive divider with filter
|
||||
*noise as above after a noiseless amplifier with gain 5
|
||||
|
||||
V1 1 0 dc 0 ac 1
|
||||
R1 1 2 10k
|
||||
R2 2 0 10k
|
||||
|
||||
V21 21 0 dc 0 ac 1
|
||||
R21 21 22 10k
|
||||
R22 22 0 10k
|
||||
C22 22 0 1u
|
||||
|
||||
a1 2 3 amp
|
||||
.model amp gain(in_offset = 0 gain = 5.0
|
||||
+ out_offset = 0)
|
||||
|
||||
a2 22 23 amp
|
||||
|
||||
.control
|
||||
|
||||
noise v(2) V1 dec 10 1 100k
|
||||
print onoise_total inoise_total
|
||||
setplot noise1
|
||||
print onoise_spectrum[0] inoise_spectrum[0]
|
||||
|
||||
noise v(3) V1 dec 10 1 100k
|
||||
print onoise_total inoise_total
|
||||
setplot noise3
|
||||
print onoise_spectrum[0] inoise_spectrum[0]
|
||||
|
||||
noise v(22) V21 dec 10 1 100k
|
||||
print onoise_total inoise_total
|
||||
setplot noise5
|
||||
print onoise_spectrum[0] inoise_spectrum[0]
|
||||
|
||||
noise v(23) V21 dec 10 1 100k
|
||||
print onoise_total inoise_total
|
||||
setplot noise7
|
||||
print onoise_spectrum[0] inoise_spectrum[0]
|
||||
set xbrushwidth = 2
|
||||
plot onoise_spectrum noise5.onoise_spectrum inoise_spectrum xlimit 1 1e5
|
||||
|
||||
.endc
|
||||
|
||||
.end
|
||||
|
||||
|
||||
Loading…
Reference in New Issue