Rat-Style Gain & Filter
A GuitarPedalCourse.com mini-appThe two knobs that define a Rat-style distortion, modeled end to end: the LM308 clipping stage and the output low-pass filter. The curve is the pre-clipping (linear) response.
fc ≈ 1/(2π·(R18+RFILTER+R20)·C18) · LM308: single pole, GBW 800 kHz (30 pF comp)
150k, 100k, 75%. Enter commits, Esc cancels.Your Build
How the gain and filter controls work
The gain pot is a rheostat in the op-amp’s feedback, so the stage is non-inverting with G = 1 + Zf/Zg. Zg is two RC branches to ground, and each one switches on as frequency rises: gain starts climbing above 94 Hz (R15 and C13) and climbs again through 1.54 kHz (R16 and C14), which is why this circuit clips the mids and treble much harder than the bass. With both branches fully on, the midband ceiling at full gain is 1 + 150k/(360 ∥ 47), about 3609x or 71 dB. C12 (100 pF) across the pot pulls the top back down, with a corner at 10.6 kHz at full gain that rises as you back the knob off. At 0% the feedback is a dead short and the stage sits at unity.
The LM308 is the one part on this page that is not modeled as ideal. Every other calculator in this family uses ideal components; here the op amp is modeled as a single pole with a gain-bandwidth product of 800 kHz, the LM308’s figure with the stock 30 pF compensation cap on pins 1 and 8. That one number changes everything up top: at full gain the feedback network asks for 68 dB at 10 kHz and the chip can only deliver 38 dB, a 30 dB shortfall, and even at 1 kHz the stage tops out near 60 dB instead of the ideal 71 dB. That treble starvation before the diodes ever conduct is a real part of the Rat sound, which is why it earned the exception. It is an approximation: the real chip also has slew-rate limiting and saturation recovery that no linear model captures.
The filter pot is a rheostat feeding C18: a simple variable low pass after the clipping diodes, so it darkens the already-clipped signal. It runs the way the real pedal does, backwards from this family’s usual rule: 100% is full resistance and darkest, matching the pedal’s clockwise. The textbook corner is 1/(2π·(R18+RFILTER+R20)·C18), 470 Hz to 18.5 kHz with stock values, but R21 loads the network and the true −3 dB point sits a bit higher: 532 Hz fully dark to 18.6 kHz fully bright, which is what the corner card and marker report. At the stock noon settings the whole circuit peaks at 59.3 dB near 750 Hz with the filter corner at 980 Hz; both knobs maxed, it peaks at 62 dB near 513 Hz.
The curve is the small-signal (pre-clipping) response: what the circuit does before D3 and D4 conduct. At real playing levels the op-amp output slams into the diodes at roughly ±0.6 V, so read the left half of this page as drive and tone shaping, not output level. Assumptions: a buffered low-impedance source at the input (feed it straight from a passive guitar with around 10k of source impedance and C10’s corner falls from 159 kHz to about 14 kHz, shaving audible treble), and the 2N3819 source follower modeled as unity into a high-impedance stage (a real one loses about 0.4 dB; the Level pot after it is not modeled). Two quiet details the math surfaced: C10 loads C9 as a capacitive divider, so even the passband sits at 22/23 of the input (0.4 dB down), and R12 (2.2 MΩ) is a pulldown that does nothing to the response when a buffer drives the input.