Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env perl
- use strict;
- use warnings qw(all);
- use Carp qw(croak);
- use Fcntl qw(:DEFAULT);
- unless (@ARGV) {
- print "$0 - converts rtl_sdr output to GNU Radio cfile (little-endian)\n";
- print "Usage: $0 dump1.dat dump2.dat > combined.cfile\n";
- }
- binmode \*STDOUT;
- for my $filename (@ARGV) {
- sysopen(my $fh, $filename, O_RDONLY)
- || croak "Can't open $filename: $!";
- my $buf;
- while (sysread($fh, $buf, 4096)) {
- print pack('f<*', map { ($_ - 127) * (1 / 128) } unpack('C*', $buf));
- }
- close $fh;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement