/* * Program: Global Communicator II - scanner signals converter * Programmer: Robert John Morton UK-YE572246C * Date: Tue 22 Sep 2020 From the directory in which 12.c resides: to compile: gcc 12.c -o 12 File Metre Band Range File Size | | Bounds[kHz] | | Plot ham00 160 1800- 1900 100kHz 100bytes 1.0 kHz/byte 1 0* ham01 80 3400- 3900 500kHz 1000bytes 0.5 kHz/byte skip every other 1 255 ham02 40 7000- 7100 100kHz 100bytes 1.0 kHz/byte 1 2* ham03 30 10100-10200 100kHz 100bytes 1.0 kHz/byte 1 3* ham04 20 13950-14450 500kHz 1000bytes 0.5 kHz/byte skip every other 4 0/255 ham05 17 18000-18200 200kHz 100bytes 2.0 kHz/byte double plot 5* ham06 15 20950-21450 500kHz 1000bytes 0.5 kHz/byte skip every other 6 ham07 12 24800-25000 200kHz 100bytes 2.0 kHz/byte double plot 7* ham08 10 28000-30000 2000kHz 1000bytes 0.5 kHz/byte skip every other 8 SPAN 10MHz 5MHz 2MHz 1MHz 500kHz 200kHz 100kHz Upper Freq 1023 800 620 572 545 118 92 Centre Freq 512 512 512 512 512 64 64 Lower Freq 12 260 410 442 482 0 29 */ #include // input output to/from the console and keyboard #include // standard functions for the 'C' language void main() { FILE *FI = fopen("ham12.dat","rb+"); // open the input file for reading FILE *HS = fopen("scope.dat","rb+"); // open the output file for writing int f = 24890; // start frequency of this band int r = f; // start byte of this band in scope.dat fseek(HS,r,SEEK_SET); // seek start byte of this band's data for(int i = 0; i < 100; i++) // for each byte of the input file fputc('\2',HS); // save the noise level fseek(HS,r,SEEK_SET); // band start frequency for(int i = 0; i < 100; i++) { // for byte of the input file int c = fgetc(FI); // get next char from input file if(c < 2) c = 2; if(c == 2) { c *= i * (1 - i); if(c < 0) c = -c; if(c > 12) while(c > 12) c /= 12; if(c > 6) c = 12 - c; if(c == 0) c = 1; } c *= 12; fputc(c,HS); // save the groomed signal level } fclose(FI); // close the output file */ fclose(HS); // close the output file }