A complete, browser-based digital laboratory for studying Analog-to-Digital Conversion, quantization noise, and oversampling.
Record real signals, run controlled experiments, visualise the physics, and export a full lab report โ no installation required.
๐ https://vertiam.github.io/adc-simulator/
๐ Click This Link to Watch the video demo!!
| Page | URL | Description |
|---|---|---|
| ๐ Landing Page | /index.html |
Project overview, theory cards, experiment guide |
| ๐ฌ Lab Environment | /lab.html |
Full 5-step guided experiment |
- Evaluation Criteria Alignment
- What This Project Does
- Problem Statement
- Technologies Used
- Lab Workflow โ All 5 Steps
- Core Concepts
- The Algorithm
- Visualization Features
- Chart Interaction Tools
- How to Use
- Real-World Applications
- Project File Structure
- Key Formulas Reference
- Team
| Criterion | How This Project Meets It |
|---|---|
| Physical / System Correctness | Midtread uniform quantization matches the IEEE standard ADC model. SNR formula 6.02n + 1.76 dB is the exact closed-form theoretical result. Oversampling gain 10ยทlogโโ(M) is derived from noise power spectral density. FFT uses Cooley-Tukey radix-2 DIT with Hanning windowing โ standard DSP practice. All formulas are textbook-accurate. |
| Visualization Quality | 4 live interactive charts: waveform, error signal, SNR curve, FFT spectrum. Staircase fill shows error area even at high bit depths. Quantization level grid lines visible at โค7 bits. Zoom, pan, markers, comparison snapshots, and text annotations on every chart. Dark/light mode. PNG export. |
| Conceptual Clarity | Every technical term has a plain-English hover tooltip. Step-by-step guided lab workflow. Pre-filled theory notebook with derivations. Real-world application examples. Designed so a student with zero prior knowledge can complete the full experiment and understand ADC principles end-to-end. |
This project models every stage of the ADC pipeline:
Real Signal โ Sampling โ Quantization โ Error Measurement โ Oversampling โ SNR & FFT Analysis
Students interact with this pipeline through a guided 5-step lab session, recording readings, writing observations, and generating a complete exportable report.
Core deliverables from the problem statement:
| Required Outcome | Implementation |
|---|---|
| Model ADCs with different bit resolutions | 2-bit to 16-bit slider, live waveform update |
| Visualize quantization noise | Error chart + orange fill + FFT spectrum |
| Demonstrate noise reduction via oversampling | 1ร to 64ร slider, live SNR update |
| Quantized signal plots | Waveform chart with stepped quantized line |
| SNR vs ADC resolution graphs | SNR curve chart with operating point dot |
Problem Statement #19:
Analog-to-digital conversion introduces quantization noise. Simulate ADC digitization effects and study how oversampling improves signal quality.
- โ Model ADCs with different bit resolutions (2โ16 bit)
- โ Visualize quantization noise (error chart + FFT)
- โ Demonstrate noise reduction using oversampling (1ร to 64ร)
- โ Quantization, ADC resolution, oversampling, noise averaging โ all implemented and visualized
| Technology | Role | Why Chosen |
|---|---|---|
| HTML5 | Page structure | No framework overhead, works offline |
| CSS3 + Variables | Shared design system | Single style.css; dark/light via class toggle |
| JavaScript ES6+ | All simulation logic | In-browser, zero-latency slider response |
| Web Audio API | Microphone recording | Native PCM capture, no libraries |
| MediaRecorder API | Audio stream capture | Standard across all modern browsers |
| Chart.js v4.4.1 | 4 live interactive charts | Fastest JS charting library for real-time data |
| chartjs-plugin-zoom | Zoom & pan | Built on Hammer.js touch gestures |
| Custom FFT (JS) | Frequency spectrum | Cooley-Tukey radix-2 DIT, O(N log N) |
| localStorage | Auto-save student data | No backend required |
| GitHub Pages | Free HTTPS hosting | getUserMedia requires HTTPS |
Required fields (name, reg number, dept, date) with shake-animation validation and live green/red border feedback. Auto-saves to localStorage every 10 seconds. All fields populate the final report.
๐ค Microphone โ getUserMedia() โ MediaRecorder โ WebM blob โ decodeAudioData() โ Float32Array PCM โ normalized to [-1, +1]. Live waveform via AnalyserNode.
โก Generator โ Sine, Square, Sawtooth, Chirp. Configurable frequency and amplitude.
๐ CSV Upload โ Drag-and-drop, single-column or time,value format, linear interpolation resample to 250 points.
Four live charts, all interactive:
- Waveform โ Original vs Quantized with staircase fill and level grid lines
- Quantization Error โ The noise signal; RMS error shown live
- SNR vs Bit Depth โ Theoretical curve + orange dot at current settings
- FFT Spectrum โ Cooley-Tukey FFT of the error signal; shows noise spectral distribution
Controls: Bit Depth (2โ16 bit) ยท Oversampling (1รโ64ร) ยท Noise Floor (0โ30%).
Record This Reading logs current settings (bits, OS rate, SNR, ENOB, RMS) to a data table.
Aim, Apparatus, Theory, Observations, Analysis, Conclusion โ all editable, auto-saved.
Auto-assembled from all previous steps. Print with @media print CSS, or export full CSV.
Real-world signals are continuous. Computers store only discrete numbers. The ADC bridges this gap.
Levels = 2โฟ Step = 2 / 2โฟ (in [-1, +1] range)
| Bits | Levels | Typical Use |
|---|---|---|
| 4 | 16 | Illustration |
| 8 | 256 | Telephony |
| 12 | 4,096 | Sensors, IoT |
| 16 | 65,536 | CD audio |
| 24 | 16,777,216 | Studio recording |
Q[i] = round(x[i] / step) ร step
error = Q[i] - x[i] โ [-step/2, +step/2]
RMS = step / โ12
SNR = 6.02n + 1.76 + 10ยทlogโโ(osRate) dB
Every bit adds ~6 dB. Every 4ร oversampling adds another ~6 dB.
Sample M times faster, average groups of M. Noise variance drops by M, amplitude by โM.
Golden Rule: 4ร oversampling = +1 bit = +6 dB SNR
ENOB = n + logโ(M) / 2
Quantization noise is ideally white (flat spectrum). The FFT chart shows this. Oversampling lowers the noise floor uniformly across all frequency bins.
step = 2 / Math.pow(2, bits) // one level's width
Q[i] = Math.round(x[i] / step) * step // snap to nearest levelThis is the IEEE-standard ADC model. Rounding error is uniformly distributed in [-step/2, +step/2].
// Generate N ร osRate super-samples โ quantize each โ average groups
for (let i = 0; i < N; i++) {
let sum = 0;
for (let j = 0; j < osRate; j++) sum += Q_super[i * osRate + j];
output[i] = sum / osRate;
}Statistical independence of rounding errors means averaging M values reduces noise variance by M.
Algorithm: Radix-2 DIT with bit-reversal permutation
Complexity: O(N log N) vs O(Nยฒ) naive DFT
Window: Hanning w[i] = 0.5 ร (1 - cos(2ฯi/N))
Input: Quantization error signal
Output: Power spectrum, first N/2 bins
| Chart | What It Shows | Evaluation Criterion Met |
|---|---|---|
| Waveform | Smooth blue original vs stepped orange quantized + fill + level grid | Physical correctness + Visualization quality |
| Error Signal | Raw quantization noise at each sample point | Visualization quality + Conceptual clarity |
| SNR Curve | Theoretical 6.02n + 1.76 dB plotted against current operating point |
Physical correctness |
| FFT Spectrum | Noise power distribution across frequency bins (Hanning-windowed) | Physical correctness + Visualization quality |
| Button | Function |
|---|---|
+ / โ |
Zoom in/out (also mouse wheel, pinch) |
โ |
Reset zoom |
๐ |
Place marker โ wave markers sync automatically to error chart |
โ๏ธ |
Add text annotation โ click chart, type label |
โ |
Snapshot comparison โ freeze current state as purple overlay |
โ |
Download PNG (respects dark/light mode) |
| Theme toggle | Dark โ Light mode, saved to localStorage |
# Hosted: just visit the URL
https://vertiam.github.io/adc-simulator/
# Local (mic needs HTTPS or localhost):
python -m http.server 8000
# open http://localhost:8000Suggested experiment sequence:
1. Set Bit Depth = 4-bit โ Record
2. Set Bit Depth = 8-bit โ Record
3. Set Bit Depth = 12-bit โ Record (observe SNR jump)
4. Set Oversampling = 4ร โ Record (observe noise floor in FFT)
5. Set Oversampling = 16ร โ Record
6. Use โ to snapshot 4-bit, switch to 12-bit โ direct visual comparison
7. Place marker at a peak โ observe it synced to error chart
8. Export lab report
| Domain | ADC Impact |
|---|---|
| ๐ต Music | CD = 16-bit 44.1 kHz ยท Studio = 24-bit 96 kHz |
| ๐ฅ Medical | ECG, MRI, pulse oximeters โ noisy ADC = wrong diagnosis |
| ๐ฑ Smartphones | Every mic, camera sensor, and touchscreen uses an ADC |
| ๐ฐ Telecom | 5G radio front-ends โ ADC limits channel capacity |
| ๐ก IoT | Temperature, pressure sensors โ bit depth = precision |
| ๐ฌ Science | Oscilloscopes โ limited by ADC resolution |
adc-simulator/
โโโ index.html โ Landing page
โโโ lab.html โ Full lab (2083 lines)
โ โโโ 4 chart system waveform, error, SNR, FFT
โ โโโ Marker system waveโerror sync
โ โโโ Comparison mode snapshot overlay
โ โโโ Text annotations click-to-place labels
โ โโโ FFT engine Cooley-Tukey + Hanning
โ โโโ Theme toggle dark/light + localStorage
โโโ style.css โ Shared design system
โโโ csv_data_generator.py โ Python test data generator
โโโ README.md โ This file
Levels = 2โฟ
Step = 2 / 2โฟ
RMS noise = step / โ12
SNR (ideal)= 6.02n + 1.76 dB
SNR (OS) = 6.02n + 1.76 + 10ยทlogโโ(M) dB
ENOB = n + logโ(M) / 2
Nyquist : f_s โฅ 2 ร f_max
FFT : O(N log N), Hanning window
Team Name: Qt ฯ's ยท Quatumn Hackathon ยท Problem Statement #19 ยท Mechanical Engineering
| Role | Name | Reg. No. |
|---|---|---|
| Team Leader | Swayam Viral Marfatia | RA2511002010080 |
| Member | Narayan Murthy | RA2511002010124 |
| Member | Shirly Oviya | RA2511054010030 |
| Member | Mithasha P Sishaj | RA2511053050040 |
"The goal is to turn invisible noise into something you can see, drag a slider, and understand." โ Qt ฯ's