view FIRFilter.h @ 9:be59b4a73f49

* Added Spectrogram zero padding functionality * Made output bins correspond to BPM * User can now specify a range of output bins to view * Comments added
author Carl Bussey <c.bussey@se10.qmul.ac.uk>
date Tue, 12 Aug 2014 14:40:37 +0100
parents 4e429b9f2b4d
children 7680cc4c0073
line wrap: on
line source
//
//  FIRFilter.h
//  Tempogram
//
//  Created by Carl Bussey on 25/06/2014.
//  Copyright (c) 2014 Carl Bussey. All rights reserved.
//

#ifndef __Tempogram__FIRFilter__
#define __Tempogram__FIRFilter__

#include <cmath>
#include <vamp-sdk/FFT.h>
#include <assert.h>

class FIRFilter{
public:
    FIRFilter(const unsigned int lengthInput, const unsigned int numberOfCoefficients);
    ~FIRFilter();
    void process(const float *input, const float *coefficients, float *output);
private:
    unsigned int m_lengthInput;
    unsigned int m_numberOfCoefficients;
    unsigned int m_lengthFIRFFT;
    
    double *fftInput;
    double *fftCoefficients;
    double *fftReal1;
    double *fftImag1;
    double *fftReal2;
    double *fftImag2;
    double *fftFilteredReal;
    double *fftFilteredImag;
    double *fftOutputReal;
    double *fftOutputImag;
    
    void initialise();
    void cleanup();
};

#endif /* defined(__Tempogram__FIRFilter__) */