esp-sdr-zephyr
Raw I/Q receive and transmit on the ESP32-S3/C6 Wi-Fi radio, for Zephyr
Loading...
Searching...
No Matches
esp_sdr_dsp.h File Reference

Small signal processing helpers shared by the library, the apps, the tests and the host tools. More...

#include <math.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define ESP_SDR_TAU   6.28318530717958647692
#define ESP_SDR_TAU_F   6.28318530717958647692f

Enumerations

enum  esp_sdr_window {
  ESP_SDR_WINDOW_HAMMING , ESP_SDR_WINDOW_HANN , ESP_SDR_WINDOW_BLACKMAN , ESP_SDR_WINDOW_RECT ,
  ESP_SDR_WINDOW_BLACKMAN_HARRIS
}

Functions

static float esp_sdr_window (enum esp_sdr_window kind, uint32_t k, uint32_t span)
 One window coefficient.
static float esp_sdr_sincf (float x)
 Normalized sinc.
static double esp_sdr_sinc (double x)
 Normalized sinc in double precision (host tools, filter design).
static float esp_sdr_bessel_i0f (float x)
 Modified Bessel function of the first kind, order 0, for Kaiser windows.
static float esp_sdr_kaiser_beta (float db)
 Kaiser's beta for a stop band attenuation.
static void esp_sdr_fft_twiddles (float *tw_cos, float *tw_sin, uint32_t n)
 Twiddle factors for esp_sdr_fft().
static void esp_sdr_fft (float *re, float *im, uint32_t n, const float *tw_cos, const float *tw_sin, uint32_t tw_n)
 Forward FFT in place, radix 2, output in natural order (DC first).
static size_t esp_sdr_tone_period (double hz, double fs, size_t n_min, size_t n_max, long *cycles)
 The period of a seamless tone loop.
static double esp_sdr_tone_phase (long cycles, size_t k, size_t n)
 Phase of one sample of a tone period.

Detailed Description

Small signal processing helpers shared by the library, the apps, the tests and the host tools.

The turn constant, windows, sinc, the Kaiser window's I0 and beta, an in-place radix-2 FFT and whole-cycle tone tables. Header only, plain C and libm without Zephyr, so that host builds (apps/link/tools, apps/osmosdr/tools) and the native_sim unit tests use the same code.