File dsss_core.h¶
FileList > dsss > dsss_core.h
Go to the source code of this file
Dsss module — public C API.
#include "clib_common.h"
Public Functions¶
| Type | Name |
|---|---|
| int | bin_to_signed (size_t bin, size_t n_bins) Map an FFT bin index to its SIGNED frequency index. |
Public Functions Documentation¶
function bin_to_signed¶
Map an FFT bin index to its SIGNED frequency index.
Parameters:
binBin index in[0, n_bins).n_binsGrid size.
Returns:
Signed index in [-(n_bins/2), +((n_bins-1)/2)].
>>> import numpy as np
>>> from doppler.dsss import bin_to_signed
>>> [bin_to_signed(b, 8) for b in range(8)]
[0, 1, 2, 3, -4, -3, -2, -1]
>>> (np.fft.fftfreq(8) * 8).astype(int).tolist() # same convention
[0, 1, 2, 3, -4, -3, -2, -1]
>>> bin_to_signed(4, 7) # odd grid: no ambiguity
-3
The documentation for this class was generated from the following file native/inc/dsss/dsss_core.h