LTspice introduction - 15 NPN型三极管的伏安特性

Version 4
SHEET 1 2612 1528
WIRE 2128 1152 1984 1152
WIRE 1984 1200 1984 1152
WIRE 2128 1216 2128 1152
WIRE 1920 1248 1840 1248
WIRE 1840 1264 1840 1248
WIRE 1840 1360 1840 1344
WIRE 1984 1360 1984 1296
WIRE 2128 1360 2128 1296
FLAG 2128 1360 0
FLAG 1984 1360 0
FLAG 1840 1360 0
SYMBOL npn 1920 1200 R0
SYMATTR InstName Q1
SYMATTR Value 2N2222
SYMBOL voltage 2128 1200 R0
SYMATTR InstName V1
SYMATTR Value 0.
SYMBOL current 1840 1344 M180
WINDOW 0 23 79 Left 2
WINDOW 3 24 0 Left 2
SYMATTR InstName I1
SYMATTR Value 0.
TEXT 1824 1408 Left 2 !.dc V1 0 15 10m I1 20u 100u 20u
TEXT 1992 1448 Top 1 ;This example schematic is supplied for informational/educational purposes only.

将以上内容保存成2V-I-Curve_NPN_DC_sweep.asc文件,用LTspice打开,然后执行Run进行仿真,结果如下:

LTspice introduction - 14 结型场效应晶体管的伏安特性

Version 4
SHEET 1 2612 1528
WIRE 2128 1152 1984 1152
WIRE 1984 1200 1984 1152
WIRE 2128 1216 2128 1152
WIRE 1920 1248 1840 1248
WIRE 1840 1264 1840 1248
WIRE 1920 1264 1920 1248
WIRE 1936 1264 1920 1264
WIRE 1840 1360 1840 1344
WIRE 1984 1360 1984 1296
WIRE 2128 1360 2128 1296
FLAG 2128 1360 0
FLAG 1984 1360 0
FLAG 1840 1360 0
SYMBOL voltage 2128 1200 R0
SYMATTR InstName V1
SYMATTR Value 0.
SYMBOL njf 1936 1200 R0
SYMATTR InstName J1
SYMATTR Value 2N3819
SYMBOL voltage 1840 1248 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V2
SYMATTR Value 0
TEXT 1824 1408 Left 2 !.dc V1 0 15 10m V2 -5 0 100mV
TEXT 1992 1448 Top 1 ;This example schematic is supplied for informational/educational purposes only.

将以上内容保存成2V-I-Curve_JFET_DC_sweep.asc文件,用LTspice打开,然后执行Run进行仿真,结果如下:

LTspice introduction - 13 场效应晶体管的伏安特性

Version 4
SHEET 1 2612 1528
WIRE 2128 1152 1984 1152
WIRE 1984 1200 1984 1152
WIRE 2128 1216 2128 1152
WIRE 1920 1248 1840 1248
WIRE 1840 1264 1840 1248
WIRE 1920 1264 1920 1248
WIRE 1936 1264 1920 1264
WIRE 1840 1360 1840 1344
WIRE 1984 1360 1984 1296
WIRE 2128 1360 2128 1296
FLAG 2128 1360 0
FLAG 1984 1360 0
FLAG 1840 1360 0
SYMBOL voltage 2128 1200 R0
SYMATTR InstName V1
SYMATTR Value 0.
SYMBOL njf 1936 1200 R0
SYMATTR InstName J1
SYMATTR Value 2N3819
SYMBOL voltage 1840 1248 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V2
SYMATTR Value 0
TEXT 1824 1408 Left 2 !.dc V1 0 15 10m V2 -5 0 100mV
TEXT 1992 1448 Top 1 ;This example schematic is supplied for informational/educational purposes only.

将以上内容保存成2V-I-Curve_FET_DC_sweep.asc文件,然后用LTspice打开,执行Run进行仿真,结果如下:

LTspice introduction - 12 二极管的伏安特性

Version 4
SHEET 1 880 680
WIRE 112 32 -80 32
WIRE -80 96 -80 32
WIRE 112 112 112 32
WIRE -80 240 -80 176
WIRE 112 240 112 176
WIRE 112 240 -80 240
WIRE 112 272 112 240
FLAG 112 272 0
SYMBOL voltage -80 80 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value 5
SYMBOL diode 96 112 R0
SYMATTR InstName D1
SYMATTR Value 1N914
TEXT 144 232 Left 2 !.dc V1 -550mV 750mV 10mV

将以上内容保存成2V-I-Curve_Diode_DC_sweep.asc文件,然后用LTspice打开,执行Run进行仿真,结果如下:

LTspice introduction - 11 LPF的FFT

Version 4
SHEET 1 1804 680
WIRE 64 160 -16 160
WIRE 208 160 144 160
WIRE -16 192 -16 160
WIRE 208 192 208 160
WIRE -16 320 -16 272
WIRE 208 320 208 256
WIRE 208 320 -16 320
WIRE -16 336 -16 320
FLAG -16 336 0
SYMBOL cap 192 192 R0
SYMATTR InstName C1
SYMATTR Value 10nF
SYMBOL res 160 144 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 10k
SYMBOL voltage -16 176 R0
WINDOW 3 24 152 Left 2
WINDOW 123 24 124 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value PULSE(0 1 0 1n 1n 0.5ms 1ms)
TEXT 448 168 Left 2 ;a) The simulation time of 20ms is an integer multiple of the signal’s period time (1ms). \nb) A maximum time step(in .tran command) of 100ns is corresponding to a minimum sample frequency of 1/100ns=5MHz\nThis gives a Shannon corner frequency of 0.5 x sample frequency, this frequency >> 1MHz(input frequency)\nc) The number of true samples is 20ms / 100ns = 200 000. So we enter  131 072(=2^17) sampled data points in time
TEXT -50 380 Left 2 !.options plotwinsize=0\n.tran 0 20ms 0 100ns

将以上内容保存成1RC_lowpass_fft.asc文件。

[Transient Analysis]
{
   Npanes: 2
   Active Pane: 1
   {
      traces: 1 {524290,0,"V(n001)"}
      X: ('m',0,0,0.002,0.02)
      Y[0]: (' ',1,0,0.1,1)
      Y[1]: ('_',0,1e+308,0,-1e+308)
      Volts: (' ',0,0,1,0,0.1,1)
      Log: 0 0 0
      GridStyle: 1
   },
   {
      traces: 1 {524291,0,"V(n002)"}
      X: ('m',0,0,0.002,0.02)
      Y[0]: (' ',1,0,0.1,1)
      Y[1]: ('_',0,1e+308,0,-1e+308)
      Volts: (' ',0,0,1,0,0.1,1)
      Log: 0 0 0
      GridStyle: 1
   }
}

将以上内容保存成1RC_lowpass_fft.plt文件,然后执行Run进行仿真,结果如下:

然后再Waveform Viewer中右键View–> FFT,打开FFT设置对话框,输入你需要的参数,如下图:

然后点击OK,会出现FFT之后的结果:

LTspice introduction - 10 LPF周期信号响应

Version 4
SHEET 1 1672 680
WIRE 64 160 -16 160
WIRE 208 160 144 160
WIRE -16 192 -16 160
WIRE 208 192 208 160
WIRE -16 320 -16 272
WIRE 208 320 208 256
WIRE 208 320 -16 320
WIRE -16 336 -16 320
FLAG -16 336 0
SYMBOL cap 192 192 R0
SYMATTR InstName C1
SYMATTR Value 10nF
SYMBOL res 160 144 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 10k
SYMBOL voltage -16 176 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value SINE(0 1 1591 0 0 0 0)
TEXT 448 168 Left 2 ;the coner frequency for this LPF is 1/2*pie*R*C=1591
TEXT -50 380 Left 2 !.tran 2ms

将以上内容保存成1RC_lowpass_periodic.asc文件,然后执行Run进行仿真,结果如下:

LTspice introduction - 9 LPF的频域响应

Version 4
SHEET 1 1672 680
WIRE 64 160 -16 160
WIRE 208 160 144 160
WIRE -16 192 -16 160
WIRE 208 192 208 160
WIRE -16 320 -16 272
WIRE 208 320 208 256
WIRE 208 320 -16 320
WIRE -16 336 -16 320
FLAG -16 336 0
SYMBOL cap 192 192 R0
SYMATTR InstName C1
SYMATTR Value 10nF
SYMBOL res 160 144 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 10k
SYMBOL voltage -16 176 R0
WINDOW 123 24 124 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value ""
SYMATTR Value2 AC 1 0
TEXT 448 168 Left 2 ;keep the amp and phase not change, then check the freq response
TEXT -50 380 Left 2 !.ac dec 101 1 10k

将以上内容保存成1RC_lowpass_periodic_freq.asc文件,然后执行Run进行仿真,结果如下:

LTspice introduction - 8 LPF的瞬态响应(switch)

Version 4
SHEET 1 1672 680
WIRE 64 160 -16 160
WIRE 208 160 144 160
WIRE -16 192 -16 160
WIRE 208 192 208 160
WIRE -16 320 -16 272
WIRE 208 320 208 256
WIRE 208 320 -16 320
WIRE -16 336 -16 320
FLAG -16 336 0
SYMBOL cap 192 192 R0
SYMATTR InstName C1
SYMATTR Value 10nF
SYMBOL res 160 144 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 10k
SYMBOL voltage -16 176 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value PWL(0 0 1n 1 1m 1 1.000001m 0)
TEXT 224 360 Left 2 !.tran 2ms
TEXT 504 160 Left 2 ;transient simulation in the time domain and let the input voltage jump in a very short time from 0 to +1V.\nPWL: define the value for specified time;\nthe thrid point is: 1 milisencond still maintain 1 vlotage;\nthe forth point is: 1.000001 milisencond quickly drop to vlotage;

将以上内容保存成1RC_lowpass_transient_switch.asc文件,然后执行Run进行仿真,结果如下:

LTspice introduction - 7 LPF的瞬态响应

Version 4
SHEET 1 1400 680
WIRE 64 160 -16 160
WIRE 208 160 144 160
WIRE -16 192 -16 160
WIRE 208 192 208 160
WIRE -16 320 -16 272
WIRE 208 320 208 256
WIRE 208 320 -16 320
WIRE -16 336 -16 320
FLAG -16 336 0
SYMBOL cap 192 192 R0
SYMATTR InstName C1
SYMATTR Value 10nF
SYMBOL res 160 144 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 10k
SYMBOL voltage -16 176 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value PWL(0 0 1n 1)
TEXT 224 360 Left 2 !.tran 2ms
TEXT 232 336 Left 2 ;transient simulation in the time domain and let the input voltage jump in a very short time from 0 to +1V.

将以上内容保存成1RC_lowpass_transient.asc文件,然后执行Run进行仿真,结果如下:

LTspice introduction - 6 decade vs octave

在AC分析的时候,我们指定一个freq范围,然后让它去计算(sweep)。
在Type of sweep中有四个选项。
分别是:
list, linear, decade, octave
第一个就是用你指定的列表中的freq去计算;
第二个就是你指定freq的开始和介绍范围后,还要指定在这个范围内要线性分别的点的个数;
第三个和第四个不太一样,当指定freq的开始和介绍范围后,它会让你输入每个decade/octave中有几个点。

那么什么是decade和octave?
decade就是表示说两个freq之间 l o g 10 ( f 2 / f 1 ) 的值
先算出stop和start之间的decade个数,然后在每个decade中均匀分布多少个点。

octave就是表示说两个freq之间 l o g 2 ( f 2 / f 1 ) 的值
先算出stop和start之间的octave个数,然后在每个octave中均匀分布多少个点。

ref:
https://en.wikipedia.org/wiki/Decade_(log_scale) )
https://en.wikipedia.org/wiki/Octave_(electronics) )