Scrolling spectrogram buffer that accumulates STFT frames as rows.
More...
#include <spectrogram.hpp>
|
| void | configure (int width, int height) |
| | Configure the buffer.
|
| template<typename SampleType = float> |
| void | push_column (const SampleType *magnitudes_db, int num_bins, const ColorMapper &mapper, float min_db=-80.0f, float max_db=0.0f) |
| | Push a new STFT frame as a column of colors.
|
| void | push_column (std::nullptr_t magnitudes_db, int num_bins, const ColorMapper &mapper, float min_db=-80.0f, float max_db=0.0f) |
| const SpectrogramColor * | pixels () const |
| | Access the pixel buffer for rendering.
|
| int | write_column () const |
| | Get the column index where the next frame will be written.
|
| int | width () const |
| int | height () const |
| int | frames_written () const |
Scrolling spectrogram buffer that accumulates STFT frames as rows.
Each row is a time slice; columns are frequency bins mapped to colors.
RT contract: configure() allocates storage and is prepare/control-thread work. push_column() and accessors are allocation-free after configure().
◆ configure()
| void pulp::signal::SpectrogramBuffer::configure |
( |
int | width, |
|
|
int | height ) |
|
inline |
Configure the buffer.
- Parameters
-
| width | Number of time columns (scroll history depth). |
| height | Number of frequency rows (typically num_bins or display height). |
◆ frames_written()
| int pulp::signal::SpectrogramBuffer::frames_written |
( |
| ) |
const |
|
inline |
◆ height()
| int pulp::signal::SpectrogramBuffer::height |
( |
| ) |
const |
|
inline |
◆ pixels()
Access the pixel buffer for rendering.
Layout: row-major, height rows x width columns. The newest column is at (write_col_ - 1), scrolling left.
◆ push_column() [1/2]
template<typename SampleType = float>
| void pulp::signal::SpectrogramBuffer::push_column |
( |
const SampleType * | magnitudes_db, |
|
|
int | num_bins, |
|
|
const ColorMapper & | mapper, |
|
|
float | min_db = -80.0f, |
|
|
float | max_db = 0.0f ) |
|
inline |
Push a new STFT frame as a column of colors.
magnitudes_db: dB-scaled magnitude array, one per frequency bin. The caller maps bins to rows; this function maps dB values to colors.
◆ push_column() [2/2]
| void pulp::signal::SpectrogramBuffer::push_column |
( |
std::nullptr_t | magnitudes_db, |
|
|
int | num_bins, |
|
|
const ColorMapper & | mapper, |
|
|
float | min_db = -80.0f, |
|
|
float | max_db = 0.0f ) |
|
inline |
◆ width()
| int pulp::signal::SpectrogramBuffer::width |
( |
| ) |
const |
|
inline |
◆ write_column()
| int pulp::signal::SpectrogramBuffer::write_column |
( |
| ) |
const |
|
inline |
Get the column index where the next frame will be written.
The documentation for this class was generated from the following file:
- /home/runner/work/pulp/pulp/core/signal/include/pulp/signal/spectrogram.hpp