Skip to content

Instantly share code, notes, and snippets.

@ericfont
Created November 27, 2025 05:39
Show Gist options
  • Select an option

  • Save ericfont/73732a8e21252cf16f4d3fc5fe849404 to your computer and use it in GitHub Desktop.

Select an option

Save ericfont/73732a8e21252cf16f4d3fc5fe849404 to your computer and use it in GitHub Desktop.
double feedback delta^2 mod, but also lowpass 100kHz with input
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericfont
Copy link
Author

@ericfont
Copy link
Author

@ericfont
Copy link
Author

The equation is a sum of double integral and a single integral

Vout=
$$\frac{1}{(RC)^2} \int\int Q(t)dt + \frac{1}{RC} \int Q(t) dt$$

But the double integral dominates, because it is over the square of RC...and since RC < 1, that means 1/(RC)^2 >> 1/(RC).

@ericfont
Copy link
Author

@ericfont
Copy link
Author

Q output before integrations:

image

@ericfont
Copy link
Author

@ericfont
Copy link
Author

before integration:

image

@ericfont
Copy link
Author

@ericfont
Copy link
Author

image

@ericfont
Copy link
Author

adding that final 20kHz pole seems to do something interesting to the overall phase shift:

image image

@ericfont
Copy link
Author

The 230kHz oscillation frequency seems to correspond to the rightmost phase intersection with 0 degrees, not the leftmost. Berkhausen just says 0 degrees, but doesn't say if there are multiple intersections.

@ericfont
Copy link
Author

since the feedback is dominated by double-integral, then maybe slope overload isn't as big as an issue, because the double integral grows like x^2 if provided a step input.

@ericfont
Copy link
Author

if hypothetically use infinite bandwidth opamps, then the bode plot is a constant -40dB/decade over all frequencies, and the phase reaches 0degrees around 1Mhz, so the oscillation frequnecies jumps randomly around above 1 MHz

image

@ericfont
Copy link
Author

circuitjs simulation which adds 100ns delay buffer seems to cause oscillation to drop down to just 69kHz.

@ericfont
Copy link
Author

@ericfont
Copy link
Author

sim with 20Mhz clock

with 0 input:
image

with input:
image

@ericfont
Copy link
Author

oscillations around 160kHz:

image

@ericfont
Copy link
Author

test with comparator and offset error and no input

image

now try with input:
image
It seems offset error isn't really a big deal at all for this second derivative circuit...

@ericfont
Copy link
Author

same circuit but without any offset error:

image

circuit-20251127-2334

So it seems maybe no problem at all.

@ericfont
Copy link
Author

if add 10Mohm feedback resistors

circuit-20251127-2338

image

if add offset error now:
image

So although maybe adds a DC offset to result, it doesn't seem to really make much error in the audio frequency range.

@ericfont
Copy link
Author

video using 20kHz 1.5Vpp sine using breadboard setup with cheap components (LM393, MCP6004, SN74AC74, schmitt clock). Reconstruction does overshoot rails.

Screencast_20251128_022657.webm

@ericfont
Copy link
Author

2Vpp sine, so not overshooting, and don't draw on top of eachother:

Screencast_20251128_023300.webm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment