Skip to content

Commit 0029989

Browse files
committed
2 parents cd53e32 + ef8474e commit 0029989

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

include/lte_lib.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PSS_fd {
3232
// Return vector
3333
const itpp::cvec & operator[](const uint8 & idx) const;
3434
private:
35-
static std::vector <itpp::cvec> table;
35+
std::vector <itpp::cvec> table;
3636
};
3737
class PSS_td {
3838
public:
@@ -41,7 +41,7 @@ class PSS_td {
4141
// Return vector
4242
const itpp::cvec & operator[](const uint8 & idx) const;
4343
private:
44-
static std::vector <itpp::cvec> table;
44+
std::vector <itpp::cvec> table;
4545
};
4646

4747
// SSS is only needed in the frequency domain
@@ -52,7 +52,7 @@ class SSS_fd {
5252
// Return vector
5353
const itpp::ivec & operator()(const uint8 & n_id_1,const uint8 & n_id_2,const uint8 & n_slot) const;
5454
private:
55-
static std::vector < std::vector < std::vector <itpp::ivec> > > table;
55+
std::vector < std::vector < std::vector <itpp::ivec> > > table;
5656
};
5757
class SSS_td {
5858
public:
@@ -113,7 +113,7 @@ class Mod_map {
113113
const modulation_t::modulation_t & mod
114114
) const;
115115
private:
116-
static itpp::Array <itpp::cvec> table;
116+
itpp::Array <itpp::cvec> table;
117117
};
118118

119119
// Modulate and demodulate bits to/from symbols according to LTE specs.

src/lte_lib.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ bvec lte_pn(
147147
}
148148

149149
// Instantiate the static members
150-
vector <cvec> PSS_fd::table(3);
151-
vector <cvec> PSS_td::table(3);
150+
//vector <cvec> PSS_fd::table(3);
151+
//vector <cvec> PSS_td::table(3);
152152

153153
// PSS
154154
// Return the PSS in the frequency domain.
@@ -162,6 +162,7 @@ cvec pss_fd_calc(const uint8 & t) {
162162

163163
// Initialize table
164164
PSS_fd::PSS_fd(void) {
165+
table.resize(3);
165166
for (uint8 t=0;t<3;t++) {
166167
table[t]=pss_fd_calc(t);
167168
}
@@ -177,6 +178,7 @@ PSS_td::PSS_td(void) {
177178
cvec fd;
178179
cvec td;
179180
cvec idft_in;
181+
table.resize(3);
180182
for (uint8 t=0;t<3;t++) {
181183
fd=pss_fd_calc(t);
182184
idft_in=concat(zeros_c(1),fd(31,61),zeros_c(65),fd(0,30));
@@ -191,7 +193,7 @@ const cvec & PSS_td::operator[](const uint8 & idx) const {
191193
}
192194

193195
// Instantiate the static members
194-
vector < vector < vector <ivec> > > SSS_fd::table;
196+
//vector < vector < vector <ivec> > > SSS_fd::table;
195197

196198
// Calculate the SSS in the frequency domain.
197199
ivec sss_fd_calc(
@@ -549,7 +551,7 @@ bvec lte_conv_decode(
549551
}
550552

551553
// Instantiate static member
552-
Array <cvec> Mod_map::table(3);
554+
//Array <cvec> Mod_map::table(3);
553555

554556
// Constructor
555557
// This was implemented as a class so that the (slow) initialization only
@@ -561,6 +563,7 @@ Mod_map::Mod_map(void) {
561563
ivec map_qam16_imag("1 3 1 3 -1 -3 -1 -3 1 3 1 3 -1 -3 -1 -3");
562564
ivec map_qam64_real("3 3 1 1 3 3 1 1 5 5 7 7 5 5 7 7 3 3 1 1 3 3 1 1 5 5 7 7 5 5 7 7 -3 -3 -1 -1 -3 -3 -1 -1 -5 -5 -7 -7 -5 -5 -7 -7 -3 -3 -1 -1 -3 -3 -1 -1 -5 -5 -7 -7 -5 -5 -7 -7");
563565
ivec map_qam64_imag("3 1 3 1 5 7 5 7 3 1 3 1 5 7 5 7 -3 -1 -3 -1 -5 -7 -5 -7 -3 -1 -3 -1 -5 -7 -5 -7 3 1 3 1 5 7 5 7 3 1 3 1 5 7 5 7 -3 -1 -3 -1 -5 -7 -5 -7 -3 -1 -3 -1 -5 -7 -5 -7");
566+
table.set_size(3);
564567
table(0)=to_cvec(map_qam_real,map_qam_imag)/sqrt(2);
565568
table(1)=to_cvec(map_qam16_real,map_qam16_imag)/sqrt(10);
566569
table(2)=to_cvec(map_qam64_real,map_qam64_imag)/sqrt(42);

0 commit comments

Comments
 (0)