comparison plugins/AdaptiveSpectrogram.h @ 156:93355d263f8e

Add decimation factor to adaptive spectrogram
author Chris Cannam <c.cannam@qmul.ac.uk>
date Thu, 30 Jan 2014 10:04:06 +0000
parents 38502a1595ff
children
comparison
equal deleted inserted replaced
155:46cee2d97bfc 156:93355d263f8e
20 #include <vector> 20 #include <vector>
21 21
22 #include <dsp/transforms/FFT.h> 22 #include <dsp/transforms/FFT.h>
23 #include <base/Window.h> 23 #include <base/Window.h>
24 24
25 #include "thread/Thread.h" 25 #include <thread/Thread.h>
26 #include "thread/AsynchronousTask.h" 26 #include <thread/AsynchronousTask.h>
27 #include "thread/BlockAllocator.h" 27 #include <thread/BlockAllocator.h>
28
29 class Decimator;
28 30
29 class AdaptiveSpectrogram : public Vamp::Plugin 31 class AdaptiveSpectrogram : public Vamp::Plugin
30 { 32 {
31 public: 33 public:
32 AdaptiveSpectrogram(float inputSampleRate); 34 AdaptiveSpectrogram(float inputSampleRate);
61 protected: 63 protected:
62 int m_w; 64 int m_w;
63 int m_n; 65 int m_n;
64 bool m_coarse; 66 bool m_coarse;
65 bool m_threaded; 67 bool m_threaded;
68 int m_decFactor;
69 float *m_buffer;
70 int m_buflen;
71 Decimator *m_decimator;
66 72
67 struct Spectrogram 73 struct Spectrogram
68 { 74 {
69 int resolution; 75 int resolution;
70 int width; 76 int width;
284 void printCutting(Cutting *, std::string) const; 290 void printCutting(Cutting *, std::string) const;
285 291
286 void assemble(const Spectrograms &, const Cutting *, 292 void assemble(const Spectrograms &, const Cutting *,
287 std::vector<std::vector<float> > &, 293 std::vector<std::vector<float> > &,
288 int x, int y, int w, int h) const; 294 int x, int y, int w, int h) const;
289 }; 295 };
290 296
291 297
292 #endif 298 #endif