#include <HarmonicRepresentation.h>
|
| | HarmonicRepresentation (float sampleRate) |
| |
| Eigen::MatrixXf | processSignal (std::vector< float > &inputSignal) |
| | Processes the input signal and returns the matrix of partial frequencies and partial amplitudes.
|
| |
|
| void | replaceNanWithMedian (Eigen::VectorXf &inputVector) |
| | Replaces NaN values in the input vector with the median value.
|
| |
| Eigen::VectorXf | fevalbp (const Eigen::MatrixXf &bp, const Eigen::VectorXf &x_v) |
| | Estimates pitches by linear interpolation.
|
| |
| Eigen::VectorXi | findIndices (const Eigen::VectorXf &x_v, float threshMin=-std::numeric_limits< float >::infinity(), float threshMax=std::numeric_limits< float >::infinity()) |
| |
| std::vector< Eigen::MatrixXf > | calculateReshaped2D (const Eigen::MatrixXf &multiplied, int tSize, int nFreqCorrs, int nInharmCoeffs) |
| | Reshapes a flat Eigen matrix into a vector of 2D matrices, intended for handling multidimensional matrices.
|
| |
| std::vector< Eigen::MatrixXi > | applyTransformation (const std::vector< Eigen::MatrixXf > &reshapedMultiplied2_d, float binSize, int fSize) |
| |
| std::vector< Eigen::MatrixXi > | calculateDistrIdcs (int tSize, int nFreqCorrs, int nInharmCoeffs, int fSize, std::vector< Eigen::MatrixXi > &fSupIdcsTFHI2_d) |
| |
| std::vector< Eigen::MatrixXf > | extractSubmatrices (const Eigen::MatrixXf &distr, const std::vector< Eigen::MatrixXi > &distrIdcsTFHI2_d) |
| |
| std::vector< Eigen::MatrixXf > | computeTotalErgTFI (const std::vector< Eigen::MatrixXf > &submatrices_cell, int tSize, int nFreqCorrs, int nInharmCoeffs) |
| |
| std::pair< Eigen::VectorXf, Eigen::VectorXi > | maxRowValues (const Eigen::MatrixXf &matrix) |
| |
◆ HarmonicRepresentation()
| krotos::HarmonicRepresentation::HarmonicRepresentation |
( |
float | sampleRate | ) |
|
◆ applyTransformation()
| std::vector< Eigen::MatrixXi > krotos::HarmonicRepresentation::applyTransformation |
( |
const std::vector< Eigen::MatrixXf > & | reshapedMultiplied2_d, |
|
|
float | binSize, |
|
|
int | fSize ) |
|
private |
◆ calculateDistrIdcs()
| std::vector< Eigen::MatrixXi > krotos::HarmonicRepresentation::calculateDistrIdcs |
( |
int | tSize, |
|
|
int | nFreqCorrs, |
|
|
int | nInharmCoeffs, |
|
|
int | fSize, |
|
|
std::vector< Eigen::MatrixXi > & | fSupIdcsTFHI2_d ) |
|
private |
◆ calculateReshaped2D()
| std::vector< Eigen::MatrixXf > krotos::HarmonicRepresentation::calculateReshaped2D |
( |
const Eigen::MatrixXf & | multiplied, |
|
|
int | tSize, |
|
|
int | nFreqCorrs, |
|
|
int | nInharmCoeffs ) |
|
private |
Reshapes a flat Eigen matrix into a vector of 2D matrices, intended for handling multidimensional matrices.
4-D & 3-D Geometric Transformation Functions.
This function takes a flat Eigen::MatrixXf and reshapes it based on specified dimensions (tSize, nFreqCorrs) and counters (nInharmCoeffs). It is particularly useful for processing multidimensional matrix data that has been flattened into a single dimension for storage or transmission. The reshaped matrices are stored in a std::vector, allowing for easy access and manipulation of individual 2D slices of the original multidimensional matrix.
- Parameters
-
| multiplied | The flat Eigen::MatrixXf to be reshaped into multiple 2D matrices. |
| tSize | The number of rows for each reshaped 2D matrix. |
| nFreqCorrs | The number of columns for each reshaped 2D matrix. |
| nInharmCoeffs | The number of 2D matrices to extract from the flat matrix. |
- Returns
- std::vector<Eigen::MatrixXf> A vector containing the reshaped 2D matrices.
- Note
- The function assumes that the size of 'multiplied' is exactly equal to tSize * nFreqCorrs * nInharmCoeffs. If this is not the case, the behavior is undefined. For safety, consider adding a validity check to ensure that 'multiplied' contains enough elements.
◆ computeTotalErgTFI()
| std::vector< Eigen::MatrixXf > krotos::HarmonicRepresentation::computeTotalErgTFI |
( |
const std::vector< Eigen::MatrixXf > & | submatrices_cell, |
|
|
int | tSize, |
|
|
int | nFreqCorrs, |
|
|
int | nInharmCoeffs ) |
|
private |
◆ extractSubmatrices()
| std::vector< Eigen::MatrixXf > krotos::HarmonicRepresentation::extractSubmatrices |
( |
const Eigen::MatrixXf & | distr, |
|
|
const std::vector< Eigen::MatrixXi > & | distrIdcsTFHI2_d ) |
|
private |
◆ fevalbp()
| Eigen::VectorXf krotos::HarmonicRepresentation::fevalbp |
( |
const Eigen::MatrixXf & | bp, |
|
|
const Eigen::VectorXf & | x_v ) |
|
private |
Estimates pitches by linear interpolation.
Given a set of time-pitch pairs, this function estimates pitches at specified times by linearly interpolating between the nearest pitch-time pairs.
- Parameters
-
| bp | Matrix of time-pitch pairs. |
| x_v | Vector containing times at which pitches are to be estimated. |
- Returns
- Vector containing estimated pitches.
◆ findIndices()
| Eigen::VectorXi krotos::HarmonicRepresentation::findIndices |
( |
const Eigen::VectorXf & | x_v, |
|
|
float | threshMin = -std::numeric_limits<float>::infinity(), |
|
|
float | threshMax = std::numeric_limits<float>::infinity() ) |
|
private |
◆ maxRowValues()
| std::pair< Eigen::VectorXf, Eigen::VectorXi > krotos::HarmonicRepresentation::maxRowValues |
( |
const Eigen::MatrixXf & | matrix | ) |
|
|
private |
◆ processSignal()
| Eigen::MatrixXf krotos::HarmonicRepresentation::processSignal |
( |
std::vector< float > & | inputSignal | ) |
|
Processes the input signal and returns the matrix of partial frequencies and partial amplitudes.
- Parameters
-
- Returns
- A matrix representing the partial frequencies and partial amplitudes.
◆ replaceNanWithMedian()
| void krotos::HarmonicRepresentation::replaceNanWithMedian |
( |
Eigen::VectorXf & | inputVector | ) |
|
|
private |
Replaces NaN values in the input vector with the median value.
- Parameters
-
| inputVector | The input vector |
◆ config
◆ harmRep
◆ m_maxSwipepWinSize
| float krotos::HarmonicRepresentation::m_maxSwipepWinSize |
|
private |
◆ m_pitchStrengthPair
| std::pair<Eigen::VectorXf, Eigen::VectorXf> krotos::HarmonicRepresentation::m_pitchStrengthPair |
|
private |
◆ m_sampleRate
| const float krotos::HarmonicRepresentation::m_sampleRate |
|
private |
◆ m_times
| Eigen::VectorXf krotos::HarmonicRepresentation::m_times |
|
private |
◆ swipe
The documentation for this class was generated from the following files: