hamnet70/impl/src/utils.h

32 lines
917 B
C

#ifndef UTILS_H
#define UTILS_H
#include <stdlib.h>
#include <stdbool.h>
#include <liquid/liquid.h>
/*! Dump a array of complex numbers.
*
* \param data Pointer to the data to dump.
* \param n Number of data points to dump.
* \param T The sampling interval of the data (set to 1.0 if not relevant).
* \param filename The file to write to.
*/
bool dump_array_cf(const float complex *data, size_t n, float T, const char *filename);
/*! Dump a array of real numbers.
*
* \param data Pointer to the data to dump.
* \param n Number of data points to dump.
* \param T The sampling interval of the data (set to 1.0 if not relevant).
* \param filename The file to write to.
*/
bool dump_array_f(const float *data, size_t n, float T, const char *filename);
void sleep_until(double hires_time);
void fsleep(double d);
double get_hires_time(void);
#endif // UTILS_H