 |
AM62D FreeRTOS SDK
11.02.00
|
|
Go to the documentation of this file.
72 #define CALCRATIO_MA1_LENGTH (1024U)
80 #define CALCRATIO_MA2_LENGTH (128U)
int32_t calcRatio_init(CalcRatio_t *calcRatioInstance, float sampleRateIn, float sampleRateOut)
Initializes the ratio calculation module for ASRC (Asynchronous Sample Rate Converter) with input and...
CALCRATIO Parameters.
Definition: calcratio.h:112
double target_ratio
Target ratio produced by calcRatio_init.
Definition: calcratio.h:123
uint16_t one_shot
One-shot flag to discard the very first captured period.
Definition: calcratio.h:181
double actual_ratio
Actual ratio produced by calcRatio_exec on each call.
Definition: calcratio.h:130
uint32_t movingAvg2Count
Counter for the graduated (incremental) update of the second-stage average.
Definition: calcratio.h:173
#define CALCRATIO_MA2_LENGTH
Length of the second-stage moving average filter for refined smoothing.
Definition: calcratio.h:80
double * P2_capture2_hist
Pointer into capture2_history for the next write location.
Definition: calcratio.h:163
#define CALCRATIO_MA1_LENGTH
Length of the first-stage moving average filter used in ratio smoothing.
Definition: calcratio.h:72
double calcRatio_getActualratio(CalcRatio_t *calcRatioInstance)
Safely retrieve the derived actual sample rate ratio.
double movingAvg1Sum
Accumulator for the first-stage moving-average sum.
Definition: calcratio.h:132
float fsi
Input sample rate set by the user (Hz).
Definition: calcratio.h:114
double movingAvg2Sum
Accumulator for the second-stage moving-average sum.
Definition: calcratio.h:150
int32_t calcRatio_exec(CalcRatio_t *calcRatioInstance, double *Tx_Counter, double *Rx_Counter)
Executes the CALCRATIO algorithm to derive and update the smoothed actual sample rate ratio.
float fso
Output sample rate set by the user (Hz).
Definition: calcratio.h:116
double * P2_capture_hist
Pointer into capture_history indicating where the next period sample will be written.
Definition: calcratio.h:148