Authors: Sérgio Carneiro & Eduardo Piassaroli
A dynamic Python simulator that visualizes the convolution integral
- PySpice Integration: Simulates real circuit behavior using the NGSpice engine.
- Causal Convolution: Accurately computes the discrete convolution while maintaining system causality.
-
Dynamic Visualization: Animates the step-by-step overlap of the input signal
$x(\tau)$ and the impulse response$h(t-\tau)$ . - Modular Codebase: Separated concerns for circuit definition, signal processing, and frontend animation.
To run this simulator, you need Python 3.14.0 and the NGSpice engine installed on your machine. Here is the step-by-step setup to get the environment ready:
First, clone this repository to get the source code on your local machine and navigate into the project folder:
git clone [https://github.com/slcarneiro/Circuit-Convolution.git](https://github.com/slcarneiro/Circuit-Convolution.git)
cd Circuit-Convolutionpip install -r requirements.txt-
Because this project uses PySpice as a bridge to simulate real circuits, the code depends on the external NGSpice engine to work. You must configure it manually:
-
Download and install NGSpice.
-
Add the NGSpice installation folder (specifically the folder containing the .dll or executable, usually .../ngspice/bin) to your system's Environment Variables (PATH).
-
DLL Error Fix: If you encounter any
.dllmissing errors (e.g., "ngspice.dll not found"), you can easily fix it by runningpyspice-post-installation --install-ngspice-dlldirectly in your VS Code terminal, or by manually copying the.dllfile to your project's root folder. -
🚨 CRITICAL NOTE: If PySpice cannot find the engine in your PATH, the simulation will fail to run.
