aboutsummaryrefslogtreecommitdiffstats
path: root/src/CicEqualizer.cpp
diff options
context:
space:
mode:
authorMatthias (think) <matthias@mpb.li>2012-07-11 12:00:56 +0200
committerMatthias (think) <matthias@mpb.li>2012-07-11 12:00:56 +0200
commit4b814d92fe9787bf72ed3a9632e0866f4cedd27f (patch)
treefeb407e9f2c0658dda896c332864fe6d265aaece /src/CicEqualizer.cpp
parente92f9c408634810828e75d4ad6da408e1c142195 (diff)
downloaddabmod-4b814d92fe9787bf72ed3a9632e0866f4cedd27f.tar.gz
dabmod-4b814d92fe9787bf72ed3a9632e0866f4cedd27f.tar.bz2
dabmod-4b814d92fe9787bf72ed3a9632e0866f4cedd27f.zip
added crc-dabmod patch
Diffstat (limited to 'src/CicEqualizer.cpp')
-rw-r--r--src/CicEqualizer.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/CicEqualizer.cpp b/src/CicEqualizer.cpp
index 06f4550..52da55e 100644
--- a/src/CicEqualizer.cpp
+++ b/src/CicEqualizer.cpp
@@ -36,22 +36,21 @@ CicEqualizer::CicEqualizer(size_t nbCarriers, size_t spacing, int R) :
nbCarriers, spacing, R, this);
myFilter = new float[nbCarriers];
- int M = 1;
- int N = 4;
- float pi = 4.0f * atanf(1.0f);
+ const int M = 1;
+ const int N = 4;
+ const float pi = 4.0f * atanf(1.0f);
for (size_t i = 0; i < nbCarriers; ++i) {
int k = i < (nbCarriers + 1) / 2
? i + ((nbCarriers & 1) ^ 1)
: i - (int)nbCarriers;
float angle = pi * k / spacing;
if (k == 0) {
- myFilter[i] = R;
- } else {
- myFilter[i] = sinf(angle / R) / sinf(angle * M);
- }
- myFilter[i] = fabsf(myFilter[i]) * R;
- myFilter[i] = powf(myFilter[i], N);
- myFilter[i] *= 0.5f;
+ myFilter[i] = 1.0f;
+ } else {
+ myFilter[i] = sinf(angle / R) / sinf(angle * M);
+ myFilter[i] = fabsf(myFilter[i]) * R * M;
+ myFilter[i] = powf(myFilter[i], N);
+ }
PDEBUG("HCic[%zu -> %i] = %f (%f dB) -> angle: %f\n",
i, k,myFilter[i], 20.0 * log10(myFilter[i]), angle);
}