Closed zuckschwerdt closed 5 years ago
If the fixed point 16-bit numbers are now +/-(1 << 15), make sure to change nativeStreamFormat(): https://github.com/pothosware/SoapyPlutoSDR/blob/master/PlutoSDR_Streaming.cpp#L28 This may be used by SoapyRemote for scaling, for example.
Good idea. Setting fullScale=32768 would eliminate the need for <<4
on the buffer.
Is it acceptable to have a RX fullScale of 2048 but a TX fullScale of 32768? Setting/requiring 32768 on TX would also conceal the hint that this is 12 bits.
With the current PR the fact that the 12 bits need to be MSB aligned would be transparently hidden, but probaly at the cost of an applications scaling it's Q0.15 or floats down and then the driver scaling it up again.
Is it acceptable to have a RX fullScale of 2048 but a TX fullScale of 32768?
Yes, they can be different. As long as the numbers are accurate.
Native format now has proper fullScale, CU8, and CF32 are scaled appropriately.
received RX samples are LSB aligned (i.e. the lower 12 bits of the int16_t), transfered TX samples however need to be MSB aligned (i.e. the upper 12 bits of the int16_t). S.a. https://wiki.analog.com/resources/eval/user-guides/ad-fmcomms2-ebz/software/basic_iq_datafiles#binary_format This fix shifts the TX buffer 4 bits up, removing the current -24 dB attenuation.