DIFAR Demultiplexer



Greeneridge sells DIFAR demultiplexing software for DOS, UNIX, and OS/2. It is modular so that the user can provide an input module to match his/her sampled data. The output filter must be matched to the input sample rate. Presently, software filters exist for sample rates of 48 kHz and 50 kHz; others can be accommodated. 

Command-line usage is:

DIFAR [input_fn] [samples] [decimation factor] [parameter_fn]


input_fn is the binary data file containing a DIFAR multiplexed signal. This is binary format, 16-bit integers, most significant byte first. 

samples is an integer representing the number of input samples to process. This number must lie between 0 and 2^32 (4294967296) 

decimation is an integer representing the output decimation factor, 0 - 2^32. A factor of one will generate an output sample for each input sample, a decimation factor of two will output every other sample, and so on. No internal filtering is performed. Large decimation values are useful for looking at the PLL lock flags without generating huge output files. Note that the effective sample output sample rate is Fs/(decimation_factor), and therefore aliasing of the omni, east-west, and north-south demodulated signals can occur. 

parameter_fn is an optional parameter file that, if specified, will override the programmed defaults. The user must be careful in modifying these parameters. Commonly modified parameters are the PLL natural frequency (Fn) and damping ratios (zeta) for acquisition and tracking. 

The program will also read the file 'DIFARLPF.FLT' which contains the (IIR) low-pass filter coefficients for reconstruction of the omni, east-west, and north-south signals. A high-pass characteristic with 3 Hz break is cascaded. The file must be present in the working directory. 

Input file scaling

The input file should be scaled so that the 7.5 kHz and 15 kHz pilots produce about 1000 counts RMS deviation each, and no clipping should occur with full modulation. The scaling is not critical but will aid in acquisition. There are AGC loops on both the 7.5 and 15 kHz pilots so that (once acquired) changes in amplitude will be tracked. Omni, E-W, and N-S amplitudes are not AGC'd - assuming phase-lock, they will vary in direct proportional to input levels.

DIFAR.EXE output parameters

Output of the DIFAR.EXE program is as follows:
omni east-west north-south nco_frequency lock_75_flag lock_15_flag


omni The demodulated (decimated) omni output signal
east-west The demodulated (decimated) east-west signal
north-south The demodulated (decimated) north-south signal
lock_75_flag 7.5 kHz PLL lock flag. 1=locked, 0=unlocked
lock_15_flag 15 kHz lock flag. (15 kHz phase alignment). 1=locked, 0=unlocked

Note that the fidelity of the omni signal is in general not correlated with the lock flags because it does not need to be demodulated by a local reference. The east-west and north-south signals, however, require a coherent local reference in order to be demodulated correctly, that is, without frequency shift or crosstalk. Their integrity is thus not to be believed unless BOTH lock flags are set.

This data is written to STDOUT and may be redirected to a file by using the DOS redirection operator '>'. For example, to generate an output data file 'OUTPUT.DAT' containing every fourth demodulated sample from an input file called 'DIFAR.DAT', reading and processing 48000 samples, and using the default parameters, use


In addition, error and status messages from DIFAR.EXE are written to STDERR and will not be redirected. These include file open or read errors, as well as lock flag changes and NCO resets.

Parameter file format

Sixteen parameters are available to the user for modification. They must appear in the order shown. The floating point value can be followed by any non-numerical characters which will be ignored, allowing the inclusion of comments. The parameters are (default values shown):

48000.0 /* Fs, Hz */
7500.0 /* F_init, Hz */
100.0 /* F_win, Hz */
30.0 /* Fn_acquire, Hz */
0.5 /* Zeta_acquire, dim */
3.0 /* Fn_track, Hz */
0.5 /* Zeta_track, dim */
1.0 /* Tint_15, sec */
0.1 /* Tagc_75, sec */
1.0 /* Tagc_15, sec */
0.1 /* Tau_lock_75, sec */
1.0 /* Tau_lock_15, sec */
0.85 /* Lock_threshold_75,V */
0.05 /* Lock_hys_75, V */
0.85 /* Lock_threshold_15,V */
0.05 /* Lock_hys_15,V */
Fs Sample rate, Hz. Nominally 48000 Hz. The rate at which the input data was sampled. Should be accurate to within 100 Hz. The output reconstruction LPF (DIFAR.LPF) cutoff frequency will NOT track this value.
F_init 7.5 kHz pilot frequency (used to initialize the NCO as a first guess)
F_win Maximum NCO deviation allowed before the NCO will reset back to F_init. Helps acquisition if NCO drifts off (because of signal dropout, for instance)
Fn_acquire The 7.5 kHz PLL natural frequency when unlocked. In general, wider bandwidth improves acquisition time.
Zeta_acquire The 7.5 kHz PLL damping ratio when unlocked. 0<zeta_acquire<1.0< td="">
Fn_track The 7.5 kHz PLL natural frequency when locked. Narrow bandwidth reduces tracking jitter but can induce phase jitter in 15 kHz reference if the 7.5 kHz pilot has significant phase noise (Fn_track = 3 Hz recommended for 1 Hz/sec acceleration in 7.5 kHz pilot)
Zeta_track The 7.5 kHz PLL damping ratio when locked. 0<zeta_track<1.0< td="">
Tint_15 15 kHz phase estimator time constant. Recommend > 1.0 second to reduce susceptibility to interference from close-in E-W and N-S sidebands.
Tagc_75 7.5 kHz AGC time constant
Tagc_15 15 kHz AGC time constant
Tau_lock_75 7.5 kHz lock indicator time constant
Tau_lock_15 15 kHz lock indicator time constant
Lock_threshold_75 Value from 7.5 kHz 'I' demodulator at which 7.5 kHz phase lock is declared. Max 'I' is 1.0V
Lock_hys_75 Hysteresis in 7.5 kHz lock indicator
Lock_threshold_15 Value from 15 kHz 'I' demodulator at which 15 kHz phase lock is declared. Max 'I' is 1.0 V
Lock_hys_15 Hysteresis in 15 kHz lock indicator
Greeneridge Logo
Santa Barbara, California
90 Arnold Place, Suite D
Santa Barbara, CA 93117 USA
Tel: 805.967.7720
LGL Logo

LGL is an employee-owned group of companies, including Greeneridge Sciences, performing environmental research and consulting in the U.S.A, Canada, and internationally.

Corporate Offices


PO Box 280, 22 Fisher Street
King City, ON L7B 1A6 Canada
Tel: 905.833.1244



2000 W International Airport Road, Suite C-1
Anchorage, AK 99502 USA
Tel: 907.562.3339

All LGL Locations