Audio Frequency Analyzer is a high-performance, client-side web application engineered for Digital Signal Processing (DSP / Pengolahan Sinyal Digital) academic research, university coursework, and live acoustic demonstration.
The application analyzes uncompressed .wav audio signals across both the time domain (waveform $x(t)$) and frequency domain (spectrum
| Feature | Description | Engineering Details |
|---|---|---|
| β‘ Client-Side WAV Decoder | Decodes raw audio PCM stream directly in the browser via Web Audio API. | Extracts sample rate ( |
| ποΈ Stereo to Mono Mixdown | Seamlessly downmixes multi-channel audio tracks. | Implements |
| π Radix-2 Cooley-Tukey FFT | High-speed Decimation-in-Time (DIT) FFT engine. | Reduces algorithmic complexity from |
| πͺ Windowing Functions | Attenuates spectral leakage caused by finite-length framing. | Hann ( |
| π Welch's Averaged PSD | Minimizes noise variance across long audio tracks. | Evaluates up to 24 overlapping segments (50% overlap) across multi-minute files. |
| π― Parabolic Sub-Bin Peak | Sub-bin quadratic vertex correction. | Achieves frequency detection accuracy below |
| πΉ Musical Pitch & Cents | Automatic 12-Tone Equal Temperament (12-TET) mapping. | Maps fundamental frequency to nearest MIDI note (e.g. A4, C4) and calculates microtonal deviation in Cents. |
| π Dual Scale Spectrum | Linear magnitude and Logarithmic Decibel (dB) scaling. | Real-time toggle with frequency zoom range (1 kHz, 3 kHz, 5 kHz, 10 kHz, 22 kHz). |
| π 60 FPS Live Visualizers | Dual Canvas-rendered live visual instruments. | High-resolution Oscilloscope and 64-band Real-Time Spectrum Analyzer (RTA) running at constant 60 FPS. |
| π Scientific Report Export | Instant scientific text report export (.txt). |
Outputs full signal metadata, Nyquist frequency, peak amplitudes, and secondary harmonics. |
To reconstruct a continuous-time signal
For standard audio (
Decomposes discrete time sequence
Splits input sequence into even and odd indices recursively using Twiddle factors
Reduces computational cost from
-
Hann Window:
$$w_{\text{hann}}[n] = 0.5 \left[ 1 - \cos\left(\frac{2\pi n}{N-1}\right) \right], \quad 0 \le n \le N-1$$ -
Hamming Window:
$$w_{\text{hamming}}[n] = 0.54 - 0.46 \cos\left(\frac{2\pi n}{N-1}\right)$$ -
Blackman Window:
$$w_{\text{blackman}}[n] = 0.42 - 0.5\cos\left(\frac{2\pi n}{N-1}\right) + 0.08\cos\left(\frac{4\pi n}{N-1}\right)$$
Corrects discrete bin discretization error using the three highest magnitude bins (
Calculates continuous MIDI pitch relative to Concert Pitch A4 (
flowchart TD
subgraph UI["1. Presentation Layer (React 19 + Tailwind CSS v4)"]
A["File Dropzone / Audio Selector"]
B["Time-Domain Waveform (Recharts)"]
C["Frequency Spectrum (|X(f)| Bar Chart)"]
D["Live 60 FPS Oscilloscope (HTML5 Canvas)"]
E["Live Real-Time Analyzer (RTA) Bars"]
end
subgraph WebAudio["2. Audio Streaming Layer (Web Audio API)"]
F["AudioContext Instance"]
G["decodeAudioData() ArrayBuffer"]
H["AudioBufferSourceNode (Playback)"]
I["AnalyserNode (fftSize=2048)"]
end
subgraph DSP["3. Core DSP Engine (src/utils/dsp.ts)"]
J["Stereo-to-Mono Mixdown ((L+R)/2)"]
K["Windowing Kernel (Hann / Hamming / Blackman)"]
L["Radix-2 Cooley-Tukey DIT FFT"]
M["Welch's 50% Overlap Averaged PSD"]
N["Parabolic Sub-Bin Peak Interpolator"]
O["Harmonics & MIDI Pitch Calculator"]
end
A --> G --> J
J --> K --> L --> M --> N --> O
O --> B & C
F --> H --> I --> D & E
- Node.js (v18.0 or newer recommended, tested on Node.js v24)
- npm or pnpm package manager
-
Clone the repository:
git clone https://github.com/csncoa/audio-frequency-analyzer.git cd audio-frequency-analyzer -
Install project dependencies:
npm install
-
Start local development server:
npm run dev
Open your browser and navigate to
http://localhost:3000(or the URL printed in terminal). -
Compile production build:
npm run build npm run preview
Optimized static assets will be output to the
dist/directory.
audio-frequency-analyzer/
βββ public/
β βββ screenshot.png # Application preview image
β βββ test_1000hz.wav # 1000 Hz reference test tone
β βββ test_middle_c.wav # Middle C (261.63 Hz) piano tone
βββ src/
β βββ components/
β β βββ LiveVisualizers.tsx # 60 FPS Canvas Oscilloscope & RTA Bars
β βββ utils/
β β βββ dsp.ts # Cooley-Tukey FFT, Windowing, Welch PSD
β β βββ realtimeAudio.ts # Web Audio API context & node wrapper
β βββ App.tsx # Main application state & interface
β βββ main.tsx # React DOM entrypoint
β βββ index.css # Tailwind CSS v4 styling rules
βββ package.json # Dependencies and build scripts
βββ vite.config.ts # Vite 8 bundler configuration
βββ README.md # Project documentation
The application is fully static and optimized for zero-config Vercel deployment:
Alternatively, via Vercel CLI:
npm install -g vercel
vercel --prod- Developed by: Christian Nico
- Institution: Universitas Negeri Semarang (UNNES)
- Course: Pengolahan Sinyal Digital (Digital Signal Processing / DSP)
- Year: 2026
This project is licensed under the MIT License β see the LICENSE file for details. Free for academic, educational, and research use.
