laforge
/
openbts-osmo
Archived
1
0
Fork 0

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>
This commit is contained in:
Thomas Tsou 2011-11-04 11:58:54 -04:00
parent 3800745c6a
commit 6445a3bf86
4 changed files with 86 additions and 4 deletions

View File

@ -69,7 +69,9 @@ noinst_HEADERS = \
radioDevice.h \ radioDevice.h \
sigProcLib.h \ sigProcLib.h \
Transceiver.h \ Transceiver.h \
USRPDevice.h USRPDevice.h \
rcvLPF_651.h \
sendLPF_961.h
USRPping_SOURCES = USRPping.cpp USRPping_SOURCES = USRPping.cpp
USRPping_LDADD = \ USRPping_LDADD = \

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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. * This software is distributed under the terms of the GNU Affero Public License.
* See the COPYING file in the main directory for details. * See the COPYING file in the main directory for details.
@ -28,6 +28,8 @@
#include "sigProcLib.h" #include "sigProcLib.h"
#include "GSMCommon.h" #include "GSMCommon.h"
#include "sendLPF_961.h"
#include "rcvLPF_651.h"
#include <Logger.h> #include <Logger.h>
@ -1136,7 +1138,7 @@ signalVector *createLPF(float cutoffFreq,
int filterLen, int filterLen,
float gainDC) float gainDC)
{ {
#if 0
signalVector *LPF = new signalVector(filterLen); signalVector *LPF = new signalVector(filterLen);
LPF->isRealOnly(true); LPF->isRealOnly(true);
signalVector::iterator itr = LPF->begin(); signalVector::iterator itr = LPF->begin();
@ -1148,7 +1150,30 @@ signalVector *createLPF(float cutoffFreq,
*itr++ = (complex) ys*yg*yw; *itr++ = (complex) ys*yg*yw;
sum += 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)); float normFactor = gainDC/sum; //sqrtf(gainDC/vectorNorm2(*LPF));
// normalize power // normalize power
itr = LPF->begin(); itr = LPF->begin();