50 struct myarr* maxvals);
66 size_t writeInterval);
83 struct myarr* cumulativeTick,
86 size_t currentColumns);
111 struct myarr* cumulativeTick,
void updateTotalShiftIfNeeded(LoopState *state, int peakOffset, AppResources *res, CapConfig *cfg)
Updates the total shift if needed based on the cumulative shift, peak offset, and other parameters,...
Definition: capture_helpers.c:198
void fillReference(FILE *fpDefPeak, struct myarr *reference, size_t teeth)
Fills the reference array with data from the provided file pointer, based on the specified number of ...
Definition: capture_helpers.c:37
void printFinals(CapConfig *cfg, AppResources *res, size_t totalTickTock)
Helper functions for capture.c, including printing, data shifting, logging, and fitting.
Definition: capture_helpers.c:19
void shiftBufferData(size_t *ticktock, struct myarr *subpos, struct myarr *maxpos, struct myarr *maxvals)
Shifts the buffer data for subpos, maxpos, and maxvals arrays by moving the data to the left and upda...
Definition: capture_helpers.c:85
int findMaxPosition(AppResources *res, struct myarr *cumulativeTick, const LoopState *state, CapConfig *cfg)
Finds the maximum position of the correlation in the capture data by performing an FFT fit and shifti...
Definition: capture_helpers.c:180
void processLogging(CapConfig *cfg, AppResources *res, size_t totalTime, size_t writeInterval)
Processes the logging of capture data, including printing the final results and handling any necessar...
Definition: capture_helpers.c:102
void fitAndPrint(const LoopState *state, struct myarr *cumulativeTick, AppResources *res, CapConfig *cfg, size_t currentColumns)
Fits a model to the capture data and prints the results, including calculating the intercept and slop...
Definition: capture_helpers.c:135
void printPeak(CapConfig *cfg, AppResources *res)
Prints the peak to the cfg->fpTotal file count, position data, and correlation data,...
Definition: capture_helpers.c:216
void rotateDerivativeWindow(AppResources *res, int cumulativeShift)
Rotates the derivative window by shifting the data in the derivative array based on the cumulative sh...
Definition: capture_helpers.c:168
Struct to hold all the resources needed for the application.
Definition: resources.h:12
brief struct to hold the configuration parameters for the capture process
Definition: config.h:8
Definition: capture_helpers.h:8
size_t tickIndex
Definition: capture_helpers.h:10
int cumulativeShift
Definition: capture_helpers.h:9
unsigned int globalTickIndex
Definition: capture_helpers.h:11
A struct to hold an array of integers or an array of doubles, along with the length of the arrays.
Definition: myarr.h:14