iio: Fix sink scalar value to match format le:S16/16. #6024
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Details
Fix scalar value in fmcomms2 sink to match the IIO format le:S16/16>>0
Description
TX output power is aprox 25 dB lower (for the given example) when using ADALM Pluto with gnuradio 3.10 (compared to 3.8 results).
There is an error when converting data from float to int.
The data is scaled to 12 bits instead of 12 bits left shifted by 4 (16 bits where the 4 LSBs don't matter).
This caused the shifting of 4 most significant bits to the right, essentially losing 4 MSBs where most of the power is (about 90% power).
Related Issue
Reported and tested here: https://ez.analog.com/adieducation/university-program/f/q-a/560641/pluto-grc-3-10-sink-block-has-low-output-power .
Which blocks/areas does this affect?
The fmcomms2 sink, part of the gr-iio module.
Testing Done
Testing reported in the issue mentioned above.
Checklist