Commit 72be9abd authored by Daniel Clarke's avatar Daniel Clarke

added getMagnitudeDB and getPhase to maxiFFT

parent 0e0a9e80
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -30,6 +30,7 @@ inline double binToHz(unsigned int bin, unsigned int sR, unsigned int bS) {
return bin*sR/bS;
}
// is T used anywhere?
template <class T>
class maxiBarkScaleAnalyser {
......
......@@ -61,6 +61,14 @@ public:
return magnitudes[n];
}
float getMagnitudeDB(int n){
return magnitudesDB[n];
}
float getPhase(int n){
return phases[n];
}
//features
float spectralFlatness();
float spectralCentroid();
......
......@@ -29,6 +29,9 @@ EMSCRIPTEN_BINDINGS(my_module_maxiFFT) {
.function("spectralFlatness", &maxiFFT::spectralFlatness)
.function("spectralCentroid", &maxiFFT::spectralCentroid)
.function("getMagnitude", &maxiFFT::getMagnitude)
.function("getMagnitudeDB", &maxiFFT::getMagnitudeDB)
.function("getPhase", &maxiFFT::getPhase)
// .function("setTempo", &maxiClock::setTempo)
// .function("setTicksPerBeat", &maxiClock::setTicksPerBeat)
// .function("isTick", &maxiClock::isTick)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment