transceiver, resamp: insert missing filter values
With transceiver integration, the resampling filter files were
dropped. This created a working resampling implementation for
the USRP2 / N200, but with spectrum irregulaties that likely
caused issues at longer range operation. Simply reinsert the
filter files and modify the filter initialization to use them.
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2689 19bc5d8c-e614-43d4-8b26-e1612bc8e597
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index fe09c16..ae52894 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright 2008 Free Software Foundation, Inc.
+* Copyright 2008, 2011 Free Software Foundation, Inc.
*
* This software is distributed under the terms of the GNU Affero Public License.
* See the COPYING file in the main directory for details.
@@ -28,6 +28,8 @@
#include "sigProcLib.h"
#include "GSMCommon.h"
+#include "sendLPF_961.h"
+#include "rcvLPF_651.h"
#include <Logger.h>
@@ -1171,7 +1173,7 @@
int filterLen,
float gainDC)
{
-
+#if 0
signalVector *LPF = new signalVector(filterLen-1);
LPF->isRealOnly(true);
LPF->setSymmetry(ABSSYM);
@@ -1187,11 +1189,34 @@
*itr++ = (complex) ys*yg*yw;
sum += ys*yg*yw;
}
-
+#else
+ double sum = 0.0;
+ signalVector *LPF;
+ signalVector::iterator itr;
+ if (filterLen == 651) { // receive LPF
+ LPF = new signalVector(651);
+ LPF->isRealOnly(true);
+ itr = LPF->begin();
+ for (int i = 0; i < filterLen; i++) {
+ *itr++ = complex(rcvLPF_651[i],0.0);
+ sum += rcvLPF_651[i];
+ }
+ }
+ else {
+ LPF = new signalVector(961);
+ LPF->isRealOnly(true);
+ itr = LPF->begin();
+ for (int i = 0; i < filterLen; i++) {
+ *itr++ = complex(sendLPF_961[i],0.0);
+ sum += sendLPF_961[i];
+ }
+ }
+#endif
+
float normFactor = gainDC/sum; //sqrtf(gainDC/vectorNorm2(*LPF));
// normalize power
itr = LPF->begin();
- for (int i = 1; i < filterLen; i++) {
+ for (int i = 0; i < filterLen; i++) {
*itr = *itr*normFactor;
itr++;
}