acc_algorithm.c File Reference
#include <complex.h>
#include <float.h>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#include "acc_alg_basic_utils.h"
#include "acc_algorithm.h"
#include "acc_definitions_a121.h"
#include "acc_definitions_common.h"

Go to the source code of this file.

Macros

#define DOUBLE_BUFFERING_MEAN_ABS_DEV_OUTLIER_TH   5
 

Functions

static void sum_i16_complex (const acc_int16_complex_t *data, uint16_t num_steps, float complex *out, uint16_t stride)
 Calculates the sum of elements of data located at (i * stride) for i in [0, num_steps) More...
 
static void mean_i16_complex (const acc_int16_complex_t *data, uint16_t num_steps, float complex *out, uint16_t stride)
 Calculates the mean of elements of data located at (i * stride) for i in [0, num_steps) More...
 
static void rfft (const float *data, uint16_t data_length, uint16_t length_shift, float complex *output, uint16_t stride)
 
static void fftshift (float *data, uint16_t data_length, uint16_t stride)
 
static void welch (const float complex *data, uint16_t data_length, uint16_t segment_length, float complex *data_buffer, float complex *fft_out, float *psd, const float *window, uint16_t length_shift, float fs, uint16_t stride)
 
static void filter_inplace_apply (uint16_t sample_idx, const float *b, const float *a, float state[5], float *data)
 
static float complex get_data_padded_f32_to_f32_complex (const float *data, uint16_t data_length, uint16_t index, uint16_t stride)
 
static float complex get_data_padded_f32_complex (const float complex *data, uint16_t data_length, uint16_t index, uint16_t stride)
 
static void small_rfft (const float *data, uint16_t data_length, uint16_t length_shift, float complex *output, uint16_t stride)
 
static void small_fft (const float complex *data, uint16_t data_length, uint16_t length_shift, float complex *output, uint16_t stride)
 
static void small_fft_transformation (uint16_t length_shift, float complex *output, uint16_t stride)
 
static void small_rfft_real_symmetry_conversion (float complex *output, uint16_t length_shift, uint16_t stride)
 
static void sort_i16 (int16_t *array, uint16_t array_length)
 
static void swap_i16 (int16_t *array, uint16_t idx_a, uint16_t idx_b)
 
static void sort_f32 (float *array, uint16_t array_length)
 
static void swap_f32 (float *array, uint16_t idx_a, uint16_t idx_b)
 
static void double_buffering_interpolate (acc_int16_complex_t *frame, const uint16_t sweeps_per_frame, const uint16_t num_points, const uint16_t sweep, const uint16_t point)
 Interpolate function for Double buffering. More...
 
static void double_buffering_median_filter (acc_int16_complex_t *frame, const uint16_t num_points, const uint16_t sweep, const uint16_t point, const uint16_t median_start_sweep)
 Median function for Double buffering. More...
 
static void merge_peak_cluster (uint16_t start_idx, uint16_t num_peaks, const float *velocities, const float *energies, const uint16_t *peak_idxs, float *merged_velocities, float *merged_energies, uint16_t cluster_count)
 Merge peak cluster. More...
 
static float max_measurable_dist (acc_config_prf_t prf)
 Get max measurable distance for some PRF. More...
 
static acc_config_profile_t get_profile (uint16_t value)
 
void acc_algorithm_roll_and_push (float *data, uint16_t data_length, float element)
 Roll array elements and push new element last. More...
 
void acc_algorithm_roll_and_push_matrix_f32 (float *data, uint16_t rows, uint16_t cols, const float *column, bool pos_shift)
 Roll row elements and push a new column. More...
 
void acc_algorithm_roll_and_push_matrix_f32_complex (float complex *data, uint16_t rows, uint16_t cols, const float complex *column, bool pos_shift)
 Roll row elements and push a new column. More...
 
void acc_algorithm_roll_and_push_mult_matrix_i16_complex (acc_int16_complex_t *data, uint16_t data_rows, uint16_t cols, const acc_int16_complex_t *matrix, uint16_t matrix_rows, bool pos_shift)
 Roll row elements and push multiple columns. More...
 
void acc_algorithm_unwrap (float *data, uint16_t data_length)
 Unwraps a signal by changing elements which have an absolute difference from their predecessor of more than 2*pi to their period-complementary values. More...
 
uint16_t acc_algorithm_argmax (const float *data, uint16_t data_length)
 Find index of largest element in the array. More...
 
float acc_algorithm_interpolate_peaks (const float *y, const float *x)
 Interpolate peak. More...
 
float acc_algorithm_interpolate_peaks_equidistant (const float *y, float x_start, float x_delta, uint16_t peak_idx)
 Interpolate equidistant peaks. More...
 
void acc_algorithm_butter_lowpass (float freq, float fs, float *b, float *a)
 Design a 2nd order digital Butterworth lowpass filter. More...
 
void acc_algorithm_butter_bandpass (float min_freq, float max_freq, float fs, float *b, float *a)
 Design a 2nd order digital Butterworth bandpass filter. More...
 
void acc_algorithm_lfilter (const float *b, const float *a, float *data, uint16_t data_length)
 Filter data with a digital filter. More...
 
void acc_algorithm_lfilter_matrix (const float *b, const float *a, float *data, uint16_t rows, uint16_t cols)
 Filter data along row dimension. More...
 
void acc_algorithm_apply_filter_f32 (const float *a, const float *filt_data, uint16_t filt_rows, uint16_t filt_cols, const float *b, const float *data, uint16_t data_rows, uint16_t data_cols, float *output, uint16_t output_length)
 Apply filter coefficients to filtered data matrix and data matrix. More...
 
void acc_algorithm_apply_filter_f32_complex (const float *a, const float complex *filt_data, uint16_t filt_rows, uint16_t filt_cols, const float *b, const float complex *data, uint16_t data_rows, uint16_t data_cols, float complex *output, uint16_t output_length)
 Apply filter coefficients to filtered data matrix and data matrix. More...
 
void acc_algorithm_mean_sweep (const acc_int16_complex_t *frame, uint16_t num_points, uint16_t sweeps_per_frame, uint16_t start_point, uint16_t end_point, float complex *sweep)
 Calculate mean sweep of a frame from start_point to end_point. More...
 
void acc_algorithm_sum_sweep (const acc_int16_complex_t *frame, uint16_t num_points, uint16_t sweeps_per_frame, uint16_t start_point, uint16_t end_point, float complex *sum_sweep)
 Calculate the sum of all sweeps in a frame, from start_point to end_point. More...
 
void acc_algorithm_mean_i16_complex (const acc_int16_complex_t *data, uint16_t data_length, float complex *out)
 Calculate mean value of an array. More...
 
void acc_algorithm_mean_matrix_i16_complex (const acc_int16_complex_t *matrix, uint16_t rows, uint16_t cols, float complex *out, uint16_t axis)
 Calculate mean array of a matrix. More...
 
void acc_algorithm_conj_f32 (float complex *data, uint16_t data_length)
 Inline calculate conjugate of all elements in an array. More...
 
void acc_algorithm_normalize_f32_complex (float complex *data, uint16_t data_length)
 Normalize all elements in an array individually. More...
 
void acc_algorithm_rfft (const float *data, uint16_t data_length, uint16_t length_shift, float complex *output)
 1D Fast Fourier Transform for real input More...
 
void acc_algorithm_rfft_matrix (const float *data, uint16_t rows, uint16_t cols, uint16_t length_shift, float complex *output, uint16_t axis)
 1D Fast Fourier Transform for real input matrix More...
 
void acc_algorithm_fft (const float complex *data, uint16_t data_length, uint16_t length_shift, float complex *output)
 1D Fast Fourier Transform for complex input More...
 
void acc_algorithm_fft_matrix (const float complex *data, uint16_t rows, uint16_t cols, uint16_t length_shift, float complex *output, uint16_t axis)
 1D Fast Fourier Transform for input matrix More...
 
float acc_algorithm_fftfreq_delta (uint16_t n, float d)
 Calculate delta between frequency bins in rfft. More...
 
void acc_algorithm_rfftfreq (uint16_t n, float d, float *freqs)
 Calculate the real Fast Fourier Transform sample frequencies. More...
 
void acc_algorithm_fftfreq (uint16_t n, float d, float *freqs)
 Calculate the Fast Fourier Transform sample frequencies. More...
 
float acc_algorithm_exp_smoothing_coefficient (float fs, float tc)
 Calculate exponential smoothing coefficient. More...
 
float complex acc_algorithm_cdiv (float complex num, float complex denom)
 Divide complex number num / denum. More...
 
void acc_algorithm_hamming (uint16_t n, float *window)
 Calculate hamming window for a specified number of points. More...
 
void acc_algorithm_hann (uint16_t n, float *window)
 Calculate non-symmetrical hann window for a specified number of points. More...
 
float acc_algorithm_get_fwhm (acc_config_profile_t profile)
 Get the envelope Full Width Half Maximum in meters given a profile. More...
 
void acc_algorithm_double_buffering_frame_filter (acc_int16_complex_t *frame, const uint16_t sweeps_per_frame, const uint16_t num_points, int32_t *work_buffer)
 Double buffering frame filter. More...
 
void acc_algorithm_fftshift_matrix (float *data, uint16_t rows, uint16_t cols)
 Shift the zero-frequency component to the center along row dimensions. More...
 
void acc_algorithm_fftshift (float *data, uint16_t data_length)
 Shift the zero-frequency component to the center. More...
 
void acc_algorithm_welch_matrix (const float complex *data, uint16_t rows, uint16_t cols, uint16_t segment_length, float complex *data_buffer, float complex *fft_out, float *psds, const float *window, uint16_t length_shift, float fs)
 Estimate power spectral density (PSD) using Welch’s method along row dimensions. More...
 
void acc_algorithm_welch (const float complex *data, uint16_t data_length, uint16_t segment_length, float complex *data_buffer, float complex *fft_out, float *psd, const float *window, uint16_t length_shift, float fs)
 Estimate power spectral density using Welch’s method. More...
 
float acc_algorithm_calculate_cfar (const float *data, uint16_t data_length, uint16_t window_length, uint16_t half_guard_length, float sensitivity, uint16_t idx)
 Calculate CFAR threshold. More...
 
float acc_algorithm_calculate_mirrored_one_sided_cfar (const float *data, uint16_t data_length, uint16_t middle_idx, uint16_t window_length, uint16_t half_guard_length, float sensitivity, uint16_t idx)
 Calculate mirrored one sided CFAR threshold. More...
 
uint16_t acc_algorithm_get_distance_idx (const float *data, uint16_t cols, uint16_t rows, uint16_t middle_idx, uint16_t half_slow_zone)
 Find the index of the distance column containing the largest amplitude, disregarding amplitudes present in the slow zone. More...
 
float acc_algorithm_get_peak_velocity (const float *velocities, const float *energies, const uint16_t *peak_idxs, uint16_t num_peaks, float limit)
 Find the velocity of the peak with the largest amplitude, prioritizing peaks with a velocity over the slow zone limit. More...
 
bool acc_algorithm_merge_peaks (float max_peak_separation, const float *velocities, const float *energies, const uint16_t *peak_idxs, uint16_t num_peaks, float *merged_velocities, float *merged_energies, uint16_t merged_peaks_length, uint16_t *num_merged_peaks)
 Merges peaks. More...
 
float acc_algorithm_get_distance_m (uint16_t step_length, uint16_t start_point, float base_step_length_m, uint16_t idx)
 Calculate distance for a point at an index. More...
 
acc_config_profile_t acc_algorithm_select_profile (int32_t start_point, float base_step_length)
 Select the highest possible profile without interference of direct leakage. More...
 
acc_config_prf_t acc_algorithm_select_prf (int16_t breakpoint, acc_config_profile_t profile, float base_step_length)
 Select a suitable PRF given a breakpoint and profile. More...
 
bool acc_algorithm_find_peaks (const float *abs_sweep, const uint16_t data_length, const uint32_t *threshold_check, uint16_t *peak_idxs, uint16_t peak_idxs_length, uint16_t *num_peaks)
 Find peaks above threshold. More...
 
void acc_algorithm_count_points_above_threshold (const float *matrix, uint16_t rows, uint16_t cols, const float threshold, uint16_t *count, uint16_t offset, uint16_t threshold_check_length, uint16_t axis)
 Count points in matrix above threshold row-wise or col-wise. More...
 
int16_t acc_algorithm_median_i16 (int16_t *data, uint16_t length)
 Calculate median of input data. More...
 
float acc_algorithm_median_f32 (float *data, uint16_t length)
 Calculate median of input data. More...
 
float acc_algorithm_max_f32 (const float *data, uint16_t length)
 Find max value of input data. More...
 
float acc_algorithm_weighted_mean (const float *data, const float *weights, uint16_t length)
 Calculate weighted mean. More...
 
float acc_algorithm_variance_f32 (const float *data, uint16_t length)
 Calculate variance. More...
 
float acc_algorithm_stddev_f32 (const float *data, uint16_t length)
 Calculate standard deviation. More...
 
float acc_algorithm_clip_f32 (float value, float min, float max)
 Clip passed value into the interval [min, max]. More...
 

Macro Definition Documentation

◆ DOUBLE_BUFFERING_MEAN_ABS_DEV_OUTLIER_TH

#define DOUBLE_BUFFERING_MEAN_ABS_DEV_OUTLIER_TH   5

Definition at line 18 of file acc_algorithm.c.

Function Documentation

◆ acc_algorithm_apply_filter_f32()

void acc_algorithm_apply_filter_f32 ( const float *  a,
const float *  filt_data,
uint16_t  filt_rows,
uint16_t  filt_cols,
const float *  b,
const float *  data,
uint16_t  data_rows,
uint16_t  data_cols,
float *  output,
uint16_t  output_length 
)

Apply filter coefficients to filtered data matrix and data matrix.

Parameters
[in]aDenominator of polynomial of the IIR filter
[in]filt_dataFiltered data matrix
[in]filt_rowsNumber of rows in filtered data matrix, == len(a)
[in]filt_colsNumber of columns in filtered data matrix, == data_cols
[in]bNumerator of polynomial of the IIR filter
[in]dataData matrix
[in]data_rowsNumber of rows in data matrix, == len(b)
[in]data_colsNumber of columns in data matrix, == filt_cols
[out]outputOutput filtered data array
[in]output_lengthLength of output, == data_cols and filt_cols

Definition at line 464 of file acc_algorithm.c.

◆ acc_algorithm_apply_filter_f32_complex()

void acc_algorithm_apply_filter_f32_complex ( const float *  a,
const float complex *  filt_data,
uint16_t  filt_rows,
uint16_t  filt_cols,
const float *  b,
const float complex *  data,
uint16_t  data_rows,
uint16_t  data_cols,
float complex *  output,
uint16_t  output_length 
)

Apply filter coefficients to filtered data matrix and data matrix.

Parameters
[in]aDenominator of polynomial of the IIR filter
[in]filt_dataFiltered data matrix
[in]filt_rowsNumber of rows in filtered data matrix, == len(a)
[in]filt_colsNumber of columns in filtered data matrix, == data_cols
[in]bNumerator of polynomial of the IIR filter
[in]dataData matrix
[in]data_rowsNumber of rows in data matrix, == len(b)
[in]data_colsNumber of columns in data matrix, == filt_cols
[out]outputOutput filtered data array
[in]output_lengthLength of output, == data_cols and filt_cols

Definition at line 491 of file acc_algorithm.c.

◆ acc_algorithm_argmax()

uint16_t acc_algorithm_argmax ( const float *  data,
uint16_t  data_length 
)

Find index of largest element in the array.

Parameters
[in]dataArray of data
[in]data_lengthLength of the array
Returns
Index of largest element

Definition at line 305 of file acc_algorithm.c.

◆ acc_algorithm_butter_bandpass()

void acc_algorithm_butter_bandpass ( float  min_freq,
float  max_freq,
float  fs,
float *  b,
float *  a 
)

Design a 2nd order digital Butterworth bandpass filter.

Parameters
[in]min_freqLow cutoff frequency
[in]max_freqHigh cutoff frequency
[in]fsSampling frequency, > 0 Hz
[out]bNumerator in polynomial of the IIR filter, length == 5
[out]aDenominator of polynomial of the IIR filter, length == 4

Definition at line 379 of file acc_algorithm.c.

◆ acc_algorithm_butter_lowpass()

void acc_algorithm_butter_lowpass ( float  freq,
float  fs,
float *  b,
float *  a 
)

Design a 2nd order digital Butterworth lowpass filter.

Parameters
[in]freqCutoff freuency
[in]fsSampling frequency, > 0 Hz
[out]bNumerator in polynomial of the IIR filter, length == 3
[out]aDenominator of polynomial of the IIR filter, length == 2

Definition at line 337 of file acc_algorithm.c.

◆ acc_algorithm_calculate_cfar()

float acc_algorithm_calculate_cfar ( const float *  data,
uint16_t  data_length,
uint16_t  window_length,
uint16_t  half_guard_length,
float  sensitivity,
uint16_t  idx 
)

Calculate CFAR threshold.

Parameters
[in]dataArray of data
[in]data_lengthLength of the data array
[in]window_lengthNumber of frequency bins next to the CFAR guard from which the threshold level will be calculated
[in]half_guard_lengthNumber of frequency bins around the point of interest that is omitted when calculating the CFAR threshold
[in]sensitivitySensitivity of the CFAR threshold
[in]idxIndex to calculate cfar for
Returns
Threshold value at index

Definition at line 892 of file acc_algorithm.c.

◆ acc_algorithm_calculate_mirrored_one_sided_cfar()

float acc_algorithm_calculate_mirrored_one_sided_cfar ( const float *  data,
uint16_t  data_length,
uint16_t  middle_idx,
uint16_t  window_length,
uint16_t  half_guard_length,
float  sensitivity,
uint16_t  idx 
)

Calculate mirrored one sided CFAR threshold.

Calculate a one sided CFAR. Guard and window are mirrored on the right half of the data. The threshold is extended to also include the CFAR margin. The margin is of size half_guard_length + window_length.

On the left half this construction is used | Window | Half guard | t(i) |

and on the right half this contruction is used | t(i) | Half guard | Window |

The threshold extension looks like this: threshold = [t(m), t(m) ... t(m) t(m+1) t(m+2) ... t(n-m-2) t(n-m-1) t(n-m) ... t(n-m) t(n-m)] where n = data_length and m = window_length + half_guard_length

Parameters
[in]dataArray of data
[in]data_lengthLength of the data array
[in]middle_idxMiddle index
[in]window_lengthNumber of frequency bins next to the CFAR guard from which the threshold level will be calculated
[in]half_guard_lengthNumber of frequency bins around the point of interest that is omitted when calculating the CFAR threshold
[in]sensitivitySensitivity of the CFAR threshold
[in]idxIndex to calculate cfar for
Returns
Threshold value at index

Definition at line 928 of file acc_algorithm.c.

◆ acc_algorithm_cdiv()

float complex acc_algorithm_cdiv ( float complex  num,
float complex  denom 
)

Divide complex number num / denum.

Parameters
[in]numNumerator
[in]denomDenominator
Returns
num / denom

Definition at line 708 of file acc_algorithm.c.

◆ acc_algorithm_clip_f32()

float acc_algorithm_clip_f32 ( float  value,
float  min,
float  max 
)

Clip passed value into the interval [min, max].

Parameters
[in]valueThe value to clip
[in]minLower bound of clip interval
[in]maxUpper bound of clip interval
Returns
The clipped value

Definition at line 1431 of file acc_algorithm.c.

◆ acc_algorithm_conj_f32()

void acc_algorithm_conj_f32 ( float complex *  data,
uint16_t  data_length 
)

Inline calculate conjugate of all elements in an array.

Parameters
[in,out]dataData array, will be replaced with conjugate values
[in]data_lengthLength of data array

Definition at line 576 of file acc_algorithm.c.

◆ acc_algorithm_count_points_above_threshold()

void acc_algorithm_count_points_above_threshold ( const float *  matrix,
uint16_t  rows,
uint16_t  cols,
const float  threshold,
uint16_t *  count,
uint16_t  offset,
uint16_t  threshold_check_length,
uint16_t  axis 
)

Count points in matrix above threshold row-wise or col-wise.

Parameters
[in]matrixMatrix to check data in
[in]rowsNumber of rows in matrix
[in]colsNumber of cols in matrix
[in]thresholdThreshold to check against
[out]countNumber of elements above threshold, length = rows if axis = 0 or length = cols if axis = 1
[in]offsetOffset on the selected axis where to start to check threshold
[in]threshold_check_lengthThe length of part to check threshold for, row wise if axis = 0 and column wise if axis = 1
[in]axisAxis over which to check, must be 0 or 1

Definition at line 1281 of file acc_algorithm.c.

◆ acc_algorithm_double_buffering_frame_filter()

void acc_algorithm_double_buffering_frame_filter ( acc_int16_complex_t frame,
const uint16_t  sweeps_per_frame,
const uint16_t  num_points,
int32_t *  work_buffer 
)

Double buffering frame filter.

Detects and removes outliers in data that appear when the double buffering mode is enabled, and returns the filtered frame.

Outliers are detected along the sweep dimension using the second order difference. For reliable outlier detection, the filter is applied only when there are 32 or more sweeps per frame.

The disturbance caused by enabling the double buffering mode can appear in multiple sweeps but, according to observations, is limited to a maximum of two consecutive sweeps. Therefore, the function removes outliers by interpolating between the sample before and the sample two positions ahead.

The function does not correct disturbances that may appear in the initial or final sweeps.

Parameters
[in,out]frameData frame to where the filter is applied
[in]sweeps_per_frameHow many sweeps there are in the frame
[in]num_pointsThe number of points in the frame
[in]work_bufferA work buffer for the filter, length >= (sweeps_per_frame - 2)

Definition at line 774 of file acc_algorithm.c.

◆ acc_algorithm_exp_smoothing_coefficient()

float acc_algorithm_exp_smoothing_coefficient ( float  fs,
float  tc 
)

Calculate exponential smoothing coefficient.

Parameters
[in]fsSampling frequency
[in]tcTime constant
Returns
Exponential smoothing coefficient, NAN if fs=0 or tc=0

Definition at line 694 of file acc_algorithm.c.

◆ acc_algorithm_fft()

void acc_algorithm_fft ( const float complex *  data,
uint16_t  data_length,
uint16_t  length_shift,
float complex *  output 
)

1D Fast Fourier Transform for complex input

Parameters
[in]dataMatrix of data
[in]data_lengthLength of data
[in]length_shiftInteger that specifies the transform length N in accordance with N = (1 << length_shift) and N >= rows if axis == 0 or N >= cols if axis == 1
[out]outputArray for output data, must be of length N

Definition at line 622 of file acc_algorithm.c.

◆ acc_algorithm_fft_matrix()

void acc_algorithm_fft_matrix ( const float complex *  data,
uint16_t  rows,
uint16_t  cols,
uint16_t  length_shift,
float complex *  output,
uint16_t  axis 
)

1D Fast Fourier Transform for input matrix

Parameters
[in]dataMatrix of data
[in]rowsNumber of rows in the matrix
[in]colsNumber of columns in the matrix
[in]length_shiftInteger that specifies the transform length N in accordance with N = (1 << length_shift) and N >= rows if axis == 0 or N >= cols if axis == 1
[out]outputMatrix for output data, size = (N, cols) if axis=0 and size = (rows, N) if axis=1
[in]axisAxis over which to calculate the FFT, must be 0 or 1

Definition at line 627 of file acc_algorithm.c.

◆ acc_algorithm_fftfreq()

void acc_algorithm_fftfreq ( uint16_t  n,
float  d,
float *  freqs 
)

Calculate the Fast Fourier Transform sample frequencies.

Parameters
[in]nWindow length, > 0
[in]dSample spacing, > 0
[out]freqsSample frequencies, length >= n

Definition at line 675 of file acc_algorithm.c.

◆ acc_algorithm_fftfreq_delta()

float acc_algorithm_fftfreq_delta ( uint16_t  n,
float  d 
)

Calculate delta between frequency bins in rfft.

Parameters
[in]nWindow length, > 0
[in]dSample spacing, > 0
Returns
Delta between frequency bins

Definition at line 652 of file acc_algorithm.c.

◆ acc_algorithm_fftshift()

void acc_algorithm_fftshift ( float *  data,
uint16_t  data_length 
)

Shift the zero-frequency component to the center.

Parameters
[in,out]dataArray of data
[in]data_lengthLength of data

Definition at line 857 of file acc_algorithm.c.

◆ acc_algorithm_fftshift_matrix()

void acc_algorithm_fftshift_matrix ( float *  data,
uint16_t  rows,
uint16_t  cols 
)

Shift the zero-frequency component to the center along row dimensions.

Parameters
[in,out]dataMatrix to be shifted
[in]rowsNumber of rows in the matrix
[in]colsNumber of cols in the matrix

Definition at line 849 of file acc_algorithm.c.

◆ acc_algorithm_find_peaks()

bool acc_algorithm_find_peaks ( const float *  abs_sweep,
const uint16_t  data_length,
const uint32_t *  threshold_check,
uint16_t *  peak_idxs,
uint16_t  peak_idxs_length,
uint16_t *  num_peaks 
)

Find peaks above threshold.

A peak is defined as a point with greater value than its two neighbouring points and all three points are above the threshold.

Parameters
[in]abs_sweepAbsolute values of the mean sweep
[in]data_lengthNumber of values in the sweep
[in]threshold_checkBit array with information if peak is above or below threshold
[out]peak_idxsIndexes of found peaks
[in]peak_idxs_lengthLength of the found peaks array. To fit all possible peaks the length must be (abs_sweep_length / 2)
[out]num_peaksNumber of found peaks
Returns
true if all peaks could be found, false otherwise

Definition at line 1178 of file acc_algorithm.c.

◆ acc_algorithm_get_distance_idx()

uint16_t acc_algorithm_get_distance_idx ( const float *  data,
uint16_t  cols,
uint16_t  rows,
uint16_t  middle_idx,
uint16_t  half_slow_zone 
)

Find the index of the distance column containing the largest amplitude, disregarding amplitudes present in the slow zone.

Parameters
[in]dataMatrix of data
[in]colsNumber of cols
[in]rowsNumber of rows
[in]middle_idxMiddle index
[in]half_slow_zoneHalf size of the number of frequency bins that are regarded as the slow zone
Returns
Distance index

Definition at line 983 of file acc_algorithm.c.

◆ acc_algorithm_get_distance_m()

float acc_algorithm_get_distance_m ( uint16_t  step_length,
uint16_t  start_point,
float  base_step_length_m,
uint16_t  idx 
)

Calculate distance for a point at an index.

Parameters
[in]step_lengthStep length in points
[in]start_pointStart point
[in]base_step_length_mBase step length
[in]idxDistance index
Returns
Distance at index

Definition at line 1118 of file acc_algorithm.c.

◆ acc_algorithm_get_fwhm()

float acc_algorithm_get_fwhm ( acc_config_profile_t  profile)

Get the envelope Full Width Half Maximum in meters given a profile.

Parameters
[in]profileThe profile to get envelope FWHM for
Returns
The envelope FWHM in meters or 0.0 if profile is not valid.

Definition at line 745 of file acc_algorithm.c.

◆ acc_algorithm_get_peak_velocity()

float acc_algorithm_get_peak_velocity ( const float *  velocities,
const float *  energies,
const uint16_t *  peak_idxs,
uint16_t  num_peaks,
float  limit 
)

Find the velocity of the peak with the largest amplitude, prioritizing peaks with a velocity over the slow zone limit.

Parameters
[in]velocitiesArray of velocities
[in]energiesArray of energies
[in]peak_idxsIndices of identified peaks
[in]num_peaksNumber of identified peaks
[in]limitSlow zone limit
Returns
Peak velocity

Definition at line 1009 of file acc_algorithm.c.

◆ acc_algorithm_hamming()

void acc_algorithm_hamming ( uint16_t  n,
float *  window 
)

Calculate hamming window for a specified number of points.

Parameters
[in]nNumber of points
[out]windowReturned hamming window, length = n

Definition at line 721 of file acc_algorithm.c.

◆ acc_algorithm_hann()

void acc_algorithm_hann ( uint16_t  n,
float *  window 
)

Calculate non-symmetrical hann window for a specified number of points.

Parameters
[in]nNumber of points
[out]windowReturned hann window, length = n

Definition at line 733 of file acc_algorithm.c.

◆ acc_algorithm_interpolate_peaks()

float acc_algorithm_interpolate_peaks ( const float *  y,
const float *  x 
)

Interpolate peak.

Parameters
[in]yAmplitudes of frequency peaks
[in]xFrequencies
Returns
Interpolated frequency

Definition at line 322 of file acc_algorithm.c.

◆ acc_algorithm_interpolate_peaks_equidistant()

float acc_algorithm_interpolate_peaks_equidistant ( const float *  y,
float  x_start,
float  x_delta,
uint16_t  peak_idx 
)

Interpolate equidistant peaks.

The function fits a second degree polynomial to three consecutive amplitude values where the second element is expected to contain the maximum measured amplitude. The function then finds the position of the maximum amplitude of the polynomial. The position is normalized.

Parameters
[in]yY values to interpolate
[in]x_startStart value of X-axis
[in]x_deltaDelta between values on X-axis
[in]peak_idxIdx of peak
Returns
Interpolated X-values

Definition at line 330 of file acc_algorithm.c.

◆ acc_algorithm_lfilter()

void acc_algorithm_lfilter ( const float *  b,
const float *  a,
float *  data,
uint16_t  data_length 
)

Filter data with a digital filter.

Parameters
[in]bNumerator in polynomial of the IIR filter, length == 5
[in]aDenominator of polynomial of the IIR filter, length == 4
[in,out]dataData array to filter
[in]data_lengthLength of the array

Definition at line 446 of file acc_algorithm.c.

◆ acc_algorithm_lfilter_matrix()

void acc_algorithm_lfilter_matrix ( const float *  b,
const float *  a,
float *  data,
uint16_t  rows,
uint16_t  cols 
)

Filter data along row dimension.

Parameters
[in]bNumerator in polynomial of the IIR filter, length == 5
[in]aDenominator of polynomial of the IIR filter, length == 4
[in,out]dataMatrix to filter
[in]rowsNumber of rows in the matrix
[in]colsNumber of columns in the matrix

Definition at line 456 of file acc_algorithm.c.

◆ acc_algorithm_max_f32()

float acc_algorithm_max_f32 ( const float *  data,
uint16_t  length 
)

Find max value of input data.

Parameters
[in]dataData to find max value for
[in]lengthLength of data
Returns
The maximum value

Definition at line 1360 of file acc_algorithm.c.

◆ acc_algorithm_mean_i16_complex()

void acc_algorithm_mean_i16_complex ( const acc_int16_complex_t data,
uint16_t  data_length,
float complex *  out 
)

Calculate mean value of an array.

Parameters
[in]dataData array
[in]data_lengthLength of data array
[out]outOutput mean value

Definition at line 549 of file acc_algorithm.c.

◆ acc_algorithm_mean_matrix_i16_complex()

void acc_algorithm_mean_matrix_i16_complex ( const acc_int16_complex_t matrix,
uint16_t  rows,
uint16_t  cols,
float complex *  out,
uint16_t  axis 
)

Calculate mean array of a matrix.

Parameters
[in]matrixMatrix of data
[in]rowsNumber of rows in matrix
[in]colsNumber of columns in matrix
[out]outOutput mean array, length = cols if axis = 0 or length = rows if axis = 1
[in]axisAxis over which to calculate mean, must be 0 or 1

Definition at line 554 of file acc_algorithm.c.

◆ acc_algorithm_mean_sweep()

void acc_algorithm_mean_sweep ( const acc_int16_complex_t frame,
uint16_t  num_points,
uint16_t  sweeps_per_frame,
uint16_t  start_point,
uint16_t  end_point,
float complex *  sweep 
)

Calculate mean sweep of a frame from start_point to end_point.

Parameters
[in]frameFrame to calculate mean sweep for
[in]num_pointsNumber of points in a sweep
[in]sweeps_per_frameNumber of sweeps in the frame
[in]start_pointStart point of mean sweep, if 0 will be same start point as for sweeps in frame
[in]end_pointEnd point of mean sweep, if num_points will be same end point as for sweeps in frame
[out]sweepMean sweep returned from calculation, length >= (end_point - start_point)

Definition at line 523 of file acc_algorithm.c.

◆ acc_algorithm_median_f32()

float acc_algorithm_median_f32 ( float *  data,
uint16_t  length 
)

Calculate median of input data.

Note that this function sorts inplace and the data array will altered

Parameters
[in,out]dataArray of float values
[in]lengthLength of data
Returns
The calculated median value

Definition at line 1342 of file acc_algorithm.c.

◆ acc_algorithm_median_i16()

int16_t acc_algorithm_median_i16 ( int16_t *  data,
uint16_t  length 
)

Calculate median of input data.

Median of data of even length is rounded down. Note that this function sorts inplace and the data array will altered

Parameters
[in,out]dataArray of int16_t values
[in]lengthLength of data
Returns
The calculated median value

Definition at line 1324 of file acc_algorithm.c.

◆ acc_algorithm_merge_peaks()

bool acc_algorithm_merge_peaks ( float  max_peak_separation,
const float *  velocities,
const float *  energies,
const uint16_t *  peak_idxs,
uint16_t  num_peaks,
float *  merged_velocities,
float *  merged_energies,
uint16_t  merged_peaks_length,
uint16_t *  num_merged_peaks 
)

Merges peaks.

Parameters
[in]max_peak_separationThe greatest distance (in meters) between peaks that will result in a merge
[in]velocitiesThe velocities to merge
[in]energiesThe energies to merge
[in]peak_idxsIndices of identified peaks
[in]num_peaksNumber of peaks in the peak_idxs array, if 0 nothing will happen
[out]merged_velocitiesOutput array for the merged velocities
[out]merged_energiesOutput array for the merged energies
[in]merged_peaks_lengthThe length of the merged_velocities and merged_energies arrays
[out]num_merged_peaksThe number of peaks that were merged
Returns
true if successful, false otherwise

Definition at line 1044 of file acc_algorithm.c.

◆ acc_algorithm_normalize_f32_complex()

void acc_algorithm_normalize_f32_complex ( float complex *  data,
uint16_t  data_length 
)

Normalize all elements in an array individually.

Parameters
[in,out]dataData array, will be replaced by normalized values
[in]data_lengthLength of data array

Definition at line 584 of file acc_algorithm.c.

◆ acc_algorithm_rfft()

void acc_algorithm_rfft ( const float *  data,
uint16_t  data_length,
uint16_t  length_shift,
float complex *  output 
)

1D Fast Fourier Transform for real input

Parameters
[in]dataArray of data
[in]data_lengthLength of data
[in]length_shiftInteger that specifies the transform length N in accordance with N = (1 << length_shift) and N >= data_length
[out]outputArray for output data, length >= (data_length / 2) + 1

Definition at line 592 of file acc_algorithm.c.

◆ acc_algorithm_rfft_matrix()

void acc_algorithm_rfft_matrix ( const float *  data,
uint16_t  rows,
uint16_t  cols,
uint16_t  length_shift,
float complex *  output,
uint16_t  axis 
)

1D Fast Fourier Transform for real input matrix

Parameters
[in]dataMatrix of data
[in]rowsNumber of rows in the matrix
[in]colsNumber of columns in the matrix
[in]length_shiftInteger that specifies the transform length N in accordance with N = (1 << length_shift) and N >= rows if axis == 0 or N >= cols if axis == 1
[out]outputMatrix for output data, size = ((rows / 2) + 1, cols) if axis=0 and size = (rows, (cols / 2) + 1) if axis=1
[in]axisAxis over which to calculate the FFT, must be 0 or 1

Definition at line 597 of file acc_algorithm.c.

◆ acc_algorithm_rfftfreq()

void acc_algorithm_rfftfreq ( uint16_t  n,
float  d,
float *  freqs 
)

Calculate the real Fast Fourier Transform sample frequencies.

Parameters
[in]nWindow length, > 0
[in]dSample spacing, > 0
[out]freqsSample frequencies, length >= (n / 2) + 1

Definition at line 664 of file acc_algorithm.c.

◆ acc_algorithm_roll_and_push()

void acc_algorithm_roll_and_push ( float *  data,
uint16_t  data_length,
float  element 
)

Roll array elements and push new element last.

Parameters
[in,out]dataArray to be rolled
[in]data_lengthLength of the array
[in]elementThe new element

Definition at line 159 of file acc_algorithm.c.

◆ acc_algorithm_roll_and_push_matrix_f32()

void acc_algorithm_roll_and_push_matrix_f32 ( float *  data,
uint16_t  rows,
uint16_t  cols,
const float *  column,
bool  pos_shift 
)

Roll row elements and push a new column.

Parameters
[in,out]dataMatrix to be rolled of size rows*cols
[in]rowsNumber of rows in the matrix
[in]colsNumber of cols in the matrix
[in]columnThe new column
[in]pos_shiftIf true will be the same as shift=1 in np.roll, otherwise the same as shift=-1

Definition at line 169 of file acc_algorithm.c.

◆ acc_algorithm_roll_and_push_matrix_f32_complex()

void acc_algorithm_roll_and_push_matrix_f32_complex ( float complex *  data,
uint16_t  rows,
uint16_t  cols,
const float complex *  column,
bool  pos_shift 
)

Roll row elements and push a new column.

Parameters
[in,out]dataMatrix to be rolled of size rows*cols
[in]rowsNumber of rows in the matrix
[in]colsNumber of cols in the matrix
[in]columnThe new column
[in]pos_shiftIf true will be the same as shift=1 in np.roll, otherwise the same as shift=-1

Definition at line 203 of file acc_algorithm.c.

◆ acc_algorithm_roll_and_push_mult_matrix_i16_complex()

void acc_algorithm_roll_and_push_mult_matrix_i16_complex ( acc_int16_complex_t data,
uint16_t  data_rows,
uint16_t  cols,
const acc_int16_complex_t matrix,
uint16_t  matrix_rows,
bool  pos_shift 
)

Roll row elements and push multiple columns.

Parameters
[in,out]dataMatrix to be rolled
[in]data_rowsNumber of rows in data matrix
[in]colsNumber of cols in data matrix
[in]matrixMatrix with new columns
[in]matrix_rowsNumber of rows in the matrix
[in]pos_shiftIf true will be the same as shift=1 in np.roll, otherwise the same as shift=-1

Definition at line 237 of file acc_algorithm.c.

◆ acc_algorithm_select_prf()

acc_config_prf_t acc_algorithm_select_prf ( int16_t  breakpoint,
acc_config_profile_t  profile,
float  base_step_length 
)

Select a suitable PRF given a breakpoint and profile.

Parameters
[in]breakpointA base step, relative to start_point = 0
[in]profileThe profile at breakpoint
[in]base_step_lengthThe base step length
Returns
A suitable PRF

Definition at line 1144 of file acc_algorithm.c.

◆ acc_algorithm_select_profile()

acc_config_profile_t acc_algorithm_select_profile ( int32_t  start_point,
float  base_step_length 
)

Select the highest possible profile without interference of direct leakage.

Parameters
[in]start_pointStart point
[in]base_step_lengthbase_step_length
Returns
A suitable profile

Definition at line 1125 of file acc_algorithm.c.

◆ acc_algorithm_stddev_f32()

float acc_algorithm_stddev_f32 ( const float *  data,
uint16_t  length 
)

Calculate standard deviation.

Parameters
[in]dataData to calculate standard deviation for
[in]lengthLength of data, should be > 1
Returns
The standard deviation

Definition at line 1426 of file acc_algorithm.c.

◆ acc_algorithm_sum_sweep()

void acc_algorithm_sum_sweep ( const acc_int16_complex_t frame,
uint16_t  num_points,
uint16_t  sweeps_per_frame,
uint16_t  start_point,
uint16_t  end_point,
float complex *  sum_sweep 
)

Calculate the sum of all sweeps in a frame, from start_point to end_point.

Parameters
[in]frameFrame to calculate summed sweep for
[in]num_pointsNumber of points in a sweep
[in]sweeps_per_frameNumber of sweeps in the frame
[in]start_pointStart point of sum sweep, if 0 will be same start point as for sweeps in frame
[in]end_pointEnd point of sum sweep, if num_points will be same end point as for sweeps in frame
[out]sum_sweepSummed sweep returned from calculation, length >= (end_point - start_point)

Definition at line 536 of file acc_algorithm.c.

◆ acc_algorithm_unwrap()

void acc_algorithm_unwrap ( float *  data,
uint16_t  data_length 
)

Unwraps a signal by changing elements which have an absolute difference from their predecessor of more than 2*pi to their period-complementary values.

Parameters
[in,out]dataArray with signal data
[in]data_lengthLength of the array

Definition at line 283 of file acc_algorithm.c.

◆ acc_algorithm_variance_f32()

float acc_algorithm_variance_f32 ( const float *  data,
uint16_t  length 
)

Calculate variance.

Parameters
[in]dataData to calculate variance for
[in]lengthLength of data, should be > 1
Returns
The variance

Definition at line 1399 of file acc_algorithm.c.

◆ acc_algorithm_weighted_mean()

float acc_algorithm_weighted_mean ( const float *  data,
const float *  weights,
uint16_t  length 
)

Calculate weighted mean.

Parameters
[in]dataData to calculate weighted mean for
[in]weightsWeighs for each data point in data
[in]lengthLength of data and weights, must be > 0
Returns
The weighted mean

Definition at line 1375 of file acc_algorithm.c.

◆ acc_algorithm_welch()

void acc_algorithm_welch ( const float complex *  data,
uint16_t  data_length,
uint16_t  segment_length,
float complex *  data_buffer,
float complex *  fft_out,
float *  psd,
const float *  window,
uint16_t  length_shift,
float  fs 
)

Estimate power spectral density using Welch’s method.

Computes an estimate of the PSD by dividing the data into non-overlapping segments, computing a periodogram for each segment and averaging the periodograms.

Parameters
[in]dataArray of data
[in]data_lengthLength of data
[in]segment_lengthLength of each segment
[in]data_bufferBuffer used for calculations, length = segment_length
[out]fft_outArray for fft output data, must be of length N
[out]psdArray for output data, length = segment_length
[in]windowDesired window to use, length = segment_length
[in]length_shiftInteger that specifies the transform length N in accordance with N = 1 << length_shift and N >= segment_length
[in]fsSampling frequency

Definition at line 879 of file acc_algorithm.c.

◆ acc_algorithm_welch_matrix()

void acc_algorithm_welch_matrix ( const float complex *  data,
uint16_t  rows,
uint16_t  cols,
uint16_t  segment_length,
float complex *  data_buffer,
float complex *  fft_out,
float *  psds,
const float *  window,
uint16_t  length_shift,
float  fs 
)

Estimate power spectral density (PSD) using Welch’s method along row dimensions.

See acc_algorithm_welch for more details

Parameters
[in]dataMatrix of data
[in]rowsNumber of rows in the matrix
[in]colsNumber of cols in the matrix
[in]segment_lengthLength of each segment
[in]data_bufferBuffer used for calculations, length = segment_length
[out]fft_outArray for fft output data, must be of length N
[out]psdsMatrix for output data, size = (cols, segment_length)
[in]windowDesired window to use, length = segment_length
[in]length_shiftInteger that specifies the transform length N in accordance with N = 1 << length_shift and N >= segment_length
[in]fsSampling frequency

Definition at line 862 of file acc_algorithm.c.

◆ double_buffering_interpolate()

static void double_buffering_interpolate ( acc_int16_complex_t frame,
const uint16_t  sweeps_per_frame,
const uint16_t  num_points,
const uint16_t  sweep,
const uint16_t  point 
)
static

Interpolate function for Double buffering.

This function will calculate the interpolated value from the sweep before and the sweep two positions ahead.

Parameters
[in,out]frameData frame to where the filter is applied
[in]sweeps_per_frameHow many sweeps there are in the frame
[in]num_pointsThe number of points in the frame
[in]sweepThe sweep to generate with interpolatation
[in]pointThe point to generate with interpolatation

Definition at line 1868 of file acc_algorithm.c.

◆ double_buffering_median_filter()

static void double_buffering_median_filter ( acc_int16_complex_t frame,
const uint16_t  num_points,
const uint16_t  sweep,
const uint16_t  point,
const uint16_t  median_start_sweep 
)
static

Median function for Double buffering.

This function will calculate the median value of four complex values.

Parameters
[in,out]frameData frame to where the filter is applied
[in]num_pointsThe number of points in the frame
[in]sweepThe sweep to generate with median filter
[in]pointThe point to generate with median filter
[in]median_start_sweepThe start sweep for the median calculation

Definition at line 1804 of file acc_algorithm.c.

◆ fftshift()

static void fftshift ( float *  data,
uint16_t  data_length,
uint16_t  stride 
)
static

Definition at line 1489 of file acc_algorithm.c.

◆ filter_inplace_apply()

static void filter_inplace_apply ( uint16_t  sample_idx,
const float *  b,
const float *  a,
float  state[5],
float *  data 
)
static

Definition at line 1564 of file acc_algorithm.c.

◆ get_data_padded_f32_complex()

static float complex get_data_padded_f32_complex ( const float complex *  data,
uint16_t  data_length,
uint16_t  index,
uint16_t  stride 
)
static

Definition at line 1600 of file acc_algorithm.c.

◆ get_data_padded_f32_to_f32_complex()

static float complex get_data_padded_f32_to_f32_complex ( const float *  data,
uint16_t  data_length,
uint16_t  index,
uint16_t  stride 
)
static

Definition at line 1579 of file acc_algorithm.c.

◆ get_profile()

static acc_config_profile_t get_profile ( uint16_t  value)
static

Get profile by value

Parameters
[in]valueInteger value that corresponds to an ACC_CONFIG_PROFILE enum
Returns
An ACC_CONFIG_PROFILE enum

Definition at line 1958 of file acc_algorithm.c.

◆ max_measurable_dist()

static float max_measurable_dist ( acc_config_prf_t  prf)
static

Get max measurable distance for some PRF.

Parameters
[in]prfPulse repetition frequency (PRF)
Returns
Max measurable distance in meters

Definition at line 1926 of file acc_algorithm.c.

◆ mean_i16_complex()

static void mean_i16_complex ( const acc_int16_complex_t data,
uint16_t  num_steps,
float complex *  out,
uint16_t  stride 
)
static

Calculates the mean of elements of data located at (i * stride) for i in [0, num_steps)

Parameters
[in]dataThe data
[in]num_stepsHow many steps of length 'stride' should be taken
[out]outSingle output location
[in]strideHow many elements one step should "jump". E.g. 1U for contiguous iteration.

Definition at line 1469 of file acc_algorithm.c.

◆ merge_peak_cluster()

static void merge_peak_cluster ( uint16_t  start_idx,
uint16_t  num_peaks,
const float *  velocities,
const float *  energies,
const uint16_t *  peak_idxs,
float *  merged_velocities,
float *  merged_energies,
uint16_t  cluster_count 
)
static

Merge peak cluster.

Parameters
[in]start_idxStart index
[in]num_peaksNumber of peaks to merge
[in]velocitiesVelocities array
[in]energiesEnergies array
[in]peak_idxsPeak indexes array
[out]merged_velocitiesMerged velocities array
[out]merged_energiesMerged energies array
[in]cluster_countCluster count

Definition at line 1900 of file acc_algorithm.c.

◆ rfft()

static void rfft ( const float *  data,
uint16_t  data_length,
uint16_t  length_shift,
float complex *  output,
uint16_t  stride 
)
static

Definition at line 1479 of file acc_algorithm.c.

◆ small_fft()

static void small_fft ( const float complex *  data,
uint16_t  data_length,
uint16_t  length_shift,
float complex *  output,
uint16_t  stride 
)
static

Definition at line 1663 of file acc_algorithm.c.

◆ small_fft_transformation()

static void small_fft_transformation ( uint16_t  length_shift,
float complex *  output,
uint16_t  stride 
)
static

Definition at line 1712 of file acc_algorithm.c.

◆ small_rfft()

static void small_rfft ( const float *  data,
uint16_t  data_length,
uint16_t  length_shift,
float complex *  output,
uint16_t  stride 
)
static

Definition at line 1612 of file acc_algorithm.c.

◆ small_rfft_real_symmetry_conversion()

static void small_rfft_real_symmetry_conversion ( float complex *  output,
uint16_t  length_shift,
uint16_t  stride 
)
static

Definition at line 1761 of file acc_algorithm.c.

◆ sort_f32()

static void sort_f32 ( float *  array,
uint16_t  array_length 
)
static

Definition at line 2009 of file acc_algorithm.c.

◆ sort_i16()

static void sort_i16 ( int16_t *  array,
uint16_t  array_length 
)
static

Definition at line 1987 of file acc_algorithm.c.

◆ sum_i16_complex()

static void sum_i16_complex ( const acc_int16_complex_t data,
uint16_t  num_steps,
float complex *  out,
uint16_t  stride 
)
static

Calculates the sum of elements of data located at (i * stride) for i in [0, num_steps)

Parameters
[in]dataThe data
[in]num_stepsHow many steps of length 'stride' should be taken
[out]outSingle output location
[in]strideHow many elements one step should "jump". E.g. 1U for contiguous iteration.

Definition at line 1455 of file acc_algorithm.c.

◆ swap_f32()

static void swap_f32 ( float *  array,
uint16_t  idx_a,
uint16_t  idx_b 
)
static

Definition at line 2023 of file acc_algorithm.c.

◆ swap_i16()

static void swap_i16 ( int16_t *  array,
uint16_t  idx_a,
uint16_t  idx_b 
)
static

Definition at line 2001 of file acc_algorithm.c.

◆ welch()

static void welch ( const float complex *  data,
uint16_t  data_length,
uint16_t  segment_length,
float complex *  data_buffer,
float complex *  fft_out,
float *  psd,
const float *  window,
uint16_t  length_shift,
float  fs,
uint16_t  stride 
)
static

Definition at line 1506 of file acc_algorithm.c.