JS8Call-Improved master
Loading...
Searching...
No Matches
js8::FrequencyTracker Class Reference

Lightweight PLL/Kalman-style tracker for residual frequency offset. More...

#include <FrequencyTracker.h>

Public Member Functions

void reset (double initial_hz, double sample_rate_hz, double alpha=0.15, double max_step_hz=0.3, double max_error_hz=5.0)
 Reset the FrequencyTracker with initial parameters.
void disable ()
 Disable the FrequencyTracker.
bool enabled () const noexcept
 Check if the FrequencyTracker is enabled.
double currentHz () const noexcept
 Get the current frequency estimate in Hz.
double averageStepHz () const noexcept
 Get the average step size in Hz.
void apply (std::complex< float > *data, int count) const
 Apply frequency correction to the provided data.
void update (double residual_hz, double weight=1.0)
 Update the FrequencyTracker with a new residual frequency measurement.

Detailed Description

Lightweight PLL/Kalman-style tracker for residual frequency offset.

Initialized with coarse estimates and sample rate; apply() rotates samples by the tracked offset, update() nudges the estimate using pilot residuals. Used inside the JS8 decode loop per candidate frame.

Member Function Documentation

◆ apply()

void js8::FrequencyTracker::apply ( std::complex< float > * data,
int count ) const

Apply frequency correction to the provided data.

Parameters
dataPointer to complex float data
countNumber of samples

◆ averageStepHz()

double js8::FrequencyTracker::averageStepHz ( ) const
nodiscardnoexcept

Get the average step size in Hz.

Returns
double

◆ currentHz()

double js8::FrequencyTracker::currentHz ( ) const
nodiscardnoexcept

Get the current frequency estimate in Hz.

Returns
double

◆ enabled()

bool js8::FrequencyTracker::enabled ( ) const
nodiscardnoexcept

Check if the FrequencyTracker is enabled.

Returns
true
false

◆ reset()

void js8::FrequencyTracker::reset ( double initial_hz,
double sample_rate_hz,
double alpha = 0.15,
double max_step_hz = 0.3,
double max_error_hz = 5.0 )

Reset the FrequencyTracker with initial parameters.

Parameters
initial_hzInitial frequency estimate in Hz
sample_rate_hzSample rate in Hz
alphaSmoothing factor
max_step_hzMaximum step size in Hz
max_error_hzMaximum allowable error in Hz

◆ update()

void js8::FrequencyTracker::update ( double residual_hz,
double weight = 1.0 )

Update the FrequencyTracker with a new residual frequency measurement.

Parameters
residual_hzResidual frequency in Hz
weightWeighting factor

The documentation for this class was generated from the following files: