The turn constant, windows, sinc, FFT and whole-cycle tones, header only and free of Zephyr (esp_sdr_dsp.h).
More...
|
| 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.
|
The turn constant, windows, sinc, FFT and whole-cycle tones, header only and free of Zephyr (esp_sdr_dsp.h).
◆ ESP_SDR_TAU
| #define ESP_SDR_TAU 6.28318530717958647692 |
Radians per turn; pi is ESP_SDR_TAU / 2.
◆ ESP_SDR_TAU_F
| #define ESP_SDR_TAU_F 6.28318530717958647692f |
◆ esp_sdr_window
Window shapes, in the order of gnuradio.fft.window's kinds.
| Enumerator |
|---|
| ESP_SDR_WINDOW_HAMMING | 0.54 - 0.46 cos.
|
| ESP_SDR_WINDOW_HANN | 0.5 - 0.5 cos.
|
| ESP_SDR_WINDOW_BLACKMAN | 0.42 - 0.5 cos + 0.08 cos 2.
|
| ESP_SDR_WINDOW_RECT | All ones.
|
| ESP_SDR_WINDOW_BLACKMAN_HARRIS | Four-term Blackman-Harris.
|
◆ esp_sdr_bessel_i0f()
| float esp_sdr_bessel_i0f |
( |
float | x | ) |
|
|
inlinestatic |
Modified Bessel function of the first kind, order 0, for Kaiser windows.
The power series, stopped once a term no longer changes a float sum (the window betas in use need some 20 terms).
- Parameters
-
- Returns
- I0(
x).
◆ esp_sdr_fft()
| void esp_sdr_fft |
( |
float * | re, |
|
|
float * | im, |
|
|
uint32_t | n, |
|
|
const float * | tw_cos, |
|
|
const float * | tw_sin, |
|
|
uint32_t | tw_n ) |
|
inlinestatic |
Forward FFT in place, radix 2, output in natural order (DC first).
- Parameters
-
| re | Real parts, n entries. |
| im | Imaginary parts, n entries. |
| n | Points, a power of two up to tw_n. |
| tw_cos | Twiddles of esp_sdr_fft_twiddles() for tw_n. |
| tw_sin | Twiddles of esp_sdr_fft_twiddles() for tw_n. |
| tw_n | The tables' transform size. |
◆ esp_sdr_fft_twiddles()
| void esp_sdr_fft_twiddles |
( |
float * | tw_cos, |
|
|
float * | tw_sin, |
|
|
uint32_t | n ) |
|
inlinestatic |
Twiddle factors for esp_sdr_fft().
- Parameters
-
| tw_cos | Out: cos(-tau k / n) for k below n / 2. |
| tw_sin | Out: sin(-tau k / n) for k below n / 2. |
| n | The largest transform the tables serve, a power of two. |
◆ esp_sdr_kaiser_beta()
| float esp_sdr_kaiser_beta |
( |
float | db | ) |
|
|
inlinestatic |
Kaiser's beta for a stop band attenuation.
A Kaiser window coefficient is I0(beta sqrt(1 - r^2)) / I0(beta), r from -1 to 1 over the window (esp_sdr_bessel_i0f()).
- Parameters
-
| db | Stop band attenuation, dB. |
- Returns
- beta (0 below 21 dB: a rectangular window).
◆ esp_sdr_sinc()
| double esp_sdr_sinc |
( |
double | x | ) |
|
|
inlinestatic |
Normalized sinc in double precision (host tools, filter design).
- Parameters
-
- Returns
- sin(pi x) / (pi x), 1 near 0.
◆ esp_sdr_sincf()
| float esp_sdr_sincf |
( |
float | x | ) |
|
|
inlinestatic |
Normalized sinc.
- Parameters
-
- Returns
- sin(pi x) / (pi x), 1 near 0.
◆ esp_sdr_tone_period()
| size_t esp_sdr_tone_period |
( |
double | hz, |
|
|
double | fs, |
|
|
size_t | n_min, |
|
|
size_t | n_max, |
|
|
long * | cycles ) |
|
inlinestatic |
The period of a seamless tone loop.
Searches the lengths from n_max down to n_min for the one whose whole number of cycles comes closest to hz, and stops at the first within 1 Hz.
- Parameters
-
| hz | Tone frequency, Hz, either sign. |
| fs | Sample rate, Hz. |
| n_min | Shortest period, at least 1. |
| n_max | Longest period, at least n_min. |
| cycles | Out: whole cycles in the period (negative for negative hz). |
- Returns
- The period length in samples.
◆ esp_sdr_tone_phase()
| double esp_sdr_tone_phase |
( |
long | cycles, |
|
|
size_t | k, |
|
|
size_t | n ) |
|
inlinestatic |
Phase of one sample of a tone period.
- Parameters
-
- Returns
- The phase of sample
k in radians, 0 to tau, reduced in turns first so that long periods keep their precision.
◆ esp_sdr_window()
One window coefficient.
- Parameters
-
| kind | Window shape. |
| k | Index, 0 to span. |
| span | The index of the window's far end: n - 1 for a symmetric window of n coefficients (filter design), n for a periodic one (spectra). |
- Returns
- The coefficient at
k.