Skip to content

Instantly share code, notes, and snippets.

@flpvsk
flpvsk / voltage-current-sources.md
Last active July 3, 2021 13:52
When to think in voltages and when in currents

There's voltage and there's current, like in a pipe/water analogy there is pressure and there is .. current ("amount of water passing through a cross section in a unit of time") in a pipe. Both are important and linked.

There's also voltage sources and current sources (current sink is a source pointing in the opposite direction). Ideal voltage source (think 9V battery) provides whatever current is consumed by the circuit, keeping its own output voltage constant. Ideal current source provides whatever voltage is needed by the circuit, keeping the current constant. Real voltage and current sources have limits, non-linearities and impedances to think about, but that's going one level deeper.

Now what does it all mean practically.

If we want to analyse how for example an inverting amplifier configuration works, we need to look at both voltage and current (see [Aaron Lanterman's video on opamps][opamps]). But once we have analysed it we can simplify the inverting amplifier and say that it's just a **vol

@flpvsk
flpvsk / recorderWorkletProcessor.js
Last active March 22, 2024 06:28
An example of a recorder based on AudioWorklet API.
/*
A worklet for recording in sync with AudioContext.currentTime.
More info about the API:
https://developers.google.com/web/updates/2017/12/audio-worklet
How to use:
1. Serve this file from your server (e.g. put it in the "public" folder) as is.