CarrierTracking
The CarrierTracking object implements two functions :
- Implements a Phase Locked Loop (PLL) which locks to the carrier of the input frequency and outputs the input signal mixed with that carrier, downconverted to DC.
- Implements an optional post-mix low-pass filter (LPF).
Internally a IData queue of 10 elements is allocated for input and ouput.
Typical use case :
Digital modems (see the Modems Introduction section ) need an oversampled input stream. When receiving digital transmission subject to Doppler, the CarrierTracking will perform :
- Tracking the center of the data transmission and compensate for Doppler,
- If post-mixer LPF enabled, will reduce undesired signals.
It can be used after a DDC to track a satellite downlink and follow Doppler shift without having to recenter manually on the carrier.
class CarrierTracking {
constructor CarrierTracking();
bool configure( { "filter_enable" : bool, "cutoff" : number , "lock_wait" : boolean } );
bool write( IQData );
IQData read( bool wait);
bool isLocked();
number getFrequencyError();
}
.configure
Enables or disables the post-mixer Low-Pass filter.
bool configure( { 'filter_enable' : bool, 'cutoff' : number } );
Parameters :
- 'filter_enable' : boolean value, turns on (enables) or off (disables) the post-mixer filter,
- 'cutoff' : float, sets the frequency cutoff of the low-pass-filter
- 'lock_wait' : if true, no data is sent to the output if the PLL is not locked
.write
Push IQ data block for processing.
var boolOk = write( IQDatain );
Returns false is the internal queue is full.
.isLocked
Returns the internal PLL lock indicator.
.getFrequencyError
Returns the offset in Hz of the internal local oscillator
.read
Extracts a previously processed block from the internal queue.
If the queue was empty :
the returned block length will be 0 if the wait* boolean is false
* the call will return only when data is available otherwise.
var IQDataout = resampler.read( bool wait );
Example
In this example, we generate a complex tone centered at 12 kHz. The tracking filter will recenter the signal.
The incoming sample rate is set at 48 kHz, and with given parameters, the post-mixer LPF will filter at 4.8 kHz.
var IQ = DSP.tone(12000, 8000, 48e3);
var tracker = new CarrierTracking();
tracker.configure( { 'filter_enable' : true, 'cutoff': 0.1 }) ;
// push IQ to the Tracking
tracker.write(IQ);
// read
var out = tracker.read();
out.dump();
out.saveToFile('/tmp/out.cf32');