equalizer: exclude guards from SNR calculation
Thanks to Stephen Wolfe for reporting
This commit is contained in:
@@ -30,17 +30,17 @@ void lms::equalize(gr_complex *in, int n, gr_complex *symbols, uint8_t *bits, bo
|
||||
double signal = 0;
|
||||
double noise = 0;
|
||||
for(int i = 0; i < 64; i++) {
|
||||
if((i == 32) || (i < 6) || ( i > 58)) {
|
||||
continue;
|
||||
}
|
||||
noise += std::pow(std::abs(d_H[i] - in[i]), 2);
|
||||
signal += std::pow(std::abs(d_H[i] + in[i]), 2);
|
||||
}
|
||||
|
||||
d_snr = 10 * std::log10(signal / noise / 2);
|
||||
|
||||
for(int i = 0; i < 64; i++) {
|
||||
d_H[i] += in[i];
|
||||
d_H[i] /= LONG[i] * gr_complex(2, 0);
|
||||
}
|
||||
|
||||
d_snr = 10 * std::log10(signal / noise / 2);
|
||||
|
||||
} else {
|
||||
int c = 0;
|
||||
for(int i = 0; i < 64; i++) {
|
||||
|
||||
+5
-5
@@ -30,17 +30,17 @@ void ls::equalize(gr_complex *in, int n, gr_complex *symbols, uint8_t *bits, boo
|
||||
double signal = 0;
|
||||
double noise = 0;
|
||||
for(int i = 0; i < 64; i++) {
|
||||
if((i == 32) || (i < 6) || ( i > 58)) {
|
||||
continue;
|
||||
}
|
||||
noise += std::pow(std::abs(d_H[i] - in[i]), 2);
|
||||
signal += std::pow(std::abs(d_H[i] + in[i]), 2);
|
||||
}
|
||||
|
||||
d_snr = 10 * std::log10(signal / noise / 2);
|
||||
|
||||
for(int i = 0; i < 64; i++) {
|
||||
d_H[i] += in[i];
|
||||
d_H[i] /= LONG[i] * gr_complex(2, 0);
|
||||
}
|
||||
|
||||
d_snr = 10 * std::log10(signal / noise / 2);
|
||||
|
||||
} else {
|
||||
|
||||
int c = 0;
|
||||
|
||||
@@ -30,17 +30,17 @@ void sta::equalize(gr_complex *in, int n, gr_complex *symbols, uint8_t *bits, bo
|
||||
double signal = 0;
|
||||
double noise = 0;
|
||||
for(int i = 0; i < 64; i++) {
|
||||
if((i == 32) || (i < 6) || ( i > 58)) {
|
||||
continue;
|
||||
}
|
||||
noise += std::pow(std::abs(d_H[i] - in[i]), 2);
|
||||
signal += std::pow(std::abs(d_H[i] + in[i]), 2);
|
||||
}
|
||||
|
||||
d_snr = 10 * std::log10(signal / noise / 2);
|
||||
|
||||
for(int i = 0; i < 64; i++) {
|
||||
d_H[i] += in[i];
|
||||
d_H[i] /= LONG[i] * gr_complex(2, 0);
|
||||
}
|
||||
|
||||
d_snr = 10 * std::log10(signal / noise / 2);
|
||||
|
||||
} else {
|
||||
|
||||
gr_complex H_update[64];
|
||||
@@ -81,6 +81,9 @@ void sta::equalize(gr_complex *in, int n, gr_complex *symbols, uint8_t *bits, bo
|
||||
}
|
||||
|
||||
for(int i = 0; i < 64; i++) {
|
||||
if((i < 6) || ( i > 58)) {
|
||||
continue;
|
||||
}
|
||||
d_H[i] = gr_complex(1-alpha,0) * d_H[i] + gr_complex(alpha,0) * H_update[i];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user