view cpp-qm-dsp/CQKernel.h @ 24:3973be829352

Keep the kernel dense for the moment, and use std::complex
author Chris Cannam <c.cannam@qmul.ac.uk>
date Mon, 04 Nov 2013 10:54:49 +0000
parents 701900c371b0
children a5f71b5c9f85
line wrap: on
line source

#ifndef CQ_KERNEL_H
#define CQ_KERNEL_H

#include <vector>
#include <complex>

class FFT;

class CQKernel
{
public:
    CQKernel(double sampleRate, double maxFreq, int binsPerOctave);
    ~CQKernel();
    
    struct Properties {
	double sampleRate;
	double maxFrequency;
	double minFrequency;
	int binsPerOctave;
	int fftSize;
	int fftHop;
	int atomsPerFrame;
	int atomSpacing;
	int firstCentre;
	double Q;
    };

    Properties getProperties() const { return m_p; }

private:
    Properties m_p;
    FFT *m_fft;

    struct KernelMatrix {
	std::vector<std::vector<std::complex<double> > > row;
    };
    KernelMatrix m_kernel;

    void generateKernel();
};

#endif