// fbank.h
/*
    Filter bank and related classes for the Vocoder
    Copyright (C) 2002 Jarno Wuolijoki and Pilvari Pirtola

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#ifndef _SPKIT_FILTERBANK_H_
#define _SPKIT_FILTERBANK_H_

#include <spkit/processo.h>
#include <spkit/bwbandpa.h>
#include <spkit/sum.h>
#include <stdio.h>
#include <stdlib.h>

class SPKitJoiner : public SPKitProcessor {
public:
    SPKitJoiner();
    virtual SPKitError setInputs(int cnt, SPKitProcessor **p);
    virtual int getSample(SPKitSample &outputSample, SPKitProcessor *caller);
protected:
    SPKitSum *sum;
};
  



class SPKitFilterbank : public SPKitProcessor {
public:
    SPKitProcessor **getOutputs() { return (SPKitProcessor**)outputs; }
    int getFilterCount() { return filterCount; }
    int getSample(SPKitSample &outputSample, SPKitProcessor *caller) { fprintf(stderr, "dont use.\n"); exit(1); return 0; } // don't use
protected:
    SPKitFilterbank();
    SPKitProcessor **outputs;
    int filterCount;
};




class SPKitFilterbankBW : public SPKitFilterbank {
public:
    SPKitFilterbankBW();
    SPKitError setInput(SPKitProcessor *input);
    SPKitError setFilterCount(int filtercount);
    void setFrqs(SPKitFloat *frqs, SPKitFloat *bws);
protected:
    SPKitProcessor *mux;
    SPKitFloat *frequencies, *bandwidths;
};



/*


class SPKitFilterbankWL : public SPKitFilterbank {
public:
    SPKitFilterbankWL();
    ~SPKitFilterbankWL();
   
    SPKitError setInputAndFilterCount(SPKitProcessor *, int cnt);
protected:
    int fcnt;
};

*/


#endif
