#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
|
| fe_status_t | FE_applyWindow (const uint8_t *data_stream, uint8_t output_windows[25][32]) |
| | Builds padded/sliding windows from an input stream considering a stride size. More...
|
| |
| fe_status_t | FE_zeroCrossingRate (const uint8_t *input_window, float *zcr_out) |
| | Measures of how often a signal crosses the zero axis, indicating the frequency or noisiness of a signal. More...
|
| |
| fe_status_t | FE_slopeChanges (const uint8_t *input_window, float *slope_changes) |
| | Counts the sign changes of signal differences. More...
|
| |
| fe_status_t | FE_fftPool (const uint8_t *input_window, float *fft_output_pool_mag) |
| | calculate FFT magnitudes and pooling (averaging) to produce NUM_FEAT_FFT features. More...
|
| |
| fe_status_t | FE_topFrequencies (const uint8_t *input_window, float *top_freqs) |
| | Extract the index of the dominant frequencies (Hz) per window. More...
|
| |
| fe_status_t | FE_spectralEntropy (const uint8_t *input_window, float *entropy_out) |
| | Calculates the Shannon spectral entropy. The Spectral Entropy acts as an indicator of how spread out the power is. More...
|
| |
| fe_status_t | FE_kurtosis (const uint8_t *input_window, float *kurtosis_output) |
| | Calculates the fisher or excess kurtosis without bias for each segment of a given series. Kurtosis describes the "peakedness" of a probability distribution. More...
|
| |
| fe_status_t | FE_concatenateFeatures (const float *fft_output_pool_mag, uint32_t window_index, const float *kurtosis_output, const float *zcr, const float *slope_changes, const float *top_dominant_freq, const float *power_spectrum, float *concatenated_features) |
| | Concatenate many feature arrays into a big feature vector. The offsets are determined by NUM_FEAT_X and NUM_WINDOWS macros. More...
|
| |
§ ADCSAMPLESIZE
| #define ADCSAMPLESIZE 125 |
§ SAMPLING_FREQ
§ PADDING_SIZE_LEFT
| #define PADDING_SIZE_LEFT 4 |
§ PADDING_SIZE_RIGHT
| #define PADDING_SIZE_RIGHT 3 |
§ PADDED_INPUT_SIZE
§ WINDOW_SIZE
§ WINDOW_STRIDE_SIZE
| #define WINDOW_STRIDE_SIZE 4 |
§ NUM_WINDOWS
§ FFT_SIZE
§ NUM_BINS
§ POOLED_BINS
§ TOP_N_FREQ
§ KURTOSIS_CHUNK_SIZE
| #define KURTOSIS_CHUNK_SIZE 8 |
§ KURTOSIS_STRIDE_SIZE
| #define KURTOSIS_STRIDE_SIZE 8 |
§ NUM_FEAT_FFT
§ NUM_FEAT_TOPFREQ
§ NUM_FEAT_KURTOSIS
| #define NUM_FEAT_KURTOSIS 4 |
§ NUM_FEAT_ZCR
§ NUM_FEAT_SLOPE
§ NUM_FEAT_PW_SPEC
| #define NUM_FEAT_PW_SPEC 1 |
§ NUM_TOTAL_FEATURES
| #define NUM_TOTAL_FEATURES 25 |
§ fe_status_t
Specifies the FE status codes.
This enum defines the return states of the FE functions.
| Enumerator |
|---|
| FE_OK | Process ended successfully. The pointer to one of the function arguments has a NULL value.
|
| FE_ERR_NULLPTR | One of the Feature Extraction configuration parameters is incorrect or not supported.
|
| FE_ERR_BAD_PARAM | DSP operation has failed.
|
| FE_ERR_DSP | |
§ FE_applyWindow()
| fe_status_t FE_applyWindow |
( |
const uint8_t * |
data_stream, |
|
|
uint8_t |
output_windows[25][32] |
|
) |
| |
Builds padded/sliding windows from an input stream considering a stride size.
- Parameters
-
| [in] | data_stream | pointer to input data stream [ADCSAMPLESIZE] for time series. |
| [out] | output_windows | preallocated 2D-array [NUM_WINDOWS][WINDOW_SIZE]. |
- Return values
-
| FE_OK | Process ended successfully. |
| FE_ERR_NULLPTR | The pointer to one of the function arguments has a NULL value. |
| FE_ERR_BAD_PARAM | One of the Feature Extraction configuration parameters is incorrect or not supported. |
| FE_ERR_DSP | DSP operation has failed. |
§ FE_zeroCrossingRate()
| fe_status_t FE_zeroCrossingRate |
( |
const uint8_t * |
input_window, |
|
|
float * |
zcr_out |
|
) |
| |
Measures of how often a signal crosses the zero axis, indicating the frequency or noisiness of a signal.
- Parameters
-
| [in] | input_window | input window uint8. |
| [out] | zcr_out | pointer to result float32. |
- Return values
-
| FE_OK | Process ended successfully. |
| FE_ERR_NULLPTR | The pointer to one of the function arguments has a NULL value. |
| FE_ERR_BAD_PARAM | One of the Feature Extraction configuration parameters is incorrect or not supported. |
| FE_ERR_DSP | DSP operation has failed. |
§ FE_slopeChanges()
| fe_status_t FE_slopeChanges |
( |
const uint8_t * |
input_window, |
|
|
float * |
slope_changes |
|
) |
| |
Counts the sign changes of signal differences.
- Parameters
-
| [in] | input_window | input window uint8. |
| [out] | slope_changes | pointer to result float32. |
- Return values
-
| FE_OK | Process ended successfully. |
| FE_ERR_NULLPTR | The pointer to one of the function arguments has a NULL value. |
| FE_ERR_BAD_PARAM | One of the Feature Extraction configuration parameters is incorrect or not supported. |
| FE_ERR_DSP | DSP operation has failed. |
§ FE_fftPool()
| fe_status_t FE_fftPool |
( |
const uint8_t * |
input_window, |
|
|
float * |
fft_output_pool_mag |
|
) |
| |
calculate FFT magnitudes and pooling (averaging) to produce NUM_FEAT_FFT features.
- Parameters
-
| [in] | input_window | input window uint8. |
| [out] | fft_output_pool_mag | preallocated array of NUM_FEAT_FFT float32. |
- Return values
-
| FE_OK | Process ended successfully. |
| FE_ERR_NULLPTR | The pointer to one of the function arguments has a NULL value. |
| FE_ERR_BAD_PARAM | One of the Feature Extraction configuration parameters is incorrect or not supported. |
| FE_ERR_DSP | DSP operation has failed. |
§ FE_topFrequencies()
| fe_status_t FE_topFrequencies |
( |
const uint8_t * |
input_window, |
|
|
float * |
top_freqs |
|
) |
| |
Extract the index of the dominant frequencies (Hz) per window.
- Parameters
-
| [in] | input_window | input window uint8. |
| [out] | top_freqs | preallocated array of length TOP_N_FREQ. |
- Return values
-
| FE_OK | Process ended successfully. |
| FE_ERR_NULLPTR | The pointer to one of the function arguments has a NULL value. |
| FE_ERR_BAD_PARAM | One of the Feature Extraction configuration parameters is incorrect or not supported. |
| FE_ERR_DSP | DSP operation has failed. |
§ FE_spectralEntropy()
| fe_status_t FE_spectralEntropy |
( |
const uint8_t * |
input_window, |
|
|
float * |
entropy_out |
|
) |
| |
Calculates the Shannon spectral entropy. The Spectral Entropy acts as an indicator of how spread out the power is.
- Parameters
-
| [in] | input_window | input window uint8. |
| [out] | entropy_out | pointer to float32 result. |
- Return values
-
| FE_OK | Process ended successfully. |
| FE_ERR_NULLPTR | The pointer to one of the function arguments has a NULL value. |
| FE_ERR_BAD_PARAM | One of the Feature Extraction configuration parameters is incorrect or not supported. |
| FE_ERR_DSP | DSP operation has failed. |
§ FE_kurtosis()
| fe_status_t FE_kurtosis |
( |
const uint8_t * |
input_window, |
|
|
float * |
kurtosis_output |
|
) |
| |
Calculates the fisher or excess kurtosis without bias for each segment of a given series. Kurtosis describes the "peakedness" of a probability distribution.
- Parameters
-
| [in] | input_window | input window uint8. |
| [out] | kurtosis_output | preallocated array of NUM_FEAT_KURTOSIS float32. |
- Return values
-
| FE_OK | Process ended successfully. |
| FE_ERR_NULLPTR | The pointer to one of the function arguments has a NULL value. |
| FE_ERR_BAD_PARAM | One of the Feature Extraction configuration parameters is incorrect or not supported. |
| FE_ERR_DSP | DSP operation has failed. |
§ FE_concatenateFeatures()
| fe_status_t FE_concatenateFeatures |
( |
const float * |
fft_output_pool_mag, |
|
|
uint32_t |
window_index, |
|
|
const float * |
kurtosis_output, |
|
|
const float * |
zcr, |
|
|
const float * |
slope_changes, |
|
|
const float * |
top_dominant_freq, |
|
|
const float * |
power_spectrum, |
|
|
float * |
concatenated_features |
|
) |
| |
Concatenate many feature arrays into a big feature vector. The offsets are determined by NUM_FEAT_X and NUM_WINDOWS macros.
- Parameters
-
| [in] | fft_output_pool_mag | pointer to FFT features (NUM_FEAT_FFT) |
| [in] | window_index | which window this belongs to (0 .. NUM_WINDOWS-1) |
| [in] | kurtosis_output | pointer to NUM_FEAT_KURTOSIS values |
| [in] | zcr | pointer to zcr value (scalar) |
| [in] | slope_changes | pointer to slope_changes value (scalar) |
| [in] | top_dominant_freq | pointer to TOP_N_FREQ values |
| [in] | power_spectrum | pointer to spectral entropy (scalar) |
| [out] | concatenated_features | preallocated feature vector of size NUM_TOTAL_FEATURES * NUM_WINDOWS |
- Return values
-
| FE_OK | Process ended successfully. |
| FE_ERR_NULLPTR | The pointer to one of the function arguments has a NULL value. |
| FE_ERR_BAD_PARAM | One of the Feature Extraction configuration parameters is incorrect or not supported. |
| FE_ERR_DSP | DSP operation has failed. |
§ samplingfreq