qf_filter.h
----------------
begin : Mon Jan 02 2006
copyright : (C) 2006 by Vincent Habchi, F5RCS
email : 10.50@free.fr
***************************************************************************/
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef _QF_FILTER_H
#define _QF_FILTER_H
#include "qf_poly.h"
#include "qf_subsection.h"
#include <QString>
#include <vector>
namespace qf {
enum filter_type { LOWPASS, HIGHPASS, BANDPASS, BANDSTOP };
typedef enum filter_type qft;
enum filter_kind { BUTT, CHEB, ICHEB, BESS, CAUER, UNDEF };
typedef enum filter_kind qfk;
enum ctype { CAP, IND, RES };
typedef enum ctype qfct;
struct comp {
qfct comp;
qf_float val;
};
typedef struct comp qfc;
class filter {
protected:
const qft type_;
const qfk kind_;
unsigned ord_;
bool is_tee_;
const qf_float fc_;
qf_float bw_;
const qf_float imp_;
std::vector<subsection> proto_subsecs_;
std::vector<subsection> subsecs_;
poly E_;
poly F_;
poly P_;
poly BN_;
poly BD_;
unsigned n_comp_;
public:
filter(qfk, qft, qf_float, qf_float, qf_float, bool);
virtual ~filter();
void extract_pole_pCsLC(qf_float, qf_float);
int order() { return ord_; }
virtual void synth() = 0;
QString to_qucs();
private:
QString num2str(qf_float);
};
}
#endif