A class for slicing audio or signal data into overlapping blocks. More...
#include <Slicer.hpp>
Public Member Functions | |
| Slicer (Eigen::Index newBlockSize, Eigen::Index newHopSize) | |
| Slicer constructor that sets the block size and hop size for slicing. | |
| void | pushSample (double sample) |
| Pushes a single sample into the internal buffer. | |
| bool | hasBlock () |
| Checks if a complete block is available for retrieval. | |
| Eigen::Map< const Eigen::ArrayXd > | getBlock () |
| Retrieves the next available block as a read-only Eigen::ArrayXd. | |
| Eigen::Index | getBlockSize () const |
| Gets the current block size. | |
| Eigen::Index | getOverlapSize () const |
| Gets the current overlap size. | |
| Eigen::Index | getHopSize () const |
| Gets the current hop size. | |
| Eigen::Index | getBufferSize () const |
| Gets the size of the internal buffer. | |
A class for slicing audio or signal data into overlapping blocks.
The Slicer class provides functionality to process a continuous stream of samples and divide it into fixed-size blocks with a specified overlap. This is useful for applications such as audio processing, feature extraction, and time-domain analysis.
| Slicer::Slicer | ( | Eigen::Index | newBlockSize, |
| Eigen::Index | newHopSize ) |
Slicer constructor that sets the block size and hop size for slicing.
Degenerate sizes are clamped to safe minimums (blockSize >= 1, 1 <= hopSize <= blockSize) instead of asserted, so owners may construct a Slicer from an invalid configuration (see NsgfCqtCommon::isValid()); such an instance is safe to hold but produces no useful blocks.
| newBlockSize | The size of each block in samples. |
| newHopSize | The hop size (step size) between consecutive blocks in samples. |
| Map< const ArrayXd > Slicer::getBlock | ( | ) |
Retrieves the next available block as a read-only Eigen::ArrayXd.
|
inline |
Gets the current block size.
|
inline |
Gets the size of the internal buffer.
|
inline |
Gets the current hop size.
|
inline |
Gets the current overlap size.
| bool Slicer::hasBlock | ( | ) |
Checks if a complete block is available for retrieval.
| void Slicer::pushSample | ( | double | sample | ) |
Pushes a single sample into the internal buffer.
| sample | The sample value to be added to the buffer. |