Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/equalizer_lmmse.cpp b/equalizer_lmmse.cpp
- index 6e1d818..f8b578e 100644
- --- a/equalizer_lmmse.cpp
- +++ b/equalizer_lmmse.cpp
- @@ -117,55 +117,57 @@ void equalizer_lmmse::build_channel()
- add_noise();
- }
- -void equalizer_lmmse::add_bts()
- +void equalizer_lmmse::compute_signature(size_t tx, multipath& mp)
- {
- - for (size_t i = 0; i < base_station::size(); ++i) {
- - if (ignore_interference && i != bs_id)
- - continue;
- + sig_t sig(nr_rx, osr);
- + std::vector<ublas::vector<T> > sig_mp(nr_rx);
- - base_station const& bts = base_station::reg()[i];
- + for (size_t rx = 0; rx < nr_rx; ++rx) {
- + sig(rx).resize(cest_length);
- - /* TODO: allow arbitrary precoding matrix (which is currently
- - * always the identity) */
- + std::vector<T> const& h = mp.front(rx, tx);
- - multipath& mp = bts.get_multipath(ue_id);
- - size_t nr_tx = bts.get_nr_ant();
- + sig_mp[rx].resize(filter_length);
- - for (size_t tx = 0; tx < nr_tx; ++tx) {
- - sig_t sig(nr_rx, osr);
- - std::vector<ublas::vector<T> > sig_mp(nr_rx);
- + int const start = multipath::decimation_filter_delay -
- + filter_delay;
- + size_t const end = std::min(h.size() - start, filter_length);
- - for (size_t rx = 0; rx < nr_rx; ++rx) {
- - sig(rx).resize(cest_length);
- + for (int i = 0; i < -start; ++i)
- + sig_mp[rx][i] = 0;
- - std::vector<T> const& h = mp.front(rx, tx);
- + for (size_t i = std::max(0, -start); i < end; ++i)
- + sig_mp[rx][i] = h[start + i];
- - sig_mp[rx].resize(filter_length);
- + for (size_t i = end; i < filter_length; ++i)
- + sig_mp[rx][i] = 0;
- - int const start = multipath::decimation_filter_delay
- - - filter_delay;
- - size_t const end = std::min(h.size() - start,
- - filter_length);
- + chan_imp_resp(sig(rx), h, cest_delay -
- + multipath::decimation_filter_delay);
- - for (int i = 0; i < -start; ++i)
- - sig_mp[rx][i] = 0;
- + mp.pop(rx, tx);
- + }
- - for (size_t i = std::max(0, -start); i < end; ++i)
- - sig_mp[rx][i] = h[start + i];
- + sig_vec.push_back(sig);
- + mp_vec.push_back(sig_mp);
- +}
- - for (size_t i = end; i < filter_length; ++i)
- - sig_mp[rx][i] = 0;
- +void equalizer_lmmse::add_bts()
- +{
- + for (size_t i = 0; i < base_station::size(); ++i) {
- + if (ignore_interference && i != bs_id)
- + continue;
- - chan_imp_resp(sig(rx), mp.front(rx, tx),
- - cest_delay -
- - multipath::decimation_filter_delay);
- + base_station const& bts = base_station::reg()[i];
- - mp.pop(rx, tx);
- - }
- + /* TODO: allow arbitrary precoding matrix (which is currently
- + * always the identity) */
- - sig_vec.push_back(sig);
- - mp_vec.push_back(sig_mp);
- - }
- + multipath& mp = bts.get_multipath(ue_id);
- + size_t nr_tx = bts.get_nr_ant();
- +
- + for (size_t tx = 0; tx < nr_tx; ++tx)
- + compute_signature(tx, mp);
- }
- }
- @@ -263,9 +265,8 @@ void equalizer_lmmse::update_coeff()
- size_t const width = sig_vec[j].get_width();
- sig_vec[j].expand_channel(matrix_range<mat_t>(channel,
- - range(0, height),
- - range(tx_off, tx_off + width)), filter_length,
- - filter_adv);
- + range(0, height), range(tx_off, tx_off + width)),
- + filter_length, filter_adv);
- tx_off += width;
- }
- diff --git a/equalizer_lmmse.h b/equalizer_lmmse.h
- index 9446f69..828dc43 100644
- --- a/equalizer_lmmse.h
- +++ b/equalizer_lmmse.h
- @@ -77,6 +77,8 @@ private:
- std::ofstream os_debug;
- std::ofstream os_debug_snr;
- + void compute_signature(size_t tx, multipath& mp);
- +
- public:
- template <typename Tfc>
- equalizer_lmmse(size_t ue_id, size_t bs_id, float noise_power, Tfc
Add Comment
Please, Sign In to add comment