A full-stack application that simulates physical data transmission channels. It calculates signal attenuation, thermal noise levels, Signal-to-Noise Ratio (SNR), Nyquist theoretical bit rates, and Shannon Capacity limits in real-time.
This project uses a highly performant C binary for the mathematical physics engine, a Node.js Express backend API to pipe data, and a stunning Vite React frontend with an animated oscilloscope.
- C Core Engine (
core/)- The math engine written in standard C.
sim.exeacts as a fast CLI program. It intakes physical inputs (Distance, Bandwidth, Medium, etc.) via arguments, performs attenuation/noise calculations based on Bolton's constant, and outputs results in JSON format.
- Node.js API (
backend/)- An Express.js REST API running on port
3000. - It listens for simulation requests on
/simulate, spawns a child process to execute thesim.exebinary, and returns the JSON payload to the web client.
- An Express.js REST API running on port
- React Web UI (
ui/)- A modern, glassmorphic dashboard built with Vite and React.
- It debounces slider inputs, sends HTTP requests to the backend, and visualizes the degraded signal in real-time versus a clean reference signal using an animated SVG Oscilloscope.
To run the full stack locally, you need two terminal windows: one for the backend API and one for the frontend UI.
If you make changes to core/*.c, you must recompile the math engine for the backend to use:
gcc core/*.c -o sim -lmThe Express backend executes your C simulation and serves the data.
cd backend
npm install
node server.jsThe API will start running on http://localhost:3000.
The React dashboard serves the interactive simulation controls.
cd ui
npm install
npm run devOpen your browser to http://localhost:5173/ to view the UI.
- Interactive Telemetry: Slide parameters like distance, temperature, input power, bandwidth, and signal levels to dynamically stress-test the simulation.
-
Physical Medium Selection: Toggle between Twisted Pair (
$0.2 \text{ dB/km}$ ) and Fiber Optic ($0.05 \text{ dB/km}$ ) attenuation profiles. - Oscilloscope Noise Extrapolator: Due to naturally minuscule thermal noise amplitudes, we've provided a visual slider to artificially amplify the noise jitter on the SVG oscilloscope so you can visually study signal degradation mechanics at varying SNRs.
-
Attenuation (
$P_{RX}$ ):$P_0 \cdot 10^{-(\alpha \cdot d) / 10}$ -
Thermal Noise (
$N$ ):$k \cdot T \cdot B$ -
Nyquist Bit Rate:
$2 \cdot B \cdot \log_2(M)$ -
Shannon Capacity:
$B \cdot \log_2(1 + \text{SNR})$
