fftfreq#

Returns the bin centers in cycles/unit of the sampling frequency known by the user

template<typename T = float>
inline auto matx::fftfreq(index_t n, float d = 1.0)#

Return FFT sample frequencies.

Returns the bin centers in cycles/unit of the sampling frequency known by the user.

Template Parameters:

T – Type of output

Parameters:
  • n – Number of elements

  • d – Sample spacing (defaults to 1.0)

Returns:

Operator with sampling frequencies

Examples#

// Generate FFT frequencies using the length of the "t1" tensor and assign to t1
(t1 = fftfreq(t1.Size(0))).run(exec);
// Generate FFT frequencies using the length of the "t1" tensor and a sample spacing of 0.5 and assign to t1
(t1 = fftfreq(t1.Size(0), 0.5)).run(exec);