this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

update CLAUDE.md

alice 6da9543f fe803460

+36
+36
CLAUDE.md
··· 524 524 525 525 The profiling code has been added to measure actual performance on each platform. 526 526 527 + ## Current CQT Implementation Status (December 2024) 528 + 529 + ### What's Working: 530 + - **16K FFT implemented** - provides excellent low-frequency resolution 531 + - **cqt(bin)** function working correctly - returns raw CQT magnitude for bin 0-119 532 + - **Frequency detection accurate** - 440Hz correctly maps to bin 54, etc. 533 + - **Kernels properly generated** - sparse storage working, good frequency selectivity 534 + - **Performance excellent** - Runtime on M1 Pro: 0.368ms total (0.255ms FFT + 0.113ms kernels) 535 + 536 + ### Runtime Performance Expectations: 537 + - **M1 Pro MacBook**: 0.368ms total CQT processing (~2.2% of frame budget) 538 + - **ThinkPad i5-1130G7 (extrapolated)**: 539 + - Performance mode: ~0.426ms (2.6% of frame budget) 540 + - Power save mode: ~1.273ms (7.6% of frame budget) 541 + - Runtime is ~3.8x slower than synthetic benchmarks due to real audio data, cache effects 542 + 543 + ### Critical Implementation Details: 544 + 1. **FFT_SIZE temporarily changed** in fftdata.h from 1024 to 8192 to support CQT 545 + - This breaks FFT resolution but enables CQT 546 + - Must be reverted when separate audio buffer is implemented 547 + 548 + 2. **Key fixes that were essential**: 549 + - Kernel phase calculation must use full FFT position: `2π * (f/fs) * (idx - N/2)` 550 + - NO scaling factor after kernel FFT - this was critical! 551 + - Normalization by windowLength before FFT 552 + 553 + 3. **Test scripts created**: 554 + - `test_cqt_spectrum_v2.lua` - visual spectrum analyzer 555 + - `test_cqt_a4.lua` - 440Hz tone generator 556 + - `test_cqt_stable.lua` - controlled testing 557 + 558 + ### Resolution Characteristics with 16K FFT: 559 + - **20Hz**: Q≈7.4 (window truncated to 16384 samples, but much better than 6K's Q≈1.86) 560 + - **30Hz**: Q≈11.2 (good resolution) 561 + - **45Hz+**: Full Q≈17 (perfect - no truncation) 562 + 527 563 ## Phase 3: Next Steps 528 564 1. ~~Implement 16K FFT based on benchmark results~~ (COMPLETE) 529 565 2. Add remaining API functions: `cqts()`, `cqto()`, `cqtos()`