Difference between revisions of "ODR-DabMod"

From OpenDigitalRadio
Jump to navigationJump to search
Line 1: Line 1:
 +
==About CRC-DabMod==
 
CRC-DabMod is the DAB OFDM modulator command developed by Communication Research Center (CRC) from Canada. It is now published in open source with a gnu GPLv3 license.
 
CRC-DabMod is the DAB OFDM modulator command developed by Communication Research Center (CRC) from Canada. It is now published in open source with a gnu GPLv3 license.
*[http://mmbtools.crc.ca/content/view/44/71/ CRC-DabMod description and source code] on MMBTools website
+
CRC have stopped releasing new versions, and the development now continues on [http://github.com/mpbraendli GitHub] with releases available on http://mpb.li
  
CRC-DabMod take an [[ETI]] ([[Ensemble Transport Interface]]) stream as input and output a complex baseband stream of interlaced 16 bits I/Q samples with a default sampling frequency of 2.048MHz.
+
Original version: [http://mmbtools.crc.ca/content/view/44/71/ CRC-DabMod description and source code] on MMBTools website
  
The USRP1 will require, resampling to 3.2Msps, which will cause of high CPU usage but cannot be avoided. One possiblity could be to change the clock of the USRP1, or use a more recent USRP (USRP2, B100, N2xx).
+
==Description==
  
Example:
+
CRC-DabMod takes an [[Ensemble Transport Interface ETI]] stream as input and outputs a complex baseband stream of interlaced 16 bits I/Q samples with a default sampling frequency of 2.048MHz. It can also directly communicate to the Ettus USRPs using the UHD driver.
CRC-DabMod ./racor.eti -l -g1 -r3200000
 
  
get racor.eti file, perform OFDM modulation on baseband at a sampling frequency of 3.2MHz. Output is sent to the standard output if not redirected or piped to another command ([[CRC-Dwap.py]] in general)
+
The USRP1 will require resampling to 3.2Msps, which will requires high CPU usage but cannot be avoided. Newer USRPs have a more flexible clocking system.
  
Alternatively, instead of using the python GNURadio player, a modified version of CRC-DabMod exists with an integrated UHD output. See bottom of page for more.
 
  
===Build information===
+
 
 +
 
 +
==Build information==
 +
===Prerequisites===
 +
 
 +
You will need boost at least version 1.42. The one from your distribution is probably fine, and if you have installed GNURadio or UHD, you will already have it.
 +
 
 +
If you want to use the zeromq inputs or outputs, you need a recent (4.0.3 is best) version of [http://zeromq.org/ ZeroMQ]. It is probably preferred to install it from source:
 +
 
 +
wget http://download.zeromq.org/zeromq-4.0.3.tar.gz
 +
cd zeromq-4.0.3
 +
./configure
 +
make
 +
sudo make install
 +
 
 +
This will install it into /usr/local
 +
 
 +
===Building crc-dabmod===
  
 
When building from the source code, be careful to disable debugging, otherwise there will be lot of wasted CPU usage:
 
When building from the source code, be careful to disable debugging, otherwise there will be lot of wasted CPU usage:
  ./configure --with-debug-malloc=no --disable-debug
+
  ./configure --with-debug-malloc=no --disable-debug --enable-fft-simd --enable-input-zeromq
 +
 
 +
If you don't have zeromq, remove the --enable-input-zeromq flag.
 +
 
 +
make
 +
sudo make install
 +
 
 +
to test:
 +
crc-dabmod -h
  
===Usage===
+
==Usage==
Usage:
+
There are two ways of using CRC-DabMod: through command line arguments or with a configuration file:
CRC-DabMod [input [output]] [-c clockrate] [-f] [-g gainMode] [-h] [-r samplingRate]
+
===Command line arguments===
Where:
 
  input:    ETI input filename (default: stdin).
 
  output:  COFDM output filename (default: stdout).
 
  -c:      Set the DAC clock rate.
 
  -f:      (deprecated) Set fifo input.
 
  -g:      Set computation gain mode: 0 FIX, 1 MAX, 2 VAR
 
  -h:      Print this help.
 
  -l:      Loop file when reach end of file.
 
  -r:      Set output sampling rate (default: 2048000).
 
  
===Additional information concerning the command-line options===
+
Example with command-line interface:
 +
crc-dabmod ./racor.eti -l -g1 -r3200000
  
-c: Pre-correction for the CIC filter in the USRP:
+
This modulates the racor.eti file, performs OFDM modulation on baseband at a sampling frequency of 3.2Msamples/sec. Output is sent to the standard output. It can be redirected into a file, or piped into a baseband player ([[CRC-Dwap.py]]).
 +
 
 +
When using a USRP, the integrated UHD output can be used. This requires the definition and usage of a configuration file.
 +
 
 +
===Configuration file===
 +
 
 +
Take the example configuration from GitHub: [https://github.com/mpbraendli/CRC-mmbtools-dabmod/blob/master/doc/example.ini example.ini]
 +
 
 +
The '''input''' section defines if you want to read a file or ETI over ZeroMQ. The ZeroMQ must point to a crc-dabmux ZeroMQ output.
 +
The '''modulator''' section sets parameters for the modulator which are described below.
 +
 
 +
'''firfilter''' enables the filter that was previously done in the baseband player. It reduces out of band energy, and will increase signal quality, and reduce energy waste in the mask filter. The filter taps can be generated with the helper script in doc/fir-filter
 +
 
 +
For each possible output, there is a section: '''outputuhd''' and '''outputfile'''. '''outputfile''' only defines the filename. '''outputuhd''' is more interesting: it defines the device flags, the TX frequency, the PGA gain, and what clocking source you want to use. In case of refclk loss, it is possible to make the modulator crash so as to avoid transmitting a corrupt signal, maybe even on the wrong frequency.
 +
 
 +
The parameter
 +
device=master_clock_rate=32768000,type=b100
 +
is valid for USRP B100, and the master_clock_rate allows us to avoid resampling the 2048000sps signal. It is used as UHD device parameter without modification.
 +
 
 +
The txgain can be modified while the modulator runs by enabling the '''remotecontrol'''
 +
 
 +
Once you have defined a configuration file (let's call it modulator.ini), you can call:
 +
crc-dabmod -C modulator.ini
 +
 
 +
 
 +
==Additional information concerning the options==
 +
 
 +
-c, or dac_clk_rate: Pre-correction for the CIC filter in the USRP:
  
 
This filter is used on the FPGA for up-sampling to 128MHz.
 
This filter is used on the FPGA for up-sampling to 128MHz.
Line 39: Line 82:
 
You should use -c128000000 for regular USRP1 only.
 
You should use -c128000000 for regular USRP1 only.
  
-g: Gain computation mode
+
-g, or gainmode: Gain computation mode
  
The -g option controls how CRC-Dabmod computes the OFDM symbol gain.
+
The gainmode option controls how CRC-Dabmod computes the OFDM symbol gain.
  
-g 0 uses a fixed factor and is really not recommended. It is more
+
mode 0 uses a fixed factor and is really not recommended. It is more
 
useful on an academic perspective for people trying to understand the
 
useful on an academic perspective for people trying to understand the
 
DAB modulation.  
 
DAB modulation.  
  
-g 1 is the normalization of every OFDM symbol.  
+
mode 1 is the normalization of every OFDM symbol.  
 
No overshoot, no truncating, but varying output power (around
 
No overshoot, no truncating, but varying output power (around
 
3dB) which might not be the best for some power amplifier.  
 
3dB) which might not be the best for some power amplifier.  
  
-g 2 uses the method specified in ETSI 300 798. This
+
mode 2 uses the method specified in ETSI 300 798. This
 
method normalizes to 4 times the standard deviation for an approximation
 
method normalizes to 4 times the standard deviation for an approximation
 
of the RMS power. So around 6/100000 samples will be truncated and will
 
of the RMS power. So around 6/100000 samples will be truncated and will
Line 63: Line 106:
  
 
*[[CRC-DabMod usage]]
 
*[[CRC-DabMod usage]]
 
===Modifications to CRC-DabMod===
 
Modifications and new features have been apported by [[User:hb9egm|mpb]] during his master thesis. This patched version can directly use UHD to send samples to the USRP. More details: http://mpb.li
 

Revision as of 11:28, 31 January 2014

About CRC-DabMod

CRC-DabMod is the DAB OFDM modulator command developed by Communication Research Center (CRC) from Canada. It is now published in open source with a gnu GPLv3 license. CRC have stopped releasing new versions, and the development now continues on GitHub with releases available on http://mpb.li

Original version: CRC-DabMod description and source code on MMBTools website

Description

CRC-DabMod takes an Ensemble Transport Interface ETI stream as input and outputs a complex baseband stream of interlaced 16 bits I/Q samples with a default sampling frequency of 2.048MHz. It can also directly communicate to the Ettus USRPs using the UHD driver.

The USRP1 will require resampling to 3.2Msps, which will requires high CPU usage but cannot be avoided. Newer USRPs have a more flexible clocking system.



Build information

Prerequisites

You will need boost at least version 1.42. The one from your distribution is probably fine, and if you have installed GNURadio or UHD, you will already have it.

If you want to use the zeromq inputs or outputs, you need a recent (4.0.3 is best) version of ZeroMQ. It is probably preferred to install it from source:

wget http://download.zeromq.org/zeromq-4.0.3.tar.gz
cd zeromq-4.0.3
./configure
make
sudo make install

This will install it into /usr/local

Building crc-dabmod

When building from the source code, be careful to disable debugging, otherwise there will be lot of wasted CPU usage:

./configure --with-debug-malloc=no --disable-debug --enable-fft-simd --enable-input-zeromq

If you don't have zeromq, remove the --enable-input-zeromq flag.

make
sudo make install

to test:

crc-dabmod -h

Usage

There are two ways of using CRC-DabMod: through command line arguments or with a configuration file:

Command line arguments

Example with command-line interface:

crc-dabmod ./racor.eti -l -g1 -r3200000 

This modulates the racor.eti file, performs OFDM modulation on baseband at a sampling frequency of 3.2Msamples/sec. Output is sent to the standard output. It can be redirected into a file, or piped into a baseband player (CRC-Dwap.py).

When using a USRP, the integrated UHD output can be used. This requires the definition and usage of a configuration file.

Configuration file

Take the example configuration from GitHub: example.ini

The input section defines if you want to read a file or ETI over ZeroMQ. The ZeroMQ must point to a crc-dabmux ZeroMQ output. The modulator section sets parameters for the modulator which are described below.

firfilter enables the filter that was previously done in the baseband player. It reduces out of band energy, and will increase signal quality, and reduce energy waste in the mask filter. The filter taps can be generated with the helper script in doc/fir-filter

For each possible output, there is a section: outputuhd and outputfile. outputfile only defines the filename. outputuhd is more interesting: it defines the device flags, the TX frequency, the PGA gain, and what clocking source you want to use. In case of refclk loss, it is possible to make the modulator crash so as to avoid transmitting a corrupt signal, maybe even on the wrong frequency.

The parameter

device=master_clock_rate=32768000,type=b100

is valid for USRP B100, and the master_clock_rate allows us to avoid resampling the 2048000sps signal. It is used as UHD device parameter without modification.

The txgain can be modified while the modulator runs by enabling the remotecontrol

Once you have defined a configuration file (let's call it modulator.ini), you can call:

crc-dabmod -C modulator.ini


Additional information concerning the options

-c, or dac_clk_rate: Pre-correction for the CIC filter in the USRP:

This filter is used on the FPGA for up-sampling to 128MHz. This pre-correction filter is only enabled when the -c option is used. You should use -c128000000 for regular USRP1 only.

-g, or gainmode: Gain computation mode

The gainmode option controls how CRC-Dabmod computes the OFDM symbol gain.

mode 0 uses a fixed factor and is really not recommended. It is more useful on an academic perspective for people trying to understand the DAB modulation.

mode 1 is the normalization of every OFDM symbol. No overshoot, no truncating, but varying output power (around 3dB) which might not be the best for some power amplifier.

mode 2 uses the method specified in ETSI 300 798. This method normalizes to 4 times the standard deviation for an approximation of the RMS power. So around 6/100000 samples will be truncated and will introduce some really minor distortion. But this mode also maximizes the output power. This is the gain mode recommended for real world operation as it is based on a DAB standard; the only difference is that CRC-Dabmod uses a better resolution with 16 bits in place of 8 bits.

(Additional info taken from google groups discussion, originally written by Pascal Charest, CRC)