From e9ce4438abefdc164b0c5040756196a2d6bf1bfd Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 21 Dec 2017 08:13:17 +0100 Subject: Better example.ini defaults --- doc/example.ini | 87 ++++++++++++++++++++++++++------------------------------- 1 file changed, 39 insertions(+), 48 deletions(-) (limited to 'doc') diff --git a/doc/example.ini b/doc/example.ini index e0a1fc8..cf56720 100644 --- a/doc/example.ini +++ b/doc/example.ini @@ -10,15 +10,15 @@ telnetport=2121 ; Enable zmq remote control. ; The zmq remote control is intended for machine-to-machine -; integration and requires that ODR-DabMod is built with zmq support. -; The zmq remote control may run in parallel with Telnet. +; integration. It may run in parallel with Telnet. ; ; Protocol: ; ODR-DabMod binds a zmq rep socket so clients must connect ; using either req or dealer socket. ; [] denotes message part as zmq multi-part message are used for delimitation. ; All message parts are utf-8 encoded strings and match the Telnet command set. -; Explicit codes are denoted with "". +; Messages to be sent as literal strings are denoted with "" below. +; ; The following commands are supported: ; REQ: ["ping"] ; REP: ["ok"] @@ -34,7 +34,7 @@ telnetport=2121 ; ; REQ: ["set"][module name][parameter][value] ; REP: ["ok"] _OR_ ["fail"][error description] -zmqctrl=0 +zmqctrl=1 zmqctrlendpoint=tcp://127.0.0.1:9400 [log] @@ -53,6 +53,17 @@ source=/dev/stdin ; When the end of file is reached, it is possible to rewind it loop=0 +; ETI-over-TCP example: +;transport=tcp +;source=localhost:9200 + +; When recieving data using ZeroMQ, the source is the URI to be used +;transport=zeromq +;source=tcp://localhost:8080 +; The option max_frames_queued defines the maximum number of ETI frames +; that can be in the input queue +;max_frames_queued=100 + ; EDI input. ; Listen for EDI data on a given UDP port ;transport=edi @@ -63,16 +74,6 @@ loop=0 ; No support yet for multicast, should work with and without PFT ; This EDI implementation does not support EDI Packet Resend -; When recieving data using ZeroMQ, the source is the URI to be used -;transport=zeromq -;source=tcp://localhost:8080 -; The option max_frames_queued defines the maximum number of ETI frames -; that can be in the input queue -;max_frames_queued=100 - -; ETI-over-TCP example: -;transport=tcp -;source=localhost:9200 [modulator] ; Mode 'fix' uses a fixed factor and is really not recommended. It is more @@ -99,7 +100,7 @@ gainmode=var ; Transmission mode ; If not defined, take the mode from ETI -;mode=2 +;mode=1 ; The digital gain is a value that is multiplied to each sample. It is used ; to tune the chain to make sure that no non-linearities appear up to the @@ -116,11 +117,11 @@ digital_gain=0.8 ; is enabled or not ! rate=2048000 -; CIC equaliser for USRP1 and USRP2 +; (DEPRECATED) CIC equaliser for USRP1 and USRP2 ; Set to 0 to disable CicEqualiser ; when set to 400000000, an additional USRP2 check is enabled. ; See DabModulator.cpp line 186 -dac_clk_rate=0 +;dac_clk_rate=0 ; The USRP1 does not have flexible clocking, you will need ;rate=3200000 @@ -149,19 +150,9 @@ enabled=1 ;filtertapsfile=simple_taps.txt [poly] -;Predistortion using memoryless polynom -enabled=1 +;Predistortion using memoryless polynom, see dpd/ folder for more info +enabled=0 polycoeffile=polyCoefs -;eg: -;echo "8 -;0.1 -;0 -;0 -;0 -;0 -;0 -;0 -;0" > polyCoefs [output] ; choose output: possible values: uhd, file, zmq, soapysdr @@ -191,7 +182,7 @@ output=uhd ;format=s8 ; The output file: -filename=/dev/stdout +filename=ofdm.iq [uhdoutput] ; The UHD output can be directly used with the Ettus USRP devices @@ -201,30 +192,30 @@ filename=/dev/stdout ; master_clock_rate = 4 * sample_rate ; or even a higher factor. ; -; Settings for a USRP B100: +; Settings for the B200: device= -; you can put additional UHD device settings here master_clock_rate=32768000 -type=b100 -txgain=2.0 -; Try first with small gain values -; Also set rate to 2048000 - -; For the B200 -; More information and measurements available on: -; http://wiki.opendigitalradio.org/index.php/USRP_B200_Measurements -; -; Settings: -;device= -;master_clock_rate=32768000 -;type=b200 -;txgain=40 +type=b200 +txgain=40 ; The B200 needs larger gains (up to 89dB) but, ; "Gain settings are application specific, but it is recommended that users ; consider using at least half of the available gain to get reasonable dynamic ; range." ; From the B200 User Manual ; http://files.ettus.com/uhd_docs/manual/html/usrp_b200.html +; +; More information and measurements available on: +; http://wiki.opendigitalradio.org/index.php/USRP_B200_Measurements + + +; Settings for a USRP B100: +;device= +; you can put additional UHD device settings here +;master_clock_rate=32768000 +;type=b100 +;txgain=2.0 +; Try first with small gain values +; Also set rate to 2048000 ; For the USRP1 @@ -233,7 +224,7 @@ txgain=2.0 ; the usrp1 can have two daughterboards, the subdevice parameter allows you ; to choose which one to use ;subdevice=A:0 -; The USRP1 doesn't support master_clock_rate, you need to enable resamping +; The USRP1 doesn't support master_clock_rate, you need to enable resampling ; You must specify either frequency or channel, but not both. @@ -275,7 +266,7 @@ max_gps_holdover_time=600 ; Enable the TCP server to communicate TX and RX feedback for ; digital predistortion. ; Set to 0 to disable -dpd_port=50055 +;dpd_port=50055 ; section defining ZeroMQ output properties [zmqoutput] -- cgit v1.2.3 From 215e8143e3feefd69a76d0b6eaf36ed42a7a904f Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sat, 23 Dec 2017 07:59:14 +0100 Subject: Add OFDM windowing to config file --- doc/example.ini | 7 +++++++ src/ConfigParser.cpp | 6 +++++- src/ConfigParser.h | 2 ++ src/DabModulator.cpp | 3 ++- 4 files changed, 16 insertions(+), 2 deletions(-) (limited to 'doc') 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( - myNbSymbols, mySpacing, myNullSize, mySymSize); + myNbSymbols, mySpacing, myNullSize, mySymSize, + m_settings.ofdmWindowOverlap); rcs.enrol(cifGuard.get()); shared_ptr cifFilter; -- cgit v1.2.3 From 626cfba78e2885200450ff8b4f4cf09ff6d0b830 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 24 Dec 2017 04:06:10 +0100 Subject: Fix TII insertion for positive frequency carriers --- doc/example.ini | 8 ++++++-- src/TII.cpp | 15 ++------------- src/TII.h | 3 +++ 3 files changed, 11 insertions(+), 15 deletions(-) (limited to 'doc') diff --git a/doc/example.ini b/doc/example.ini index d356ee1..ec0525c 100644 --- a/doc/example.ini +++ b/doc/example.ini @@ -318,8 +318,12 @@ offset=0.002 ; DAB modes I and II are supported, and must be set explicitly in ; this file. Reading DAB mode from ETI is not supported. enable=0 -comb=16 -pattern=3 +; comb is also known as sub-identifier. +comb=1 +; pattern is also known as main-identifier. If you run several transmitters +; in SFN, it is better to use the same pattern for all, and vary the comb. +; Otherwise identification of the transmitters may be more difficult. +pattern=11 ; There are two variants of TII being used. The old variant that uses the wrong ; phase on the second carrier in each carrier pairs and is therefore not ; conforming to the specification. Modern analysers can decode both variants, diff --git a/src/TII.cpp b/src/TII.cpp index af64c9f..446d9c6 100644 --- a/src/TII.cpp +++ b/src/TII.cpp @@ -197,10 +197,6 @@ int TII::process(Buffer* dataIn, Buffer* dataOut) complexf* in = reinterpret_cast(dataIn->getData()); complexf* out = reinterpret_cast(dataOut->getData()); - if ((m_enabled_carriers.size() % 2) != 0) { - throw std::logic_error("odd number of enabled carriers"); - } - /* Normalise the TII carrier power according to ETSI TR 101 496-3 * Clause 5.4.2.2 Paragraph 7: * @@ -213,13 +209,10 @@ int TII::process(Buffer* dataIn, Buffer* dataOut) */ const float normalise_factor = 0.14433756729740644112f; // = 1/sqrt(48) - for (size_t i = 0; i < m_enabled_carriers.size(); i+=2) { + for (size_t i = 0; i < m_enabled_carriers.size(); i++) { // See header file for an explanation of the old variant if (m_enabled_carriers[i]) { out[i] = normalise_factor * (m_conf.old_variant ? in[i+1] : in[i]); - } - - if (m_enabled_carriers[i+1]) { out[i+1] = normalise_factor * in[i+1]; } } @@ -239,10 +232,6 @@ void TII::enable_carrier(int k) { } m_enabled_carriers[ix] = true; - // NULL frequency is never enabled. - if (ix > 1 and (ix-1 != 768)) { - m_enabled_carriers[ix-1] = true; - } } void TII::prepare_pattern() { @@ -287,7 +276,7 @@ void TII::prepare_pattern() { } } - for (int k = 384; k <= 768; k++) { + for (int k = 385; k <= 768; k++) { for (int b = 0; b < 8; b++) { if ( k == 385 + 2 * comb + 48 * b and pattern_tm1_2_4[m_conf.pattern][b]) { diff --git a/src/TII.h b/src/TII.h index fe67978..4c5c605 100644 --- a/src/TII.h +++ b/src/TII.h @@ -122,6 +122,9 @@ class TII : public ModCodec, public RemoteControllable // m_enabled_carriers is read by modulator thread, and written // to by RC thread. mutable boost::mutex m_enabled_carriers_mutex; + + // m_enabled_carriers is true only for the first carrier in the + // active pair std::vector m_enabled_carriers; }; -- cgit v1.2.3