summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-23 07:59:14 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-23 07:59:14 +0100
commit215e8143e3feefd69a76d0b6eaf36ed42a7a904f (patch)
treec7da20ffcab5ba945364e4e4d99f0239e0dfc052
parentbbda6c46e5c322a32c2267da32b0150669174c12 (diff)
downloaddabmod-215e8143e3feefd69a76d0b6eaf36ed42a7a904f.tar.gz
dabmod-215e8143e3feefd69a76d0b6eaf36ed42a7a904f.tar.bz2
dabmod-215e8143e3feefd69a76d0b6eaf36ed42a7a904f.zip
Add OFDM windowing to config file
-rw-r--r--doc/example.ini7
-rw-r--r--src/ConfigParser.cpp6
-rw-r--r--src/ConfigParser.h2
-rw-r--r--src/DabModulator.cpp3
4 files changed, 16 insertions, 2 deletions
diff --git a/doc/example.ini b/doc/example.ini
index cf56720..d356ee1 100644
--- a/doc/example.ini
+++ b/doc/example.ini
@@ -128,6 +128,13 @@ rate=2048000
; and
;dac_clk_rate=128000000
+; When nonzero, overlap ofdmwindowing samples from each OFDM symbol
+; onto the previous and next symbol, using a raised cosine window function.
+; This has the effect of smoothing the transition from one symbol to the next,
+; which improves spectrum shape.
+; In Transmission Mode I, every data symbol is composed of 2552 samples.
+;ofdmwindowing=10
+
; Settings for crest factor reduction. Statistics for ratio of
; samples that were clipped are available through the RC.
[cfr]
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp
index 1cc94c0..2c93a57 100644
--- a/src/ConfigParser.cpp
+++ b/src/ConfigParser.cpp
@@ -159,8 +159,12 @@ static void parse_configfile(
mod_settings.dabMode = pt.get("modulator.mode", mod_settings.dabMode);
mod_settings.clockRate = pt.get("modulator.dac_clk_rate", (size_t)0);
- mod_settings.digitalgain = pt.get("modulator.digital_gain", mod_settings.digitalgain);
+ mod_settings.digitalgain = pt.get("modulator.digital_gain",
+ mod_settings.digitalgain);
+
mod_settings.outputRate = pt.get("modulator.rate", mod_settings.outputRate);
+ mod_settings.ofdmWindowOverlap = pt.get("modulator.ofdmwindowing",
+ mod_settings.ofdmWindowOverlap);
// FIR Filter parameters:
if (pt.get("firfilter.enabled", 0) == 1) {
diff --git a/src/ConfigParser.h b/src/ConfigParser.h
index a8d7837..0be3558 100644
--- a/src/ConfigParser.h
+++ b/src/ConfigParser.h
@@ -82,6 +82,8 @@ struct mod_settings_t {
float cfrClip = 1.0f;
float cfrErrorClip = 1.0f;
+ // Settings for the OFDM windowing
+ unsigned ofdmWindowOverlap = 0;
#if defined(HAVE_OUTPUT_UHD)
OutputUHDConfig outputuhd_conf;
diff --git a/src/DabModulator.cpp b/src/DabModulator.cpp
index cded280..0818f4f 100644
--- a/src/DabModulator.cpp
+++ b/src/DabModulator.cpp
@@ -201,7 +201,8 @@ int DabModulator::process(Buffer* dataOut)
rcs.enrol(cifGain.get());
auto cifGuard = make_shared<GuardIntervalInserter>(
- myNbSymbols, mySpacing, myNullSize, mySymSize);
+ myNbSymbols, mySpacing, myNullSize, mySymSize,
+ m_settings.ofdmWindowOverlap);
rcs.enrol(cifGuard.get());
shared_ptr<FIRFilter> cifFilter;