Qucs-core  0.0.19
spfile.h
Go to the documentation of this file.
00001 /*
00002  * spfile.h - S-parameter file class definitions
00003  *
00004  * Copyright (C) 2004, 2005, 2006, 2008, 2009 Stefan Jahn <stefan@lkcc.org>
00005  *
00006  * This is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2, or (at your option)
00009  * any later version.
00010  *
00011  * This software is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this package; see the file COPYING.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  *
00021  * $Id$
00022  *
00023  */
00024 
00025 #ifndef __SPFILE_H__
00026 #define __SPFILE_H__
00027 
00028 namespace qucs {
00029   class vector;
00030   class matvec;
00031   class dataset;
00032   class interpolator;
00033 }
00034 
00035 class spfile_vector
00036 {
00037  public:
00038   spfile_vector ();
00039   ~spfile_vector ();
00040 
00041  public:
00042   void prepare (qucs::vector *, qucs::vector *, bool, int, int);
00043   nr_complex_t interpolate (nr_double_t);
00044 
00045  public:
00046   qucs::vector * v;
00047   qucs::vector * f;
00048   int isreal;
00049   qucs::interpolator * inter;
00050   int r;
00051   int c;
00052 };
00053 
00054 class spfile : public qucs::circuit
00055 {
00056  public:
00057   CREATOR (spfile);
00058   ~spfile ();
00059   void initSP (void);
00060   void calcSP (nr_double_t);
00061   void calcNoiseSP (nr_double_t);
00062   void initDC (void);
00063   void initTR (void);
00064   void initAC (void);
00065   void calcAC (nr_double_t);
00066   void calcNoiseAC (nr_double_t);
00067   void createIndex (void);
00068   void prepare (void);
00069   void createVector (int, int);
00070   qucs::matrix correlationMatrix (nr_double_t, nr_complex_t, nr_double_t, qucs::matrix);
00071   nr_double_t noiseFigure (qucs::matrix, qucs::matrix, nr_double_t&, nr_complex_t&,
00072                            nr_double_t&);
00073   qucs::matrix expandNoiseMatrix (qucs::matrix, qucs::matrix);
00074   qucs::matrix shrinkNoiseMatrix (qucs::matrix, qucs::matrix);
00075   qucs::matrix expandSParaMatrix (qucs::matrix);
00076   qucs::matrix shrinkSParaMatrix (qucs::matrix);
00077   qucs::matrix getInterpolMatrixS (nr_double_t);
00078   qucs::matrix calcMatrixCs (nr_double_t);
00079 
00080  private:
00081   qucs::dataset * data;
00082   qucs::vector * sfreq;
00083   qucs::vector * nfreq;
00084   spfile_vector * spara;
00085   spfile_vector * RN;
00086   spfile_vector * FMIN;
00087   spfile_vector * SOPT;
00088   char paraType;
00089   int  dataType;
00090   int  interpolType;
00091 };
00092 
00093 #endif /* __SPFILE_H__ */