hackrf icon indicating copy to clipboard operation
hackrf copied to clipboard

MiB wrong conversion in hackrf_transfer.c

Open signalius opened this issue 1 year ago • 1 comments

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

signalius avatar Mar 04 '24 08:03 signalius

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.

martinling avatar Mar 13 '24 15:03 martinling