サイトマップ

回路の素101 020 1次ロー・パス・フィルタ 反転アンプ型

回路の素101 020 1次ロー・パス・フィルタ 反転アンプ型

減衰率20dB/dec
ゲインも設定できる

回路図作成

  • 基本的な構成

カットオフ周波数  f_c は下記で設定できる

 f_c = \frac{1}{2 \pi C R}

今回の回路の場合、1kHz

ゲインは、

 A_{vp} = - \frac{R}{R_S}

応答性確認

100Hz入力

シミュレーションを tranモード(デフォルト) で実行し、応答を見る

import matplotlib.pyplot as plt
import numpy as np

from PyLTSpice import RawRead

fig = plt.figure(figsize=(6, 3))
ax1 = fig.add_subplot(1, 1, 1)

fname = 'PrimaryCircuit2-020.raw'
LTR = RawRead(fname)
x     = LTR.get_trace('time').get_time_axis(0)

tmp1  = LTR.get_trace('V(vin+)').get_wave(0)
ax1.plot(x * 1000, tmp1, label='Vin+')
tmp1  = LTR.get_trace('V(vout)').get_wave(0)
ax1.plot(x * 1000, tmp1, label='Vout')

ax1.legend(); ax1.grid()
ax1.set_xlabel('[ms]'); ax1.set_ylabel('[V]')

fig.tight_layout()

fig.savefig('PrimaryCircuit2-020_Graph1.png')

100Hzに対しては、ゲインも1で、位相も反転の180度のみ

1kHz入力

信号源の周波数設定と、シミュレーションのパラメータを変更する

from PyLTSpice import SimCommander

fname = 'PrimaryCircuit2-020'
fname_tmp = '_1kHz'
LTC = SimCommander(fname + '.asc')

line_no = LTC._get_line_starting_with('V1')
sim_cmd = LTC.netlist[line_no]
LTC.netlist[line_no] = sim_cmd.replace('100', '1k')
print(LTC.netlist[line_no], end='')  # 確認
line_no = LTC._get_line_starting_with('.tran')
LTC.netlist[line_no] = LTC.netlist[line_no].replace('20m', '2m')
print(LTC.netlist[line_no], end='')  # 確認

# 編集したnetlistの情報でバッチ処理を実行する
run_net_file = fname + fname_tmp + '.net'
LTC.run(run_filename=run_net_file)
LTC.wait_completion()
V1 Vin+ 0 SINE(0 1.5 1k) AC 1
.tran 0 2m 0 0.1u
True
import matplotlib.pyplot as plt
import numpy as np

from PyLTSpice import RawRead

fig = plt.figure(figsize=(6, 3))
ax1 = fig.add_subplot(1, 1, 1)

LTR = RawRead(fname + fname_tmp + '.raw')
x     = LTR.get_trace('time').get_time_axis(0)

tmp1  = LTR.get_trace('V(vin+)').get_wave(0)
ax1.plot(x * 1000, tmp1, label='Vin+')
tmp1  = LTR.get_trace('V(vout)').get_wave(0)
ax1.plot(x * 1000, tmp1, label='Vout')

ax1.legend(); ax1.grid()
ax1.set_xlabel('[ms]'); ax1.set_ylabel('[V]')

fig.tight_layout()

fig.savefig('PrimaryCircuit2-020_Graph2.png')

ゲインは0.7倍、位相は225(=180+45)度遅れている

10kHz

信号源の周波数設定と、シミュレーションのパラメータを変更する

from PyLTSpice import SimCommander

fname = 'PrimaryCircuit2-020'
fname_tmp = '_10kHz'
LTC = SimCommander(fname + '.asc')

line_no = LTC._get_line_starting_with('V1')
sim_cmd = LTC.netlist[line_no]
LTC.netlist[line_no] = sim_cmd.replace('100', '10k')
print(LTC.netlist[line_no], end='')  # 確認
line_no = LTC._get_line_starting_with('.tran')
LTC.netlist[line_no] = LTC.netlist[line_no].replace('20m', '200u')
LTC.netlist[line_no] = LTC.netlist[line_no].replace('0.1u', '20n')
print(LTC.netlist[line_no], end='')  # 確認

# 編集したnetlistの情報でバッチ処理を実行する
run_net_file = fname + fname_tmp + '.net'
LTC.run(run_filename=run_net_file)
LTC.wait_completion()
V1 Vin+ 0 SINE(0 1.5 10k) AC 1
.tran 0 200u 0 20n
True
import matplotlib.pyplot as plt
import numpy as np

from PyLTSpice import RawRead

fig = plt.figure(figsize=(6, 3))
ax1 = fig.add_subplot(1, 1, 1)

LTR = RawRead(fname + fname_tmp + '.raw')
x     = LTR.get_trace('time').get_time_axis(0)

tmp1  = LTR.get_trace('V(vin+)').get_wave(0)
ax1.plot(x * 1000, tmp1, label='Vin+')
tmp1  = LTR.get_trace('V(vout)').get_wave(0)
ax1.plot(x * 1000, tmp1, label='Vout')

ax1.legend(); ax1.grid()
ax1.set_xlabel('[ms]'); ax1.set_ylabel('[V]')

fig.tight_layout()

fig.savefig('PrimaryCircuit2-020_Graph3.png')

ゲインは0.1倍、位相は270(=180+90)度遅れている

方形波応答

from PyLTSpice import SimCommander

fname = 'PrimaryCircuit2-020'
fname_tmp = '_pulse'
LTC = SimCommander(fname + '.asc')

line_no = LTC._get_line_starting_with('V1')
sim_cmd = LTC.netlist[line_no]
LTC.netlist[line_no] = sim_cmd.replace('SINE(0 1.5 100)', 'PULSE(-0.5 0.5 5m 0 0 5m 10m)')
print(LTC.netlist[line_no], end='')  # 確認

# 編集したnetlistの情報でバッチ処理を実行する
run_net_file = fname + fname_tmp + '.net'
LTC.run(run_filename=run_net_file)
LTC.wait_completion()
V1 Vin+ 0 PULSE(-0.5 0.5 5m 0 0 5m 10m) AC 1
True
import matplotlib.pyplot as plt
import numpy as np

from PyLTSpice import RawRead

fig = plt.figure(figsize=(6, 3))
ax1 = fig.add_subplot(1, 1, 1)

LTR = RawRead(fname + fname_tmp + '.raw')
x     = LTR.get_trace('time').get_time_axis(0)

tmp1  = LTR.get_trace('V(vin+)').get_wave(0)
ax1.plot(x * 1000, tmp1, label='Vin+')
tmp1  = LTR.get_trace('V(vout)').get_wave(0)
ax1.plot(x * 1000, tmp1, label='Vout')

ax1.legend(); ax1.grid()
ax1.set_xlabel('[ms]'); ax1.set_ylabel('[V]')

fig.tight_layout()

fig.savefig('PrimaryCircuit2-020_Graph4.png')

入力に遅れて応答している
オーバーシュートはほぼ発生しない

周波数特性

Vin+(V1) に AC 1の設定がついているので、シミュレーションモードをacにすれば良い

from PyLTSpice import SimCommander

fname = 'PrimaryCircuit2-020'
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 10k
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 = 'PrimaryCircuit2-020'
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(-25, 5)

ax2.grid()
ax2.set_xlabel("[Hz]"); ax2.set_ylabel("Phase[deg]")
ax2.set_xscale('log')
ax2.set_ylim(90, 185)

fig.tight_layout()

fig.savefig('PrimaryCircuit2-020_Graph5.png')

1kHzがカットオフ、ゲインは1、20dB/decで変化

改良された回路

単電源で動作する回路

応答性確認

import matplotlib.pyplot as plt
import numpy as np

from PyLTSpice import RawRead

fig = plt.figure(figsize=(6, 3))
ax1 = fig.add_subplot(1, 1, 1)

fname = 'PrimaryCircuit2-020-2.raw'
LTR = RawRead(fname)
x     = LTR.get_trace('time').get_time_axis(0)

tmp1  = LTR.get_trace('V(vin+)').get_wave(0)
ax1.plot(x * 1000, tmp1, label='Vin+')
tmp1  = LTR.get_trace('V(vout)').get_wave(0)
ax1.plot(x * 1000, tmp1, label='Vout')

ax1.legend(); ax1.grid()
ax1.set_xlabel('[ms]'); ax1.set_ylabel('[V]')

fig.tight_layout()

fig.savefig('PrimaryCircuit2-020_Graph6.png')

オフセットが追加されているが、それ以外の特性は基本回路と同じ

周波数特性

from PyLTSpice import SimCommander

fname = 'PrimaryCircuit2-020-2'
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 10k
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 = 'PrimaryCircuit2-020-2'
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(-25, 5)

ax2.grid()
ax2.set_xlabel("[Hz]"); ax2.set_ylabel("Phase[deg]")
ax2.set_xscale('log')
ax2.set_ylim(-185, 185)

fig.tight_layout()

fig.savefig('PrimaryCircuit2-020_Graph7.png')

高域側の特性は同じ
低域のハイパスフィルタのカットオフ周波数は下記で決まる

 f_{cL} = \frac{1}{2 \pi C_1 R_S}

今回の回路の場合、10Hz

参考文献

この記事は以下の書籍を参考にしましたが、
私の拙い知識で書いておりますので、誤り等ありましたらご指摘ください