サイトマップ

回路の素101 029 2次バンド・パス・フィルタ 多重帰還型

回路の素101 029 2次バンド・パス・フィルタ 多重帰還型

減衰率20dB/dec
ゲインも設定できる
数百kHz以下の帯域で使用する

回路図作成

  • 基本的な構成

中心周波数  f_0 は下記で設定できる

 f_0 = \frac{1}{2 \pi} \sqrt{\frac{R_1 + R_2}{C_1 C_2 R_1 R_2 R_3}}

今回の回路の場合、1kHz

 f_0 でのゲインは下記

 A_{v0} = - \frac{C_2 R_3}{(C_1 + C_2) R_1}

応答性確認

100Hz入力

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

import matplotlib.pyplot as plt
import numpy as np

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-029.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)
ax2.plot(x * 1000, tmp1, label='Vout')

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

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

fig.tight_layout()

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

100Hzに対しては、ゲインが1/30倍で、位相が90度遅れる

1kHz入力

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

from PyLTSpice import SimCommander

fname = 'PrimaryCircuit2-029'
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', '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 SINE(0 1.5 1k) AC 1
.tran 0 10m 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-029_Graph2.png')

1kHzに対しては、ゲインは1倍、位相は180度遅れている

10kHz

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

from PyLTSpice import SimCommander

fname = 'PrimaryCircuit2-029'
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', '2mu')
LTC.netlist[line_no] = LTC.netlist[line_no].replace('1u', '10n')
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 2mu 0 10n
True
import matplotlib.pyplot as plt
import numpy as np

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)

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)
ax2.plot(x * 1000, tmp1, label='Vout')

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

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

ax2.set_xlim(1.75, 2.05)

fig.tight_layout()

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

ゲインは1/30倍、位相は270度遅れている

方形波応答

from PyLTSpice import SimCommander

fname = 'PrimaryCircuit2-029'
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-029_Graph4.png')

1kHzで振動が発生する(出力は反転)

周波数特性

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

from PyLTSpice import SimCommander

fname = 'PrimaryCircuit2-029'
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 100 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-029'
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(-35, 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-029_Graph5.png')

1kHzが中心周波数で、20dB/decで変化

改良された回路

単電源で動く回路

オペアンプVBをつなぐだけ
その他の特性は基本回路と同じになる

応答性確認

from PyLTSpice import RawRead

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

fname = 'PrimaryCircuit2-029-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-029_Graph6.png')

出力に、VBの2.5Vが追加されている

参考文献

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