pyadi-iio Interface Helpers¶
Functions to assist with using the pyadi-iio library for interfacing with ADI hardware.
Helpers¶
- genalyzer.pai.fft(interface, data, navg=1, window=Window.NO_WINDOW, axis_type=FreqAxisType.DC_CENTER, axis_fmt=FreqAxisFormat.FREQ)¶
Perform FFT based off pyadi-iio interface.
This function performs an FFT on data acquired from a pyadi-iio device and generate the scaled FFT result in dB along with the corresponding frequency axis. The dB scaled data is shifted if the axis_type is set to DC_CENTER. The function supports both real and complex data. For complex data, the input numpy array should have a complex dtype (np.complex64 or np.complex128). For real data, the input numpy array should have an integer dtype (e.g., np.int16, np.int32, etc.) matching the data format of the device channel. The function also supports multiple channels if the pyadi-iio device has more than one enabled channel. In this case, the input data should be a list of numpy arrays, one for each enabled channel.
- Args:
interface
: pyadi-iio device instance.data
: numpy array or list of numpy arrays (for multiple channels).navg
: number of averages.window
: window type from gn.Window enum.axis_type
: frequency axis type from gn.FreqAxisType enum.axis_fmt
: frequency axis format from gn.FreqAxisFormat enum.- Returns:
fft_out
: FFT output as a numpy array or list of numpy arrays (for multiple channels).fft_out_db
: dB scaled FFT output as a numpy array or list of numpy arrays (for multiple channels).fft_freq_out
: frequency axis as a numpy array or list of numpy arrays (for multiple channels).