/* * Program: Global Communicator II - scanner signals converter * Programmer: Robert John Morton UK-YE572246C * Date: Tue 22 Sep 2020 From the directory in which conv.c resides: to compile: gcc volmet.c -o volmet */ #include // input output to/from the console and keyboard #include // standard functions for the 'C' language int VM[7][2] = { // frequency & signal strength 0-120 { 3413, 100 }, { 4742, 50 }, { 5450, 70 }, { 5505, 36 }, { 8957, 44 }, { 11253, 19 }, { 13264, 27 } }; int S[8]; void main() { FILE *HS = fopen("scope.dat","rb+"); // open the output file for writing int q = 0; for(int i = 0; i < 7; i++) { // for byte of the input file fseek(HS,VM[i][0] - 4,SEEK_SET); // lower sideband freq int q = VM[i][1]; // get signal strength for(int j = 0; j < 4; j++) { // compute sideband amplitudes S[j] = q; q *= 0.707; } fputc(S[3],HS); fputc(S[2],HS); fputc(S[1],HS); fputc(S[0],HS); fputc(q,HS); fputc(S[0],HS); fputc(S[1],HS); fputc(S[2],HS); fputc(S[3],HS); } fclose(HS); // close the output file }