Skip to content

Instantly share code, notes, and snippets.

@ericfont
Created December 1, 2025 01:19
Show Gist options
  • Select an option

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

Select an option

Save ericfont/c686fa2d656d9e07ecf60975c7c734ba to your computer and use it in GitHub Desktop.
something working, with hystersis for comparator and summing input with feedback
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="484"><defs><linearGradient id="uGZONHXOQPnk" x1="0px" x2="32px" y1="0px" y2="0px" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#5fa05f"/><stop offset="1" stop-color="#6c936c"/></linearGradient><linearGradient id="JzZGcWTHWdca" 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="PBiMTcdfTICE" x1="0px" x2="32px" y1="0px" y2="0px" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#6c936c"/><stop offset="1" stop-color="#679867"/></linearGradient><linearGradient id="xyAtRMuCTOst" x1="0px" x2="32px" y1="0px" y2="0px" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#699669"/><stop offset="1" stop-color="#6c936c"/></linearGradient><linearGradient id="kEXbrHDAedRV" x1="0px" x2="32px" y1="0px" y2="0px" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#6c936c"/><stop offset="1" stop-color="#708f70"/></linearGradient><linearGradient id="aLUJvWgSJrfF" x1="0px" x2="32px" y1="0px" y2="0px" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#56a956"/><stop offset="1" stop-color="#5fa05f"/></linearGradient><linearGradient id="PCWubdWWFiCN" x1="0px" x2="32px" y1="0px" y2="0px" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#6d926d"/><stop offset="1" stop-color="#6c936c"/></linearGradient></defs><g><rect fill="#000000" stroke="none" x="0" y="0" width="860" height="484"/><g transform="scale(1,1) translate(406,66)"><g><g><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="14px" font-style="normal" font-weight="normal" text-decoration="normal" x="356" y="362" text-anchor="start" dominant-baseline="central">export</text></g><path fill="none" stroke="#56a956" paint-order="fill stroke markers" d=" M 336 320 L 377 348" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/></g><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -304 96 L -289 96" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#679867" paint-order="fill stroke markers" d=" M -255 96 L -240 96" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#808080" paint-order="fill stroke markers" d=" M -255.34 96 A 16.66 16.66 0 1 1 -255.3400083299993 95.98334000277666" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#808080" paint-order="fill stroke markers" d=" M -282 96 L -281 94 L -280 92 L -279 90 L -278 89 L -277 89 L -276 89 L -275 90 L -274 92 L -273 94 L -272 96 L -271 98 L -270 100 L -269 102 L -268 103 L -267 103 L -266 103 L -265 102 L -264 100 L -263 98 L -262 96" 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="-285" y="77" text-anchor="start" dominant-baseline="alphabetic">1kHz</text><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="12px" font-style="normal" font-weight="normal" text-decoration="normal" x="-254" y="90" text-anchor="start" dominant-baseline="alphabetic">*</text><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -304 96 L -319 96" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#808080" paint-order="fill stroke markers" d=" M -319.34 96 A 16.66 16.66 0 1 1 -319.3400083299993 95.98334000277666" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#808080" paint-order="fill stroke markers" d=" M -346 96 L -345 94 L -344 92 L -343 90 L -342 89 L -341 89 L -340 89 L -339 90 L -338 92 L -337 94 L -336 96 L -335 98 L -334 100 L -333 102 L -332 103 L -331 103 L -330 103 L -329 102 L -328 100 L -327 98 L -326 96" 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="-353" y="77" text-anchor="start" dominant-baseline="alphabetic">10kHz</text><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -208 96 L -208 81" 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="-224" y="69" 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="-86" y="304" text-anchor="start" dominant-baseline="central">export</text></g><path fill="none" stroke="#708f70" paint-order="fill stroke markers" d=" M -16 304 L -40 304" 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 352 L 65 352" 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="29" y="352" text-anchor="start" dominant-baseline="central">+2.5V</text></g><path fill="none" stroke="#5fa05f" paint-order="fill stroke markers" d=" M 144 288 L 128 288" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M 96 288 L 80 288" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g transform="matrix(-1,0,0,-1,128,288)"><path fill="none" stroke="url(#uGZONHXOQPnk)" 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="102" y="278" text-anchor="start" dominant-baseline="alphabetic">10k</text><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M 80 256 L 44 256" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M 44 268 L 44 244" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#708f70" paint-order="fill stroke markers" d=" M 0 256 L 36 256" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#708f70" paint-order="fill stroke markers" d=" M 36 268 L 36 244" 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="23" y="242" text-anchor="start" dominant-baseline="alphabetic">471pF</text><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M 80 288 L 66 288" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M 80 320 L 66 320" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#708f70" paint-order="fill stroke markers" d=" M 14 304 L 0 304" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#c0c0c0" paint-order="fill stroke markers" d=" M 66 272 L 66 336 L 14 304 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="56" y="286" 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="56" y="320" text-anchor="middle" dominant-baseline="central">+</text></g><path fill="none" stroke="#679867" paint-order="fill stroke markers" d=" M -224 128 L -176 128" 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="-200" y="122" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#679867" paint-order="fill stroke markers" d=" M -224 128 L -224 128" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#679867" paint-order="fill stroke markers" d=" M -240 96 L -240 96" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -208 96 L -208 96" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#ffffff" paint-order="fill stroke markers" d=" M -224 128 L -240 96" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#6d926d" paint-order="fill stroke markers" d=" M 16 144 L 30 144" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#699669" paint-order="fill stroke markers" d=" M 16 112 L 30 112" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#56a956" paint-order="fill stroke markers" d=" M 82 128 L 96 128" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#c0c0c0" paint-order="fill stroke markers" d=" M 30 160 L 30 96 L 82 128 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="40" y="142" 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="40" y="112" text-anchor="middle" dominant-baseline="central">+</text></g><path fill="none" stroke="#708f70" paint-order="fill stroke markers" d=" M 0 256 L 0 304" 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="6" y="286" text-anchor="start" dominant-baseline="alphabetic"></text><g><path fill="none" stroke="#56a956" paint-order="fill stroke markers" d=" M 96 128 L 112 128" 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="117" y="134" text-anchor="start" dominant-baseline="alphabetic">D</text><path fill="none" stroke="#56a956" paint-order="fill stroke markers" d=" M 192 128 L 176 128" 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="157" y="134" text-anchor="start" dominant-baseline="alphabetic">Q</text><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 192 192 L 176 192" 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="157" y="198" text-anchor="start" dominant-baseline="alphabetic">Q</text><path fill="none" stroke="#ffffff" paint-order="fill stroke markers" d=" M 157 178 L 171 178" stroke-linecap="round" stroke-miterlimit="10" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 96 160 L 112 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#c0c0c0" paint-order="fill stroke markers" d=" M 112 152 L 128 160 L 112 168 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="117" y="166" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#c0c0c0" paint-order="fill stroke markers" d=" M 112 112 L 176 112 L 176 208 L 112 208 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 96 160 L 96 163" 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="86" y="175" text-anchor="start" dominant-baseline="central">CLK</text></g><path fill="none" stroke="#56a956" paint-order="fill stroke markers" d=" M 96 128 L 96 64" 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="102" y="102" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#56a956" paint-order="fill stroke markers" d=" M 96 64 L 72 64" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#699669" paint-order="fill stroke markers" d=" M 40 64 L 16 64" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g transform="matrix(-1,0,0,-1,72,64)"><path fill="none" stroke="url(#JzZGcWTHWdca)" 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="46" y="54" text-anchor="start" dominant-baseline="alphabetic">10k</text><path fill="none" stroke="#699669" paint-order="fill stroke markers" d=" M 16 64 L 16 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="22" y="94" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -128 128 L -136 128" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#679867" paint-order="fill stroke markers" d=" M -168 128 L -176 128" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g transform="matrix(-1,0,0,-1,-136,128)"><path fill="none" stroke="url(#PBiMTcdfTICE)" 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="-162" y="118" text-anchor="start" dominant-baseline="alphabetic">10k</text><path fill="none" stroke="#6d926d" paint-order="fill stroke markers" d=" M 0 144 L 16 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="8" y="138" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#699669" paint-order="fill stroke markers" d=" M 16 64 L 16 48" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M 16 16 L 16 0" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g transform="matrix(0,-1,1,0,16,48)"><path fill="none" stroke="url(#xyAtRMuCTOst)" 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="26" y="38" text-anchor="start" dominant-baseline="alphabetic">1k</text><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M 16 0 L 16 -3" 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="0" y="-15" text-anchor="start" dominant-baseline="central">+2.5V</text></g><path fill="none" stroke="#56a956" paint-order="fill stroke markers" d=" M 336 128 L 336 320" 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="342" y="230" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -128 128 L -128 152" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#708f70" paint-order="fill stroke markers" d=" M -128 184 L -128 208" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g transform="matrix(0,1,-1,0,-128,152)"><path fill="none" stroke="url(#kEXbrHDAedRV)" 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="-118" y="174" text-anchor="start" dominant-baseline="alphabetic">10k</text><path fill="none" stroke="#56a956" paint-order="fill stroke markers" d=" M 192 128 L 336 128" 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="264" y="122" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#708f70" paint-order="fill stroke markers" d=" M -128 208 L -16 304" 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="-68" y="259" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#708f70" paint-order="fill stroke markers" d=" M -16 304 L 0 304" 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="-8" y="298" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M 80 256 L 80 288" 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="86" y="278" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M 80 320 L 80 352" 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="86" y="342" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#5fa05f" paint-order="fill stroke markers" d=" M 144 288 L 272 320" 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="299" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#56a956" paint-order="fill stroke markers" d=" M 336 320 L 328 320" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#5fa05f" paint-order="fill stroke markers" d=" M 296 320 L 288 320" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g transform="matrix(-1,0,0,-1,328,320)"><path fill="none" stroke="url(#aLUJvWgSJrfF)" 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="306" y="310" text-anchor="start" dominant-baseline="alphabetic">1k</text><path fill="none" stroke="#5fa05f" paint-order="fill stroke markers" d=" M 288 320 L 288 332" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#5fa05f" paint-order="fill stroke markers" d=" M 300 332 L 276 332" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 288 352 L 288 340" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 300 340 L 276 340" 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="302" y="342" text-anchor="start" dominant-baseline="alphabetic">2.2nF</text><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 288 352 L 288 368" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 298 368 L 278 368" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 294 373 L 282 373" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#807f7f" paint-order="fill stroke markers" d=" M 290 378 L 286 378" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#5fa05f" paint-order="fill stroke markers" d=" M 272 320 L 288 320" 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="280" y="314" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -80 128 L -66 128" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -80 160 L -66 160" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#6d926d" paint-order="fill stroke markers" d=" M -14 144 L 0 144" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#c0c0c0" paint-order="fill stroke markers" d=" M -66 112 L -66 176 L -14 144 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="-56" y="126" 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="-56" y="160" text-anchor="middle" dominant-baseline="central">+</text></g><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -80 160 L -80 175" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g><text fill="#ffffff" stroke="none" font-family="sans-serif" font-size="14px" font-style="normal" font-weight="normal" text-decoration="normal" x="-99" y="189" text-anchor="start" dominant-baseline="central">+2.5V</text></g><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -128 128 L -80 128" 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="-104" y="122" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#6d926d" paint-order="fill stroke markers" d=" M 0 80 L -24 80" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -56 80 L -80 80" stroke-linecap="round" stroke-miterlimit="10" stroke-width="3" stroke-dasharray=""/><g transform="matrix(-1,0,0,-1,-24,80)"><path fill="none" stroke="url(#PCWubdWWFiCN)" 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="-50" y="70" text-anchor="start" dominant-baseline="alphabetic">22k</text><path fill="none" stroke="#6c936c" paint-order="fill stroke markers" d=" M -80 80 L -80 128" 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="-74" y="110" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="none" stroke="#6d926d" paint-order="fill stroke markers" d=" M 0 80 L 0 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="6" y="118" text-anchor="start" dominant-baseline="alphabetic"></text><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 339 320 A 3 3 0 1 1 338.99999999995777 319.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M -13 304 A 3 3 0 1 1 -13.000000000042249 303.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 83 288 A 3 3 0 1 1 82.99999999995775 287.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 3 304 A 3 3 0 1 1 2.9999999999577507 303.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 99 128 A 3 3 0 1 1 98.99999999995775 127.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 195 192 A 3 3 0 1 1 194.99999999995774 191.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 19 64 A 3 3 0 1 1 18.99999999995775 63.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M -125 128 A 3 3 0 1 1 -125.00000000004225 127.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 3 144 A 3 3 0 1 1 2.9999999999577507 143.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M 291 320 A 3 3 0 1 1 290.99999999995777 319.99998407846124 Z"/><path fill="#ffffff" stroke="none" paint-order="stroke fill markers" d=" M -77 128 A 3 3 0 1 1 -77.00000000004225 127.99998407846124 Z"/></g></g></svg>
@ericfont
Copy link
Author

ericfont commented Dec 1, 2025

@ericfont
Copy link
Author

ericfont commented Dec 1, 2025

lowering RC to just 1kohm + 1nF results in the RC charging going all the way to either rail, which is good because that means that every PWM pulse has an identical symmetric charge and discharge profile, thus the total integration of that signal would equal the total integration of a PWM. That is good for consistency, so not sensitive to RC values and so can digitally reconstruct exactly.

@ericfont
Copy link
Author

ericfont commented Dec 1, 2025

Note, a simple IIR digital filter can act as a capacitive RC block to remove DC: https://en.wikipedia.org/wiki/High-pass_filter#Discrete-time_realization

@ericfont
Copy link
Author

ericfont commented Dec 1, 2025

so to decimate the delta PWM signal, apply that formula y[n]=x[n]-x[n-1]+a*y[n-1] and continuously accumulate that, and dump every nysquist sampling rate sum as the delta for that nyquist sample. If can get the oscillation to be around 96kHz, then a simple boxcar averager will null that oscillation when downsampling to 48kHz.

Also note during analog reconstruction, a simple notch filter will null around that oscillation.

@ericfont
Copy link
Author

ericfont commented Dec 1, 2025

hypothetical notch filter:

image

Might want to combine notch with general lowpass and maybe notch higher overtones too.

@ericfont
Copy link
Author

ericfont commented Dec 1, 2025

image

nice no jaggedy integration

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