diff options
author | Tom Rondeau <tom@trondeau.com> | 2014-07-07 12:20:09 -0400 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2014-07-07 12:20:09 -0400 |
commit | bbfc759914da80214fabc70fbbed1edaf39f9e4b (patch) | |
tree | 712eb6d1d95445bb6535534ce86d7faf1bfe6f90 /gr-channels/lib | |
parent | 3f469513b94ac992138360caca7e1b53f82214ae (diff) | |
parent | 597b93798a804cde1783d6d2ab53b348d57c44cd (diff) |
Merge branch 'maint'
Diffstat (limited to 'gr-channels/lib')
-rw-r--r-- | gr-channels/lib/cfo_model_impl.cc | 8 | ||||
-rw-r--r-- | gr-channels/lib/cfo_model_impl.h | 2 | ||||
-rw-r--r-- | gr-channels/lib/channel_model2_impl.cc | 6 | ||||
-rw-r--r-- | gr-channels/lib/channel_model2_impl.h | 2 | ||||
-rw-r--r-- | gr-channels/lib/channel_model_impl.cc | 4 | ||||
-rw-r--r-- | gr-channels/lib/channel_model_impl.h | 2 | ||||
-rw-r--r-- | gr-channels/lib/dynamic_channel_model_impl.cc | 6 | ||||
-rw-r--r-- | gr-channels/lib/dynamic_channel_model_impl.h | 6 | ||||
-rw-r--r-- | gr-channels/lib/fading_model_impl.cc | 4 | ||||
-rw-r--r-- | gr-channels/lib/flat_fader_impl.cc | 14 | ||||
-rw-r--r-- | gr-channels/lib/flat_fader_impl.h | 22 | ||||
-rw-r--r-- | gr-channels/lib/selective_fading_model_impl.cc | 12 | ||||
-rw-r--r-- | gr-channels/lib/selective_fading_model_impl.h | 6 | ||||
-rw-r--r-- | gr-channels/lib/sro_model_impl.cc | 4 | ||||
-rw-r--r-- | gr-channels/lib/sro_model_impl.h | 2 |
15 files changed, 50 insertions, 50 deletions
diff --git a/gr-channels/lib/cfo_model_impl.cc b/gr-channels/lib/cfo_model_impl.cc index 09a4d9fb99..81d2c59fb1 100644 --- a/gr-channels/lib/cfo_model_impl.cc +++ b/gr-channels/lib/cfo_model_impl.cc @@ -26,7 +26,7 @@ namespace gr { namespace channels { - + cfo_model::sptr cfo_model::make( double sample_rate_hz, @@ -83,7 +83,7 @@ namespace gr { out[i] = in[i] * gr_complex(d_table.cos(d_angle), d_table.sin(d_angle)); } return noutput_items; - + } void @@ -95,13 +95,13 @@ namespace gr { alias(), "cfo", &d_cfo, pmt::mp(-10.0f), pmt::mp(10.0f), pmt::mp(0.0f), "", "Current CFO in Hz", RPC_PRIVLVL_MIN, - DISPTIME | DISPOPTSTRIP))); + DISPTIME | DISPOPTSTRIP))); add_rpc_variable( rpcbasic_sptr(new rpcbasic_register_variable<double>( alias(), "cfo_max", &d_max_dev_hz, pmt::mp(-10.0f), pmt::mp(10.0f), pmt::mp(0.0f), "", "Max CFO in Hz", RPC_PRIVLVL_MIN, - DISPTIME | DISPOPTSTRIP))); + DISPTIME | DISPOPTSTRIP))); #endif /* GR_CTRLPORT */ } diff --git a/gr-channels/lib/cfo_model_impl.h b/gr-channels/lib/cfo_model_impl.h index ae51c340d9..a8774c91bb 100644 --- a/gr-channels/lib/cfo_model_impl.h +++ b/gr-channels/lib/cfo_model_impl.h @@ -52,7 +52,7 @@ namespace gr { double std_dev_hz, double max_dev_hz, double noise_seed=0 ); - + ~cfo_model_impl(); void setup_rpc(); int work(int, gr_vector_const_void_star&, gr_vector_void_star&); diff --git a/gr-channels/lib/channel_model2_impl.cc b/gr-channels/lib/channel_model2_impl.cc index 7533871de2..0c158be5af 100644 --- a/gr-channels/lib/channel_model2_impl.cc +++ b/gr-channels/lib/channel_model2_impl.cc @@ -21,14 +21,14 @@ */ #define _USE_MATH_DEFINES - + #include "channel_model2_impl.h" #include <gnuradio/io_signature.h> #include <iostream> namespace gr { namespace channels { - + channel_model2::sptr channel_model2::make(double noise_voltage, double epsilon, @@ -150,7 +150,7 @@ namespace gr { pmt::mp(0.0), pmt::mp(2.0), pmt::mp(0.0), "", "Timing Offset", RPC_PRIVLVL_MIN, DISPTIME | DISPOPTSTRIP))); - + add_rpc_variable( rpcbasic_sptr(new rpcbasic_register_get<channel_model2, std::vector<gr_complex> >( alias(), "taps", diff --git a/gr-channels/lib/channel_model2_impl.h b/gr-channels/lib/channel_model2_impl.h index 3bf1adb44e..2cafce4c82 100644 --- a/gr-channels/lib/channel_model2_impl.h +++ b/gr-channels/lib/channel_model2_impl.h @@ -57,7 +57,7 @@ namespace gr { const std::vector<gr_complex> &taps, double noise_seed, bool block_tags); - + ~channel_model2_impl(); void setup_rpc(); diff --git a/gr-channels/lib/channel_model_impl.cc b/gr-channels/lib/channel_model_impl.cc index 7db4e6aa5c..6e3e49de73 100644 --- a/gr-channels/lib/channel_model_impl.cc +++ b/gr-channels/lib/channel_model_impl.cc @@ -26,7 +26,7 @@ namespace gr { namespace channels { - + channel_model::sptr channel_model::make(double noise_voltage, double frequency_offset, @@ -168,7 +168,7 @@ namespace gr { pmt::mp(0.0), pmt::mp(2.0), pmt::mp(0.0), "", "Timing Offset", RPC_PRIVLVL_MIN, DISPTIME | DISPOPTSTRIP))); - + add_rpc_variable( rpcbasic_sptr(new rpcbasic_register_get<channel_model, std::vector<gr_complex> >( alias(), "taps", diff --git a/gr-channels/lib/channel_model_impl.h b/gr-channels/lib/channel_model_impl.h index 3faf6c3bbe..9247b245c0 100644 --- a/gr-channels/lib/channel_model_impl.h +++ b/gr-channels/lib/channel_model_impl.h @@ -56,7 +56,7 @@ namespace gr { const std::vector<gr_complex> &taps, double noise_seed, bool block_tags); - + ~channel_model_impl(); void setup_rpc(); diff --git a/gr-channels/lib/dynamic_channel_model_impl.cc b/gr-channels/lib/dynamic_channel_model_impl.cc index 7c2044570a..e9e9a93d0c 100644 --- a/gr-channels/lib/dynamic_channel_model_impl.cc +++ b/gr-channels/lib/dynamic_channel_model_impl.cc @@ -26,7 +26,7 @@ namespace gr { namespace channels { - + dynamic_channel_model::sptr dynamic_channel_model::make( double samp_rate, @@ -38,7 +38,7 @@ namespace gr { double doppler_freq, bool LOS_model, float K, - std::vector<float> delays, + std::vector<float> delays, std::vector<float> mags, int ntaps_mpath, double noise_amp, @@ -62,7 +62,7 @@ namespace gr { double doppler_freq, bool LOS_model, float K, - std::vector<float> delays, + std::vector<float> delays, std::vector<float> mags, int ntaps_mpath, double noise_amp, diff --git a/gr-channels/lib/dynamic_channel_model_impl.h b/gr-channels/lib/dynamic_channel_model_impl.h index 2eabac0be0..b0d42c8875 100644 --- a/gr-channels/lib/dynamic_channel_model_impl.h +++ b/gr-channels/lib/dynamic_channel_model_impl.h @@ -63,7 +63,7 @@ namespace gr { int ntaps_mpath, double noise_amp, double noise_seed); - + ~dynamic_channel_model_impl(); void setup_rpc(); @@ -77,9 +77,9 @@ namespace gr { double doppler_freq() const { return d_fader->fDTs()*samp_rate(); } double K() const { return d_fader->K(); } - void set_samp_rate(double sr) { + void set_samp_rate(double sr) { d_fader->set_fDTs( doppler_freq()/samp_rate() ); - d_sro_model->set_samp_rate(sr); + d_sro_model->set_samp_rate(sr); d_cfo_model->set_samp_rate(sr); } void set_sro_dev_std(double dev) { d_sro_model->set_max_dev(dev); } void set_sro_dev_max(double dev) { d_sro_model->set_max_dev(dev); } diff --git a/gr-channels/lib/fading_model_impl.cc b/gr-channels/lib/fading_model_impl.cc index 4ea4d1274e..7eb9d0612c 100644 --- a/gr-channels/lib/fading_model_impl.cc +++ b/gr-channels/lib/fading_model_impl.cc @@ -37,7 +37,7 @@ namespace gr { namespace channels { - + fading_model::sptr fading_model::make( unsigned int N, float fDTs, bool LOS, float K, int seed ) { @@ -109,7 +109,7 @@ namespace gr { #endif /* GR_CTRLPORT */ } - int + int fading_model_impl::work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) diff --git a/gr-channels/lib/flat_fader_impl.cc b/gr-channels/lib/flat_fader_impl.cc index 33cf37d23b..0b4cab2337 100644 --- a/gr-channels/lib/flat_fader_impl.cc +++ b/gr-channels/lib/flat_fader_impl.cc @@ -29,11 +29,11 @@ namespace gr { seed_1((int)seed), dist_1(-M_PI, M_PI), rv_1( seed_1, dist_1 ), // U(-pi,pi) - + seed_2((int)seed+1), dist_2(0, 1), rv_2( seed_2, dist_2 ), // U(0,1) - + d_N(N), d_fDTs(fDTs), d_theta(rv_1()), @@ -42,12 +42,12 @@ namespace gr { d_m(0), d_K(K), d_LOS(LOS), - + d_psi(d_N+1, 0), d_phi(d_N+1, 0), - + d_table(8*1024), - + scale_sin(sqrtf(2.0/d_N)), scale_los(sqrtf(d_K)/sqrtf(d_K+1)), scale_nlos(1/sqrtf(d_K+1)) @@ -58,8 +58,8 @@ namespace gr { d_phi[i] = rv_1(); } } - - + + gr_complex flat_fader_impl::next_sample(){ gr_complex H(0,0); diff --git a/gr-channels/lib/flat_fader_impl.h b/gr-channels/lib/flat_fader_impl.h index 08c55db3ed..ae782ffc78 100644 --- a/gr-channels/lib/flat_fader_impl.h +++ b/gr-channels/lib/flat_fader_impl.h @@ -37,7 +37,7 @@ #define FASTSINCOS 2 namespace gr { - namespace channels { + namespace channels { class flat_fader_impl { private: @@ -45,12 +45,12 @@ namespace gr { boost::mt19937 seed_1; boost::uniform_real<> dist_1; // U(-pi,pi) boost::variate_generator<boost::mt19937&, boost::uniform_real<> > rv_1; - + // random walk variate boost::mt19937 seed_2; boost::uniform_real<> dist_2; // U(-pi,pi) boost::variate_generator<boost::mt19937&, boost::uniform_real<> > rv_2; - + public: int d_N; // number of sinusoids float d_fDTs; // normalized maximum doppler frequency @@ -58,24 +58,24 @@ namespace gr { float d_theta_los; float d_step; // maximum random walk step size uint64_t d_m; // sample counter - + float d_K; // Rician factor (ratio of the specular power to the scattered power) bool d_LOS; // LOS path exists? chooses Rician (LOS) vs Rayleigh (NLOS) model. - + std::vector<float> d_psi; // in-phase initial phase std::vector<float> d_phi; // quadrature initial phase - + std::vector<float> d_costable; - + sincostable d_table; - + float scale_sin, scale_los, scale_nlos; - + void update_theta(); - + flat_fader_impl(unsigned int N, float fDTs, bool LOS, float K, int seed); gr_complex next_sample(); - + }; /* class flat_fader_impl */ } /* namespace channels */ } /* namespace gr */ diff --git a/gr-channels/lib/selective_fading_model_impl.cc b/gr-channels/lib/selective_fading_model_impl.cc index 53d5b3349b..dfd7b74ca9 100644 --- a/gr-channels/lib/selective_fading_model_impl.cc +++ b/gr-channels/lib/selective_fading_model_impl.cc @@ -37,7 +37,7 @@ namespace gr { namespace channels { - + selective_fading_model::sptr selective_fading_model::make( unsigned int N, float fDTs, bool LOS, float K, int seed, std::vector<float> delays, std::vector<float> mags, int ntaps) { @@ -60,7 +60,7 @@ namespace gr { for(size_t i=0; i<mags.size(); i++){ d_faders.push_back(new gr::channels::flat_fader_impl(N, fDTs, (i==0)&&(LOS), K, seed+i)); } - + // set up tap history if(ntaps < 1){ throw std::runtime_error("ntaps must be >= 1"); } set_history(1+ntaps); @@ -74,7 +74,7 @@ namespace gr { } } - int + int selective_fading_model_impl::work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) @@ -89,13 +89,13 @@ namespace gr { for(size_t j=0; j<d_taps.size(); j++){ d_taps[j] = gr_complex(0,0); } - + // add each flat fading component to the taps for(size_t j=0; j<d_faders.size(); j++){ gr_complex ff_H(d_faders[j]->next_sample()); for(size_t k=0; k<d_taps.size(); k++){ float dist = k-d_delays[j]; - float interpmag = d_sintable.sinc(2*M_PI*dist); + float interpmag = d_sintable.sinc(2*M_PI*dist); d_taps[k] += ff_H * interpmag * d_mags[j]; } } @@ -106,7 +106,7 @@ namespace gr { sum += in[i+j] * d_taps[d_taps.size()-j-1]; } - // assign output + // assign output out[i] = sum; } diff --git a/gr-channels/lib/selective_fading_model_impl.h b/gr-channels/lib/selective_fading_model_impl.h index 769077aea2..39e3474bc6 100644 --- a/gr-channels/lib/selective_fading_model_impl.h +++ b/gr-channels/lib/selective_fading_model_impl.h @@ -58,15 +58,15 @@ namespace gr { virtual float K(){ return d_faders[0]->d_K; } virtual float step(){ return d_faders[0]->d_step; } - virtual void set_fDTs(float fDTs){ + virtual void set_fDTs(float fDTs){ BOOST_FOREACH( gr::channels::flat_fader_impl* fader, d_faders ) { fader->d_fDTs = fDTs; fader->d_step = powf(0.00125*fDTs, 1.1); } } - virtual void set_K(float K){ + virtual void set_K(float K){ BOOST_FOREACH( gr::channels::flat_fader_impl* fader, d_faders ) { fader->d_K = K; fader->scale_los = sqrtf(fader->d_K)/sqrtf(fader->d_K+1); fader->scale_nlos = (1/sqrtf(fader->d_K+1)); } } - virtual void set_step(float step){ + virtual void set_step(float step){ BOOST_FOREACH( gr::channels::flat_fader_impl* fader, d_faders ) { fader->d_step = step; } } diff --git a/gr-channels/lib/sro_model_impl.cc b/gr-channels/lib/sro_model_impl.cc index 9ae2b945a7..116d8e38d2 100644 --- a/gr-channels/lib/sro_model_impl.cc +++ b/gr-channels/lib/sro_model_impl.cc @@ -30,7 +30,7 @@ namespace gr { namespace channels { - + sro_model::sptr sro_model::make( double sample_rate_hz, @@ -95,7 +95,7 @@ namespace gr { d_sro = std::min(d_sro, d_max_dev_hz); d_sro = std::max(d_sro, -d_max_dev_hz); d_mu_inc = 1.0 + d_sro/d_samp_rate; - + out[oo++] = d_interp->interpolate(&in[ii], d_mu); double s = d_mu + d_mu_inc; diff --git a/gr-channels/lib/sro_model_impl.h b/gr-channels/lib/sro_model_impl.h index dda6df5cd7..bd55bf4801 100644 --- a/gr-channels/lib/sro_model_impl.h +++ b/gr-channels/lib/sro_model_impl.h @@ -30,7 +30,7 @@ namespace gr { namespace channels { - + class CHANNELS_API sro_model_impl : public sro_model { |