* PM_K-1 : input loading -- line receiver (25k) vs Hi-Z instrument buffer (1M)
*
* This is the circuit-level proof of a decision we made by hand: why a guitar/bass
* needs a HIGH-impedance input. A passive pickup is inductive, so the load impedance
* it sees shapes its tone. Plug it into a low impedance and you damp its resonance
* and lose treble + level; a high-Z buffer preserves it.
*
* Pickup model: open-circuit source + winding resistance + inductance + self-capacitance.
* Plus a typical ~300 pF guitar cable. We drive two identical pickup+cable networks
* from one ideal source and load them differently, then compare.
*
* Run:  ngspice -b sim/input_loading.cir   (from inside the EDA container)

.title PM_K-1 input loading: line 25k vs instrument 1M

Vpu  src 0 AC 1

* --- Branch A: LINE input, ~25k receiver impedance ---
RdcA  src a1 6k
LpuA  a1  a2 3
CpuA  a2  0  150p
CcabA a2  0  300p
RinA  a2  0  25k

* --- Branch B: INSTRUMENT input, 1M Hi-Z buffer ---
RdcB  src b1 6k
LpuB  b1  b2 3
CpuB  b2  0  150p
CcabB b2  0  300p
RinB  b2  0  1meg

.ac dec 100 10 100k

.control
run
meas ac a_1k  find vdb(a2) at=1000
meas ac b_1k  find vdb(b2) at=1000
meas ac a_peak max vdb(a2) from=1000 to=20000
meas ac b_peak max vdb(b2) from=1000 to=20000
echo
echo "  Level @1kHz   : line(25k)= $&a_1k dB   inst(1M)= $&b_1k dB"
echo "  Resonant peak : line(25k)= $&a_peak dB   inst(1M)= $&b_peak dB"
echo "  -> the 25k load drags the signal down and flattens the pickup's natural peak;"
echo "     the 1M input preserves level and tone. Hence the switchable Hi-Z front end."
wrdata ../eda/sim/input_loading.csv vdb(a2) vdb(b2)
.endc
.end
