|
7 | 7 |
|
8 | 8 | A compact but serious **C++ DSP showcase** focused on practical signal-processing kernels, reproducible verification, and cross-platform engineering discipline. |
9 | 9 |
|
10 | | -This repository is built to demonstrate more than isolated DSP formulas. It shows how classic signal-processing blocks can be packaged into a modern C++ project with clean builds, automated testing, CI, and benchmark reporting. |
| 10 | +--- |
11 | 11 |
|
12 | | -## Highlights |
13 | | - |
14 | | -- modern **C++17** codebase |
15 | | -- **CMake + CTest + GoogleTest** workflow |
16 | | -- CI on **Linux** and **Windows** |
17 | | -- correctness-first implementation with clear optimization headroom |
18 | | -- benchmark reporting for performance-oriented iteration |
19 | | - |
20 | | -## Why this repository matters |
21 | | - |
22 | | -Many DSP repositories stop at notebook-level prototypes or disconnected code snippets. `cpp-dsp-showcase` is intentionally positioned as a **portfolio-grade engineering sample**: small enough to review quickly, but substantial enough to demonstrate algorithm design, code organization, verification strategy, and performance awareness. |
23 | | - |
24 | | -It is especially useful for: |
25 | | - |
26 | | -- C++ DSP portfolio presentation |
27 | | -- interview and technical discussion material |
28 | | -- experimentation with classic DSP primitives |
29 | | -- future expansion toward SDR, audio, radar, and measurement-oriented workflows |
30 | | - |
31 | | -## Implemented DSP blocks |
32 | | - |
33 | | -### Core source files |
34 | | - |
35 | | -- `my_project/include/my_project/dsp.hpp` |
36 | | -- `my_project/src/dsp.cpp` |
| 12 | +## DSP modules overview |
37 | 13 |
|
38 | | -### Available algorithms and helpers |
| 14 | + |
39 | 15 |
|
40 | | -- **Windowed-sinc FIR low-pass design** using a Blackman window and DC normalization |
41 | | -- **Time-domain convolution** |
42 | | -- **Goertzel tone power detector** |
43 | | -- **GCC-PHAT delay estimation** |
44 | | -- **Rational resampler `L/M`** using upsample-filter-decimate flow |
45 | | -- **Utility helpers** for tone generation, RMS, and frequency-response inspection |
| 16 | +--- |
46 | 17 |
|
47 | | -## Verification and performance workflow |
| 18 | +## Visual validation artifacts |
48 | 19 |
|
49 | | -The repository is structured to validate both correctness and practical usability: |
| 20 | +### FIR frequency response |
50 | 21 |
|
51 | | -- unit tests are auto-discovered via `gtest_discover_tests` |
52 | | -- a smoke test exercises the demo executable |
53 | | -- a dedicated performance suite is exposed through `ctest -L perf` |
54 | | -- a benchmark target generates a Markdown report at `build/reports/dsp_performance.md` |
| 22 | + |
55 | 23 |
|
56 | | -## Quick start |
| 24 | +### Goertzel tone detection |
57 | 25 |
|
58 | | -```bash |
59 | | -cmake -S . -B build -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release |
60 | | -cmake --build build --config Release |
61 | | -ctest --test-dir build -C Release --output-on-failure |
62 | | -ctest --test-dir build -C Release -L perf --output-on-failure |
63 | | -cmake --build build --config Release --target benchmark_report |
64 | | -``` |
| 26 | + |
65 | 27 |
|
66 | | -## Run the demo |
| 28 | +### GCC-PHAT delay estimation |
67 | 29 |
|
68 | | -```bash |
69 | | -cmake --build build --config Release --target my_project_demo |
70 | | -./build/my_project/my_project_demo |
71 | | -``` |
| 30 | + |
72 | 31 |
|
73 | | -The demo prints key runtime indicators such as input RMS, filtered RMS, passband magnitude, stopband magnitude, and resampled signal length. |
| 32 | +--- |
74 | 33 |
|
75 | | -## Benchmark snapshot |
| 34 | +## Algorithm engineering table |
76 | 35 |
|
77 | | -A local performance snapshot is available in [docs/perf_report.md](docs/perf_report.md): |
| 36 | +| Algorithm | Validation | Complexity | Optimization target | |
| 37 | +|---|---|---|---| |
| 38 | +| FIR (windowed-sinc) | unit tests + freq response | O(N·M) | SIMD / FFT convolution | |
| 39 | +| Convolution | impulse + RMS checks | O(N·M) | overlap-save FFT | |
| 40 | +| Goertzel | tone detection tests | O(N) | vectorization | |
| 41 | +| GCC-PHAT | delay accuracy tests | O(N²) (DFT) | FFT-based cross-spectrum | |
| 42 | +| Resampler L/M | length + spectral checks | O(N·M) | polyphase filters | |
78 | 43 |
|
79 | | -| Benchmark | Samples | Avg time (ms) | Throughput (MSa/s) | |
80 | | -|---|---:|---:|---:| |
81 | | -| FIR 127-tap convolution | 32768 | 2.794 | 11.727 | |
82 | | -| Goertzel power detector | 8192 | 0.044 | 184.380 | |
83 | | -| GCC-PHAT delay estimate | 1024 | 179.096 | 0.006 | |
| 44 | +--- |
84 | 45 |
|
85 | | -These values are hardware-, compiler-, and configuration-dependent, but they make the repository immediately more useful for discussing optimization priorities. |
| 46 | +## Engineering decisions |
86 | 47 |
|
87 | | -## CI |
| 48 | +This repository intentionally prioritizes **clarity and correctness over premature optimization**. |
88 | 49 |
|
89 | | -Workflow file: |
| 50 | +Key design choices: |
90 | 51 |
|
91 | | -- `.github/workflows/cmake-multi-platform.yml` |
| 52 | +- **Readable DSP kernels** instead of opaque optimized code |
| 53 | +- **Naive DFT baseline for GCC-PHAT** to make algorithm structure explicit |
| 54 | +- **Time-domain FIR** as a reference implementation before FFT acceleration |
| 55 | +- **Strict test coverage** before performance tuning |
| 56 | +- **Separation of concerns**: DSP / tests / benchmarks / reports |
92 | 57 |
|
93 | | -### CI matrix |
| 58 | +Trade-offs: |
94 | 59 |
|
95 | | -- `ubuntu-latest` |
96 | | -- `windows-latest` |
| 60 | +- Lower raw performance in exchange for transparency |
| 61 | +- Explicit optimization roadmap (SIMD, FFT, fixed-point) |
97 | 62 |
|
98 | | -### CI responsibilities |
| 63 | +This makes the project ideal as a **portfolio artifact and engineering discussion base**. |
99 | 64 |
|
100 | | -- configure and build the project |
101 | | -- run the full automated test suite |
102 | | -- run performance-labeled tests |
103 | | -- generate and upload the benchmark report artifact |
| 65 | +--- |
104 | 66 |
|
105 | | -## Repository layout |
106 | | - |
107 | | -- `my_project/include/my_project/dsp.hpp` — public DSP API |
108 | | -- `my_project/src/` — implementations and demo executable |
109 | | -- `my_project/tests/` — unit tests |
110 | | -- `my_project/bench/` — performance benchmark executable |
111 | | -- `docs/dsp_tasks.md` — advanced DSP backlog |
112 | | -- `docs/perf_report.md` — local performance snapshot |
113 | | - |
114 | | -## Performance notes |
115 | | - |
116 | | -A notable current optimization target is the GCC-PHAT path, where the implementation currently uses a naive DFT-based approach. That keeps the algorithm readable while leaving clear room for future FFT-based acceleration. |
117 | | - |
118 | | -In other words, the repository is already strong as a correctness-first showcase while still exposing realistic performance engineering opportunities. |
119 | | - |
120 | | -## Roadmap |
121 | | - |
122 | | -See [docs/dsp_tasks.md](docs/dsp_tasks.md) for the advanced backlog. Current directions include: |
123 | | - |
124 | | -- sub-sample TDOA |
125 | | -- adaptive filters (`LMS`, `NLMS`, `RLS`) |
126 | | -- polyphase channelizer |
127 | | -- OFDM synchronization |
128 | | -- beamforming |
129 | | -- fixed-point DSP kernels |
130 | | -- SIMD-oriented optimization and performance hardening |
131 | | - |
132 | | -## Future improvements |
| 67 | +## Highlights |
133 | 68 |
|
134 | | -Potential next steps for making the repository even stronger: |
| 69 | +- modern **C++17** codebase |
| 70 | +- **CMake + CTest + GoogleTest** workflow |
| 71 | +- CI on **Linux** and **Windows** |
| 72 | +- correctness-first implementation with clear optimization headroom |
| 73 | +- benchmark reporting for performance-oriented iteration |
135 | 74 |
|
136 | | -- replace naive DFT paths with FFT-based implementations |
137 | | -- add SIMD-accelerated kernels for selected hot loops |
138 | | -- introduce fixed-point variants for embedded-oriented DSP paths |
139 | | -- add richer benchmark comparisons across platforms and toolchains |
140 | | -- include small visual artifacts such as impulse-response or frequency-response plots |
| 75 | +--- |
141 | 76 |
|
142 | 77 | ## License |
143 | 78 |
|
144 | | -This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. |
| 79 | +MIT |
0 commit comments