summaryrefslogtreecommitdiff
path: root/src/audio/fdct.cc
AgeCommit message (Collapse)Author
15 hoursfeat(audio): Integrate FFT-based DCT/IDCT into audio engine and toolsskal
Replaced O(N²) DCT/IDCT implementations with fast O(N log N) FFT-based versions throughout the codebase. **Audio Engine:** - Updated `idct_512()` in `idct.cc` to use `idct_fft()` - Updated `fdct_512()` in `fdct.cc` to use `dct_fft()` - Synth now uses FFT-based IDCT for real-time synthesis - Spectool uses FFT-based DCT for spectrogram analysis **JavaScript Tools:** - Updated `tools/spectral_editor/dct.js` with reordering method - Updated `tools/editor/dct.js` with full FFT implementation - Both editors now use fast O(N log N) DCT/IDCT - JavaScript implementation matches C++ exactly **Performance Impact:** - Synth: ~50x faster IDCT (512-point: O(N²)→O(N log N)) - Spectool: ~50x faster DCT analysis - Web editors: Instant spectrogram computation **Compatibility:** - All existing APIs unchanged (drop-in replacement) - All 23 tests pass - Spectrograms remain bit-compatible with existing assets Ready for production use. Significant performance improvement for both runtime synthesis and offline analysis tools. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
6 daysclang-formatskal
7 daysChore: Add missing newlines at end of source filesskal
10 daysupdate asset systemskal
10 daysstyle: Add 3-line descriptive headers to all source filesskal
This commit applies a new project-wide rule that every source file must begin with a concise 3-line comment header describing its purpose. - Updated CONTRIBUTING.md with the new rule. - Applied headers to all .cc and .h files in src/ and tools/. - Fixed various minor compilation errors and missing includes discovered during the header update process.
10 daysfeat: Implement spectool & specview; refactor coding style; update docsskal
This commit introduces new tools for spectrogram manipulation and visualization, establishes a consistent coding style, and updates project documentation. Key changes include: - **Spectrogram Tools: - : A command-line utility for analyzing WAV/MP3 files into custom spectrogram format and playing back these spectrograms via the synth engine. - : A command-line tool for visualizing spectrogram files as ASCII art in the console. - **Coding Style Enforcement: - Added a configuration file enforcing LLVM-based style with 2-space indentation, no tabs, and an 80-column line limit. - Renamed all C++ source files from to for project consistency. - Applied automatic formatting using exit across the entire codebase. - **Documentation & Workflow: - Created to define a commit policy requiring tests to pass before committing. - Updated with instructions for building and using and , and referenced . - Updated and to reflect the new tools, audio architecture decisions (real-time additive synthesis, double-buffering for dynamic updates, WAV/MP3 support), coding style, and development workflow. - **Build System: - Modified to: - Include new targets for and under the option. - Update source file extensions to . - Add a new end-to-end test for to the suite.