This program computes a persistence spectrum from a binary file of Fourier transforms.
It reads 2048-point FFT frames in dB and builds a histogram of occurrence over a given dB range.
mkdir -p build
cd build
cmake ..
cmake --build . --config ReleaseRequires a C++17 compiler (Clang, GCC, or MSVC).
./persistence <input_file.fft> <output_file.hist> [y_min] [y_max] [height]Defaults: y_min = -130, y_max = -60, height = 2048
Example:
./persistence data/dmr.fft data/my_dmr.hist- Input: binary file of
float32values (each frame = 2048 values).
The provided datasets are already in dB. - Output: binary file of
uint32values (height × 2048, row-major).- Row 0 → lowest dB (
y_min) - Row
height-1→ highest dB (y_max)
- Row 0 → lowest dB (
- Values equal to
y_maxare included in the last bin. - Basic checks are performed on file size and arguments.
- Default height (2048) matches the reference
dmr.hist.