回路の素101 006 アンプ:反転アンプ単電源用 交流結合型
交流成分を取り出しながら増幅できる
回路図作成
- 基本的な構成
応答性確認
シミュレーションを tranモード(デフォルト) で実行し、正弦波に対する応答性を確認する
import matplotlib.pyplot as plt import numpy as np from PyLTSpice import SimCommander fname = 'PrimaryCircuit1-006' fname_tmp = '_tran' LTC = SimCommander(fname + '.asc') run_net_file = fname + fname_tmp + '.net' LTC.run(run_filename=run_net_file) LTC.wait_completion()
True
from PyLTSpice import RawRead fig = plt.figure(figsize=(6, 3)) ax1 = fig.add_subplot(1, 1, 1) fname = 'PrimaryCircuit1-006' fname_tmp = '_tran' LTR = RawRead(fname + fname_tmp + '.raw') x = LTR.get_trace('time').get_time_axis(0) tmp1 = LTR.get_trace('V(vout)').get_wave(0) ax1.plot(x * 1000, tmp1, label='Vout') tmp1 = LTR.get_trace('V(vin)').get_wave(0) ax1.plot(x * 1000, tmp1, label='Vin') ax1.legend(); ax1.grid() ax1.set_xlabel('[ms]'); ax1.set_ylabel('V$_{out}$[V]') fig.tight_layout() fig.savefig('PrimaryCircuit1-006_Graph1.png')
ゲインは
入力の 0.2Vの振幅が2Vになり、バイアスの2.5Vが加わっている
周波数特性
シミュレーションを acモード で実行し、周波数特性を取得する
from PyLTSpice import SimCommander fname = 'PrimaryCircuit1-006' fname_tmp = '_ac' LTC = SimCommander(fname + '.asc') line_no = LTC._get_line_starting_with('.tran') sim_cmd = LTC.netlist[line_no] LTC.netlist[line_no] = sim_cmd.replace('.tran', ';tran') line_no = LTC._get_line_starting_with(';ac') sim_cmd = LTC.netlist[line_no] LTC.netlist[line_no] = sim_cmd.replace(';ac', '.ac') print(LTC.netlist[line_no], end='') # 確認 # 編集したnetlistの情報でバッチ処理を実行する run_net_file = fname + fname_tmp + '.net' LTC.run(run_filename=run_net_file) LTC.wait_completion()
.ac oct 40 1 10Meg
True
from PyLTSpice import RawRead fig = plt.figure(figsize=(6, 4)) ax1 = fig.add_subplot(2, 1, 1) ax2 = fig.add_subplot(2, 1, 2, sharex=ax1) fname = 'PrimaryCircuit1-006' fname_tmp = '_ac' LTR = RawRead(fname + fname_tmp + '.raw') freq = np.abs(LTR.get_trace('frequency').get_wave(0)) Vout = LTR.get_trace("V(vout)").get_wave(0) ax1.plot(freq, 20*np.log10(np.abs(Vout))) ax2.plot(freq, np.angle(Vout) / np.pi * 180) ax1.grid() ax1.set_xlabel("[Hz]"); ax1.set_ylabel("Gain[dB]") ax1.set_xscale('log') ax1.set_ylim(15, 22) ax2.grid() ax2.set_xlabel("[Hz]"); ax2.set_ylabel("Phase[deg]") ax2.set_xscale('log') fig.tight_layout() fig.savefig('PrimaryCircuit1-006_Graph2.png')
高域のカットオフ周波数(~200Hz)はオペアンプの特性で決まる
低域のカットオフ周波数は、C1とRSで決まり、下記になる
print('fc = %7.1fHz' % (1.0 / (2.0 * 3.14 * 10e3 * 1e-6)))
fc = 15.9Hz
参考文献
この記事は以下の書籍を参考にしましたが、
私の拙い知識で書いておりますので、誤り等ありましたらご指摘ください