summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--simpl/loris.i6
-rw-r--r--simpl/loris.py2
-rw-r--r--src/loris/Analyzer.C5
-rw-r--r--src/loris/Analyzer.h10
4 files changed, 18 insertions, 5 deletions
diff --git a/simpl/loris.i b/simpl/loris.i
index 73222ff..c09a257 100644
--- a/simpl/loris.i
+++ b/simpl/loris.i
@@ -1724,6 +1724,12 @@ Partial formation.") analyze;
return partials;
}
}
+
+%feature("docstring",
+"Analyze a vector of (mono) samples at the given sample rate
+(in Hz) and return the resulting peaks in a Peaks object.");
+
+ void analyze_peaks( const std::vector<double> & vec, double srate );
%feature("docstring",
"Return the amplitude floor (lowest detected spectral amplitude),
diff --git a/simpl/loris.py b/simpl/loris.py
index 6a7a11a..f6e4a81 100644
--- a/simpl/loris.py
+++ b/simpl/loris.py
@@ -18,6 +18,8 @@ import simpl
from simpl import simplloris
import numpy as np
+Analyzer = simplloris.Analyzer
+
class LorisPeakDetection(simpl.PeakDetection):
"Sinusoidal peak detection using Loris"
def __init__(self):
diff --git a/src/loris/Analyzer.C b/src/loris/Analyzer.C
index 7ed7469..5b4996c 100644
--- a/src/loris/Analyzer.C
+++ b/src/loris/Analyzer.C
@@ -732,6 +732,11 @@ Analyzer::analyze( const double * bufBegin, const double * bufEnd, double srate,
}
}
+void
+Analyzer::analyze_peaks( const std::vector<double> & vec, double srate )
+{
+ printf("analyze_peaks\n");
+}
// -- parameter access --
// ---------------------------------------------------------------------------
diff --git a/src/loris/Analyzer.h b/src/loris/Analyzer.h
index 6bdfe52..58ece87 100644
--- a/src/loris/Analyzer.h
+++ b/src/loris/Analyzer.h
@@ -37,18 +37,16 @@
#include "LinearEnvelope.h"
#include "Partial.h"
#include "PartialList.h"
-// #include "SpectralPeaks.h"
+#include "SpectralPeaks.h"
// begin namespace
namespace Loris {
class Envelope;
class LinearEnvelopeBuilder;
-// class Peaks;
-// class Peaks::iterator;
// oooo, this is nasty, need to fix it!
-class SpectralPeak;
-typedef std::vector< SpectralPeak > Peaks;
+// class SpectralPeak;
+// typedef std::vector< SpectralPeak > Peaks;
// ---------------------------------------------------------------------------
// class Analyzer
@@ -251,6 +249,8 @@ public:
//! frequency contour expected of the resulting Partials.
void analyze( const double * bufBegin, const double * bufEnd, double srate,
const Envelope & reference );
+
+ void analyze_peaks( const std::vector<double> & vec, double srate );
// -- parameter access --