greatscottgadgets / hackrf

low cost software radio platform
https://greatscottgadgets.com/hackrf/
GNU General Public License v2.0
6.6k stars 1.53k forks source link

MiB wrong conversion in hackrf_transfer.c #1425

Open signalius opened 8 months ago

signalius commented 8 months ago

What type of issue is this?

permanent - occurring repeatedly

What issue are you facing?

   fprintf(stderr,
      "%4.1f MiB / %5.3f sec = %4.1f MiB/second, average power %3.1f dBfs",
      (byte_count_now / 1e6f),  << HERE
      time_difference,
      (rate / 1e6f),  << and HERE
      dB_full_scale);

MiB unit is (2^10)^2 and you divide by 10^6 (byte_count_now / 1e6f) so actually you have unit MB not MiB. There are two solutions: 1) change MiB to MB, 2) divide by (2^10)^2

What are the steps to reproduce this?

just to run hackrf_transfer software.

Can you provide any logs? (output, errors, etc.)

not necessary

martinling commented 8 months ago

Good point! I think we should just change it to correctly identify the unit as MB, since that keeps the clear relationship where e.g. 10Msps sampling rate results in a 20MB/s transfer rate.