00001 // Copyright(c) 1993-1996 Tony Kirke 00002 /* 00003 * SPUC - Signal processing using C++ - A DSP library 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2, or (at your option) 00008 * any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 #ifndef QPSK 00020 #define QPSK 00021 #include <spuc.h> 00022 #include <stdlib.h> 00023 #include <stdio.h> 00024 #include <string> 00025 #include <math.h> 00026 //#include <limits.h> 00027 #include <time.h> 00028 #include <iostream> 00029 #include <complex.h> 00030 #include <delay.h> 00031 #include <loop_filter.h> 00032 #include <nco.h> 00033 #include <a_d.h> 00034 #include <fir.h> 00035 #include <fir_interp.h> 00036 #include <lagrange.h> 00037 #include <discriminators.h> 00038 //#include <raised_cosine.h> 00039 #include "carrier_nco.h" 00040 namespace SPUC { 00046 00047 00048 00049 00050 00051 class qpsk 00052 { 00053 public: 00054 00055 a_d ADC; 00056 loop_filter<long> carrier_loop_filter; 00057 loop_filter<long> symbol_loop_filter; 00058 00059 complex<long> prev_sam,prev_sym; 00060 complex<long> decision; 00061 00062 long carrier_loop_out,symbol_loop_out; 00063 long symbol_clk; 00064 long symbol_clk_pls; 00065 long sample_clk; 00066 long symbol_x2_clk; 00067 long symbol_x2_clk_pls; 00068 00069 carrier_nco c_nco; 00070 00071 fir< complex<long> > rcv_sqrt_rc; 00072 00073 delay < complex<long> > hard_decision_delay,final_baseband_delay; 00074 delay < complex<long> > timing_disc_delay; 00075 00076 long bpsk; 00077 long dec_rate_log; 00078 long carrier_error; 00079 long symbol_nco_out; 00080 complex<long> hard_decision_prev,final_baseband_prev; 00081 complex<long> baseband; 00082 complex<long> resampled; 00083 complex<long> carrier_in; 00084 complex<long> carrier_nco_out; 00085 complex<long> mf_in; 00086 complex<long> mf_out; 00087 complex<long> final_baseband; 00088 long timing_error; 00089 long nda_timing_error; 00090 complex<long> hard_decision; 00091 00092 00093 long I_data() { return(re(hard_decision)); } 00094 long Q_data() { return(im(hard_decision)); } 00095 complex<long> data() { return(hard_decision); }; 00096 long carrier_loop() { return(carrier_loop_out); } 00097 long symbol_loop() { return(symbol_loop_out); } 00098 long symclk(void) { return(symbol_clk_pls); } 00099 void clock(complex<long>adc_out); 00100 qpsk(void); 00101 00102 }; 00103 } // namespace SPUC 00104 #endif