But if you need a two-complement representation of signed int, it's right if you cast with uint. In your example you have signed samples (because sinusoidal between -1.0 and 1.0), so your casting must be int (signed int). I suppose that FFT expects ap_fixed, where MSB is the sign bit.
However, I am not sure of which Python datatype I should use in my conversion. So basically I need to convert this sinusoid from float64 to ap_fixed In my specific case, the FFT has been configured to accept 16 bit fixed point inputs for real and imaginary part (you can find more info in the documentation at page 18) and perform a 1024 points FFT. The goal of this selection is to send those samples to a FFT logicore block ( FFT logicore documentation). Which generates a simple sine wave and then I select the first 1024 samples.
To explain this better, I have implemented a code that generates a simple sine wave inside PYNQ (the Xilinx framework based on Python): import numpy as npį_sig = 130 #selected to get almost exactly a single frequency bin (43.066 * 3) However I have not really understood the "type" I need in my specific case. I need to convert a float64 value into a fixed point (16 bit with 15 bit in the fractional part and 1 in the integer part).