I wanted to make an analog switch in a pinch, so I cobbled together a quick back-to-back N-Channel MOSFET analog switch using junk box parts. It actually seems to work quite well.
simulate this circuit – Schematic created using CircuitLab
I also tried this with PMOS and achieved similar results.
From my plot, I noticed the rise delay on switching off. Curiously, this was made more noticable by the introduction of C3 and C4 (needed to make the signal quiet when the FET is off). I wonder if this is a characteristic of low performance in my circuit.
From another answer (on audio switching), I see that the DG408 analog multiplexer or MAX4066 analog switch can be used for analog switching, but in a pinch, does my back-to-back NMOS configuration work just as well? Would it be appropriate for a production design? I appreciate that an IC would reduce the part count, so my question is academic. From reading the datasheets of the switch and multiplexer I mentioned, the internal workings for both are illustrated using a toggle switch, but I imagine they'd need to use some kind of FET.
Side note: I suppose using a JFET might eliminate the back-to-back MOSFET need, as it doesn't have the body diode, but I don't have any handy. That said, I read that while the JFET doesn't have a body diode, it is useless for everything but some niche signal stuff.
Edit: As suggested in the answers, I tried reducing Rload to 100 Ω, and this does indeed affect the lingering output voltage.
Further changes indicate that actually, a 100 nF cap (C5) to ground performs well enough compared to C3 and C4 previously. I can't seem to simulate this noise problem in CircuitLab/SPICE, but in the physical circuit, here's the waveform...
40 mV is just about audible through speakers, and is unmistakably the same sound at 1/10 of the volume.
10 mV is the same as the background noise.