Skip to content

Instantly share code, notes, and snippets.

@ericfont
Created December 10, 2025 07:52
Show Gist options
  • Select an option

  • Save ericfont/66b4df5f75e9d3f43b5f4c6ac027f286 to your computer and use it in GitHub Desktop.

Select an option

Save ericfont/66b4df5f75e9d3f43b5f4c6ac027f286 to your computer and use it in GitHub Desktop.
try multiple RC again w/comparator
Display the source blob
Display the rendered blob
Raw
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="860" height="356"><defs><linearGradient id="yozxIbOIapse" x1="0px" x2="32px" y1="0px" y2="0px" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#56a956"/><stop offset="1" stop-color="#699669"/></linearGradient><linearGradient id="bJOVscGbnVwC" x1="0px" x2="32px" y1="0px" y2="0px" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#699669"/><stop offset="1" stop-color="#738c73"/></linearGradient><linearGradient id="sXNrbTKmLWuo" x1="0px" x2="32px" y1="0px" y2="0px" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#738c73"/><stop offset="1" stop-color="#738c73"/></linearGradient></defs><g><rect fill="#000000" stroke="none" x="0" y="0" width="860" height="356"/><g transform="scale(1,1) translate(214,-30)"><g><g><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="14px" font-style="normal" font-weight="normal" text-decoration="normal" x="325" y="104" text-anchor="start" dominant-baseline="central">export</text></g><path fill="none" stroke="#56a956" paint-order="fill stroke markers" d=" M 304 160 L 346 118" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/></g><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -80 112 L -80 97" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="10px" font-style="normal" font-weight="normal" text-decoration="normal" x="-93" y="83" text-anchor="start" dominant-baseline="central">+2.5V</text></g><g><g><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="14px" font-style="normal" font-weight="normal" text-decoration="normal" x="58" y="176" text-anchor="start" dominant-baseline="central">export</text></g><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 128 176 L 104 176" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/></g><path fill="none" stroke="#718e71" paint-order="fill stroke markers" d=" M -96 144 L -48 144" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="-72" y="138" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#718e71" paint-order="fill stroke markers" d=" M -96 144 L -96 144" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#718e71" paint-order="fill stroke markers" d=" M -112 112 L -112 112" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -80 112 L -80 112" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#ffffff" paint-order="fill stroke markers" d=" M -96 144 L -112 112" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 128 176 L 142 176" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#718e71" paint-order="fill stroke markers" d=" M 128 144 L 142 144" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#01fd01" paint-order="fill stroke markers" d=" M 194 160 L 208 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#c0c0c0" paint-order="fill stroke markers" d=" M 142 192 L 142 128 L 194 160 Z" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g><text fill="#c0c0c0" stroke="none" font-family="sans-serif" font-size="14px" font-style="normal" font-weight="normal" text-decoration="normal" x="152" y="174" text-anchor="middle" dominant-baseline="central">-</text></g><g><text fill="#c0c0c0" stroke="none" font-family="sans-serif" font-size="14px" font-style="normal" font-weight="normal" text-decoration="normal" x="152" y="144" text-anchor="middle" dominant-baseline="central">+</text></g><path fill="none" stroke="#56a956" paint-order="fill stroke markers" d=" M 352 160 L 304 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="328" y="154" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#718e71" paint-order="fill stroke markers" d=" M -48 112 L -48 144" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="-42" y="134" text-anchor="start" dominant-baseline="alphabetic"></text><g><path fill="none" stroke="#01fd01" paint-order="fill stroke markers" d=" M 208 160 L 224 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="normal" font-size="20px" font-style="normal" font-weight="normal" text-decoration="normal" x="229" y="166" text-anchor="start" dominant-baseline="alphabetic">D</text><path fill="none" stroke="#56a956" paint-order="fill stroke markers" d=" M 304 160 L 288 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="normal" font-size="20px" font-style="normal" font-weight="normal" text-decoration="normal" x="269" y="166" text-anchor="start" dominant-baseline="alphabetic">Q</text><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 304 224 L 288 224" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="normal" font-size="20px" font-style="normal" font-weight="normal" text-decoration="normal" x="269" y="230" text-anchor="start" dominant-baseline="alphabetic">Q</text><path fill="none" stroke="#ffffff" paint-order="fill stroke markers" d=" M 269 210 L 283 210" stroke-linecap="round" stroke-miterlimit="10" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 208 192 L 224 192" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#c0c0c0" paint-order="fill stroke markers" d=" M 224 184 L 240 192 L 224 200 Z" stroke-linecap="round" stroke-miterlimit="10" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="normal" font-size="20px" font-style="normal" font-weight="normal" text-decoration="normal" x="229" y="198" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#c0c0c0" paint-order="fill stroke markers" d=" M 224 144 L 288 144 L 288 240 L 224 240 Z" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/></g><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 208 192 L 208 195" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="198" y="207" text-anchor="start" dominant-baseline="central">CLK</text></g><path fill="none" stroke="#718e71" paint-order="fill stroke markers" d=" M -48 112 L 128 144" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="40" y="123" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 576 160 L 576 336" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="582" y="254" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 464 336 L 288 336" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="376" y="330" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#718e71" paint-order="fill stroke markers" d=" M -112 112 L -127 112" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#808080" paint-order="fill stroke markers" d=" M -127.34 112 A 16.66 16.66 0 1 1 -127.3400083299993 111.98334000277666" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#808080" paint-order="fill stroke markers" d=" M -154 112 L -153 110 L -152 108 L -151 106 L -150 105 L -149 105 L -148 105 L -147 106 L -146 108 L -145 110 L -144 112 L -143 114 L -142 116 L -141 118 L -140 119 L -139 119 L -138 119 L -137 118 L -136 116 L -135 114 L -134 112" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="-161" y="93" text-anchor="start" dominant-baseline="alphabetic">10kHz</text><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 128 336 L 288 336" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="208" y="330" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#56a956" paint-order="fill stroke markers" d=" M 352 160 L 352 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#699669" paint-order="fill stroke markers" d=" M 384 160 L 384 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g transform="matrix(1,0,0,1,352,160)"><path fill="none" stroke="url(#yozxIbOIapse)" paint-order="fill stroke markers" d=" M 0 0 L 2 6 L 6 -6 L 10 6 L 14 -6 L 18 6 L 22 -6 L 26 6 L 30 -6 L 32 0" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/></g><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="358" y="150" text-anchor="start" dominant-baseline="alphabetic">100</text><path fill="none" stroke="#699669" paint-order="fill stroke markers" d=" M 384 160 L 384 172" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#699669" paint-order="fill stroke markers" d=" M 396 172 L 372 172" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 384 192 L 384 180" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 396 180 L 372 180" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="398" y="182" text-anchor="start" dominant-baseline="alphabetic">10nF</text><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 384 192 L 384 208" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 394 208 L 374 208" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 390 213 L 378 213" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 386 218 L 382 218" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 448 192 L 448 208" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 458 208 L 438 208" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 454 213 L 442 213" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 450 218 L 446 218" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 448 160 L 448 172" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 460 172 L 436 172" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 448 192 L 448 180" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 460 180 L 436 180" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="462" y="182" text-anchor="start" dominant-baseline="alphabetic">1nF</text><path fill="none" stroke="#699669" paint-order="fill stroke markers" d=" M 416 160 L 416 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 448 160 L 448 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g transform="matrix(1,0,0,1,416,160)"><path fill="none" stroke="url(#bJOVscGbnVwC)" paint-order="fill stroke markers" d=" M 0 0 L 2 6 L 6 -6 L 10 6 L 14 -6 L 18 6 L 22 -6 L 26 6 L 30 -6 L 32 0" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/></g><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="426" y="150" text-anchor="start" dominant-baseline="alphabetic">1k</text><path fill="none" stroke="#699669" paint-order="fill stroke markers" d=" M 416 160 L 384 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="400" y="154" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 448 160 L 464 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="456" y="154" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 528 160 L 576 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="552" y="154" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 496 160 L 464 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="480" y="154" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 496 160 L 496 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 528 160 L 528 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g transform="matrix(1,0,0,1,496,160)"><path fill="none" stroke="url(#sXNrbTKmLWuo)" paint-order="fill stroke markers" d=" M 0 0 L 2 6 L 6 -6 L 10 6 L 14 -6 L 18 6 L 22 -6 L 26 6 L 30 -6 L 32 0" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/></g><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="502" y="150" text-anchor="start" dominant-baseline="alphabetic">10k</text><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 528 160 L 528 172" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 540 172 L 516 172" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 528 192 L 528 180" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 540 180 L 516 180" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="542" y="182" text-anchor="start" dominant-baseline="alphabetic">100pF</text><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 528 192 L 528 208" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 538 208 L 518 208" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 534 213 L 522 213" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 530 218 L 526 218" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 576 336 L 464 336" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="520" y="330" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#738c73" paint-order="fill stroke markers" d=" M 128 176 L 128 336" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="134" y="262" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 307 160 A 3 3 0 1 1 306.99999999995777 159.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 131 176 A 3 3 0 1 1 130.99999999995774 175.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 307 224 A 3 3 0 1 1 306.99999999995777 223.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 387 160 A 3 3 0 1 1 386.99999999995777 159.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 451 160 A 3 3 0 1 1 450.99999999995777 159.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 531 160 A 3 3 0 1 1 530.9999999999577 159.99998407846124 Z"/></g></g></svg>
@ericfont
Copy link
Author

sim

image

@ericfont
Copy link
Author

sim with 1kHz+10kHz input

not good, cause distortion adds interference:

image

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