ositive.

Parameters
----------
n : int
    Window length.
d : scalar, optional
    Sample spacing (inverse of the sampling rate). Defaults to 1.
xp : array_namespace, optional
    The namespace for the return array. Default is None, where NumPy is used.
device : device, optional
    The device for the return array.
    Only valid when `xp.fft.rfftfreq` implements the device parameter.

Returns
-------
f : ndarray
    Array of length ``n//2 + 1`` containing the sample frequencies.

Examples
--------
>>> import numpy as np
>>> import scipy.fft
>>> signal = np.array([-2, 8, 6, 4, 1, 0, 3, 5, -3, 4], dtype=float)
>>> fourier = scipy.fft.rfft(signal)
>>> n = signal.size
>>> sample_rate = 100
>>> freq = scipy.fft.fftfreq(n, d=1./sample_rate)
>>> freq
array([  0.,  10.,  20., ..., -30., -20., -10.])
>>> freq = scipy.fft.rfftfreq(n, d=1./sample_rate)
>>> freq
array([  0.,  10.,  20.,  30.,  40.,  50.])

r