Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::audio::FreqEstimator Class Reference

Evaluates sender's frequency to receivers's frequency ratio. More...

#include <freq_estimator.h>

Inheritance diagram for roc::audio::FreqEstimator:
Collaboration diagram for roc::audio::FreqEstimator:

Public Member Functions

 FreqEstimator (FreqEstimatorProfile profile, packet::stream_timestamp_t target_latency)
 Initialize. More...
 
float freq_coeff () const
 Get current frequecy coefficient. More...
 
void update (packet::stream_timestamp_t current_latency)
 Compute new value of frequency coefficient. More...
 

Detailed Description

Evaluates sender's frequency to receivers's frequency ratio.

Remarks
We provide FreqEstimator with traget latency and periodically update it with the actual latency. In response, FreqEstimator computes frequency coefficient, the ratio of sender to receiver frequency. This coefficient is then set as the scaling factor of the resampler, which in result compensates the frequency difference and moves the latency closer to its target value.

Definition at line 62 of file freq_estimator.h.

Constructor & Destructor Documentation

◆ FreqEstimator()

roc::audio::FreqEstimator::FreqEstimator ( FreqEstimatorProfile  profile,
packet::stream_timestamp_t  target_latency 
)
explicit

Initialize.

Parameters

  • profile defines configuration preset.
  • target_latency defines latency we want to archive.

Member Function Documentation

◆ freq_coeff()

float roc::audio::FreqEstimator::freq_coeff ( ) const

Get current frequecy coefficient.

◆ update()

void roc::audio::FreqEstimator::update ( packet::stream_timestamp_t  current_latency)

Compute new value of frequency coefficient.


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