001_band-pass_filter : Filter variations
Requires: SmartSpice & Smartview
Minimum Versions: SMARTSPICE 4.6.5.R
Introduction
The SMARTSPICE Rubberband feature allows you to select and modify model, instance and .PARAM parameters, and interactively watch in SMARTVIEW how the simulation changes in real time. To invoke the Rubberband fuctionality you need to:
- 1. Start SMARTSPICE in GUI mode, or type the command smartspice.
- 2. Source the input deck.
- 3. Press the Rubberband button in the Toolbar.
- 4. Initial run will be started and SMARTVIEW will be invoked.
- 5. Nominal waveforms correspondent to the original netlist settings will be displayed in green.
- 6. Select model, device or global parameters for Rubberbanding.
- 7. Press the Add Selected button in the Rubberband dialog.
- 8. Move the Rubberband slider from the Sliders tab. The Rubberbanded waveforms will be displayed in red.
This input deck is a Bandpass filter circuit with .AC and .MEASURE analysis.
Rubberband:
- Resistor model parameter r1[res] to change the filter magnitude.
- Resistor r2[res] to change the phase and bandpass base frequency.
- Change parameter ".param fc" to change filter centre frequency.
- Change ".param q" to change Filter Q factor.
The rubber band dialogue shows the r1[res] parameter variation setup and the waveform 1 shows the initial simulation with waveform 2 showing the effect of variation via the slider on the output characteristic.
The output plot w1 shows first case, and w2 shows second, while w3 shows final result.
Input Files
rubberband_example_01.in
* Bandpass filter * Rubberband parameters: * r1[res] - magnitude, * r2[res] - phase and banpass base frequency, * .param fc - filter center frequency * .param q - filter q factor = f0/bw .param fc = 2000.0 ; Filter center frequency (Hz) .param bw = 200.0 ;Filter bandwidth (Hz) .param q = 10.0 ;Filter q factor = f0/bw .param r3iv = 200k ;Assumed value for rf3 .param h0 = 10.0 ;Filter f0 gain magnitude *Filter circuit pins : input n1 , output n3 r3 n3 n4 r3iv c1 n2 n3 "q/(3.1412*fc*r3iv)" c2 n2 n4 "q/(3.1412*fc*r3iv)" r1 n1 n2 "r3iv/(2*h0)" r2 n2 0 "r3iv/((4*q*q)-(2*h0))" x1 0 n4 n3 opamp_ac vin n1 0 ac 1 RL n3 0 10k *commands .ac dec 200 10 1G .probe vp(n3) .let gain = vdb(n3) .MEASURE AC MAX_GAIN MAX VM(n3) *subcircuit ports : in+ in- out .subckt opamp_ac in_p in_n out *ua741 OP AMP parameters .param voff = 0.7m .param ib = 80n .param ioff = 20n .param rd = 2meg .param cd = 1.4p .param cmrrdc = 31622.8 .param fcmz = 200.0 .param aoldc = 199526 .param gbp = 1meg .param fp2 = 3meg .param ro = 75.0 * input stage voff1 in_n 6 "voff/2" voff2 7 in_p "voff/2 " ib1 0 6 ib ib2 7 0 ib ioff1 7 6 "ioff/2 " r1 6 8 "rd/2 " r2 7 8 "rd /2 " cin1 6 7 cd *common-mode zerostage ecm1 12 0 8 0 "1e6/cmrrdc" rcm1 12 13 1meg ccm1 12 13 "1/(2*3.1412*1e6*fcmz)" rcm2 13 0 1 * differential and common-mode signal summing stage gmsum1 0 14 7 6 1 gmsum2 0 14 13 0 1 rsum1 14 0 1 * voltage gainstage1 gmp1 0 9 14 0 1 rado 9 0 aoldc cp1 9 0 "1/(2*3.1412*gbp)" * voltage gain stage2 gmp2 0 11 9 0 1 rp2 11 0 1 cp2 11 0 "1/(2*3.1412*fp2)" * output stage eos1 10 0 11 0 1 ros1 10 out ro .ends .end
Graphics