diff SpectrogramProcessor.h @ 14:c11367df624d

* Renamed NoveltyCurve.* and Spectrogram.* to $(Name)Processor.* * Aligned novelty curve with audio - when performing FIRFilter::process(params), take inputLength after group delay. * Removed trail of Spectrogram. * General tidying!
author Carl Bussey <c.bussey@se10.qmul.ac.uk>
date Thu, 14 Aug 2014 10:31:49 +0100
parents Spectrogram.h@7680cc4c0073
children 3e4ddfbfeb81
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SpectrogramProcessor.h	Thu Aug 14 10:31:49 2014 +0100
@@ -0,0 +1,37 @@
+//
+//  Spectrogram.h
+//  Tempogram
+//
+//  Created by Carl Bussey on 07/08/2014.
+//  Copyright (c) 2014 Carl Bussey. All rights reserved.
+//
+
+#ifndef __Tempogram__Spectrogram__
+#define __Tempogram__Spectrogram__
+#include <vector>
+#include <vamp-sdk/FFT.h>
+#include <cmath>
+
+typedef std::vector <std::vector<float> > Spectrogram;
+typedef std::vector <std::vector<float> > SpectrogramTransposed;
+
+class SpectrogramProcessor{
+    size_t m_windowLength;
+    size_t m_fftLength;
+    size_t m_hopSize;
+    size_t m_numberOfOutputBins;
+    double * m_pFftInput;
+    double * m_pFftOutputReal;
+    double * m_pFftOutputImag;
+    
+    void initialise();
+    void cleanup();
+public:
+    SpectrogramProcessor(const size_t &windowLength, const size_t &fftLength, const size_t &hopSize);
+    ~SpectrogramProcessor();
+    
+    std::vector< std::vector<float> > process(const float * const pInput, const size_t &inputLength, const float * pWindow, const bool &transposeOutput = false) const;
+    static SpectrogramTransposed transpose(const Spectrogram &spectrogram);
+};
+
+#endif /* defined(__Tempogram__Spectrogram__) */