For the 434,099,244-byte *.wav file mentioned in the previous post, I want to look only at the Left channel (first half of 32 bits for each time-slot), and look at the Least significant bytes; these will be bytes 45, 49 and so on with the convention that the first byte of the file is byte 1. From these Left channel Least significant bytes, I want the parity, or the least significant bit of that byte.
The C programming language source code below does that job, printing 8 least significant bits per line:
filename: newdecode14b.c
#include <stdio.h> // you know what I mean
int main(void)
{
int j;
unsigned char car;
unsigned char uc1;
unsigned char bitwiseand;
FILE *in;
uc1 = (unsigned char) 1;
in = fopen(“/home/david/ZIPfiles/Jan_14_2016/noise/test14JAN2017.wav”, “r”);
for(j=0; j<44; j++)
{
fscanf(in, “%c”, &car);
}
for(j=44; j< 434099244 ; j++)
{
fscanf(in, “%c”, &car);
if( (0 == (j%4)) )
{
bitwiseand = car&uc1;
printf(“%d “, bitwiseand);
}
if(8 == (j%32))
{
printf(“\n”);
}
}
fclose(in);
return 0;
}
End of source code.
$ head new_rand_bytes13565600
0 0 1 1 1 1 1 1
0 1 1 1 1 1 0 0
0 1 0 1 0 0 1 1
1 1 1 1 0 1 1 1
1 1 1 1 1 0 1 0
1 1 0 0 1 0 0 1
0 1 0 1 1 0 1 0
1 0 0 1 1 0 1 1
1 1 1 0 0 0 1 1
1 0 0 0 1 1 1 0
$ wc new_rand_bytes13565600
13565600 108524800 230615200 new_rand_bytes13565600
This tells us the file of bits has 13,565,600 lines.
At 8 “random” bits per line, it’s enough to give
13,565,600 “random” bytes, hence the filename:
” new_rand_bytes13565600 ” .