|
ESP-IDF Firmware
Firmware architecture and call graph
|
#include "dsps_snr.h"#include "dsps_fft2r.h"#include "dsp_common.h"#include <math.h>#include <limits>#include "esp_log.h"Go to the source code of this file.
Functions | |
| float | dsps_snr_f32 (const float *input, int32_t len, uint8_t use_dc) |
| SNR. | |
Variables | |
| static const char * | TAG = "snr" |
| float dsps_snr_f32 | ( | const float * | input, |
| int32_t | len, | ||
| uint8_t | use_dc ) |
SNR.
The function calculates signal to noise ration in case if signal is sine tone. The function makes FFT of the input, then search a spectrum maximum, and then calculated SNR as sum of all harmonics to the maximum value. This function have to be used for debug and unit tests only. It's not optimized for real-time processing. The implementation use ANSI C and could be compiled and run on any platform
| input | input array. |
| len | length of the input signal |
| use_dc | this parameter define will be DC value used for calculation or not. 0 - SNR will not include DC power 1 - SNR will include DC power |
Definition at line 24 of file dsps_snr_f32.cpp.
References CONFIG_DSP_MAX_FFT_SIZE, dsp_is_power_of_two(), dsps_bit_rev_fc32_ansi(), dsps_fft2r_fc32_ansi, dsps_fft2r_init_fc32(), ESP_LOGD, M_PI, and TAG.
|
static |
Definition at line 22 of file dsps_snr_f32.cpp.