rfftfreq#
- class saiunit.fft.rfftfreq(n, d=1.0, *, dtype=None, device=None, **kwargs)#
Return sample frequencies for the real discrete Fourier transform.
Unit-aware implementation of
numpy.fft.rfftfreq(). Only the non-negative frequencies are returned (lengthn // 2 + 1).- Parameters:
n (
int) – Window length (number of samples in the FFT).d (saiunit.Quantity |
Array|ndarray|bool|number|bool|int|float|complex) – Sample spacing. If aQuantitywith a time unit is given, the output will carry the matching frequency unit.dtype (
str|type[Any] |dtype|SupportsDType|None) – Desired data-type for the output.device (
Device|Sharding|None) – Device on which to place the output.
- Returns:
Array of length
n // 2 + 1containing sample frequencies.- Return type:
saiunit.Quantity |
Array|ndarray|bool|number|bool|int|float|complex
See also
saiunit.fft.fftfreqFull-spectrum sample frequencies.
Examples
>>> import saiunit as u >>> import saiunit.fft as sufft >>> freqs = sufft.rfftfreq(4, 1.0 * u.second)