00001 /* 00002 * SPUC - Signal processing using C++ - A DSP library 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2, or (at your option) 00007 * any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 #include <complex.h> 00019 #include <fir.h> 00020 #include <noise.h> 00021 #ifndef FADECH 00022 #define FADECH 00023 namespace SPUC { 00032 00033 00034 00035 00036 class fading_channel 00037 { 00038 public: 00039 fir<complex<double> > exp_decay; 00040 long taps; 00041 double delay_spread; 00042 noise tap_gain; 00043 00044 // constructor 00045 fading_channel(long paths=1, double norm_delay_spread=1) { 00046 taps=paths; 00047 delay_spread = norm_delay_spread; 00048 exp_decay.set_size(taps); 00049 generate_channel(); 00050 } 00051 void setup(double norm_delay_spread); 00052 void generate_channel(); 00053 complex<double> update(const complex<double> s); 00054 }; 00055 } 00056 #endif