I am going to do frequency scan using C++ code in LimeSDR. How to devide a range of frequency into several pieces? Is it possible to use a loop to devide frequencies and outfiles?
Here is an outline of what you want -
Set The sample rate to 10e6
if (LMS_SetSampleRate(device, 10e6, 2) != 0)
error();
Step to all frequencies between 800 and 900 MHZ opening a file every 10 MHZ -
Blockquote
for(int k=0;k<10;++k){
FILE *out;
char filename[256];
if (LMS_SetLOFrequency(device, LMS_CH_RX, 0, 805e6+k*10e6) != 0)
error();
sprintf(filename,"minute-%08d.raw",k);
out=fopen(filename,"wb");
if(out == NULL){
printf("Could Not Open %s to Write\n",filename);
exit(1);
}
....
if(out)fclose(out)
}
Blockquote