NGspice simulation of Wave File

For doing simulations only (meaning, not going to make a PCB), I prefer LTspice.

But, if intending to build an actual PCB/real-circuit, I prefer doing schematics/pcb’s in Kicad.

I ran into a problem with NGspice/kicad when wanting to simulate an Audio Amp using a WAV file as the input source.
WAV file works great in LTspice (zero problems) but, NGspice does not appear to like WAV files (or renamed to .TXT…etc).

I discovered a simple way to use the circuit in Kicad: generate the Netlist file but select ‘Spice’ as the file type and it generates a xxx.CIR

Then, simply open the .CIR in LTspice. Thus, no need to make the circuit in LTspice.

1 Like

Cool. If you are doing this repeatedly, you can fill in the location of the LTSpice EXE file and launch the simulation straight from KiCad. A similar thing is shown at this timestamped video:


Thank you! It worked :grinning:

1 Like

There is now an experimental ngspice (pre-compiled for MS Windows) that reads and writes wave audio files.

Please check for downloading. For now this is discrete ngspice only. A example is given in post 230 at as how to use it in conjunction with KiCad.

A short intro to the input and output formats is found in

1 Like