Loading ...
Sorry, an error occurred while loading the content.

My recent project

Expand Messages
  • vbifyz
    Hi all, I have a setup running that repeatedly goes through a list of frequencies (BIB11 broadcast schedule) and logs the SNR for each line of the schedule if
    Message 1 of 2 , Dec 5, 2011
    • 0 Attachment
      Hi all,

      I have a setup running that repeatedly goes through a list of frequencies (BIB11 broadcast schedule) and logs the SNR for each line of the schedule if it is above some threshold. Effectively, this is automated SWL, taking all the fun out of the hobby :)

      I struggled with Javascript for a while to make this a browser-only project, but then gave up because of requirement to read/write files and call other programs.

      The radio is FT-817 for now, but I plan to replace it with a Softrock. Mode is USB, the frequency is set 1kHz below the carrier to analyze the 1kHz beat tone.
      Spectrum Lab is running in mono mode, will be I/Q with the Softrock. HTTP server is enabled.
      The "brains" of the setup is a Perl script. It reads the schedule, sets the frequency by calling Hamlib/rigctl and then sends an HTTP request to SL to get the peak and noise in a 400Hz band around 1kHz. The response is parsed to strip the Javascript off and the results are written to files, one per schedule pass.
      This setup can be modified to monitor pretty much anything.

      Oh, and this is running on a P2-266 laptop.

      Here are the relevant lines from the script. Wolf, you can include this in the README_server_pages.txt file if you wish.

      # include the HTTP package (part of all popular Perl distributions)
      use LWP::Simple;

      ...

      # pause after the frequency change, so that the click is out of the sample buffer
      select(undef, undef, undef, 0.2);
      # call SL ifunc
      $content = get("http://127.0.0.1:2112/_ifunc.html?pk_a=peak_a(800,1200)&pk_f=peak_f(800,1200)&band_n=noise_n(800,1200)");
      # regexp match picks up the numerical value after "pk_a" in the HTTP response
      if ($content =~ m/pk_a\',\'(-\d+\.\d+)/ ) {
      $pk_a = $1;
      }
      # same for peak frequency
      if ($content =~ m/pk_f\',\'(\d+\.\d+)/ ) {
      $pk_f = $1 - 1000;
      }
      # same for noise level
      if ($content =~ m/band_n\',\'(-\d+\.\d+)/ ) {
      $band_n = $1;
      }
      # signal to noise ratio, allows to measure the station relative strength with AGC working.
      # All numbers are in dB, division becomes subtraction
      $s2n = $pk_a - $band_n;

      ...

      73, Mike
    • wolf_dl4yhf
      Hello Mike, Thanks for the info and for sharing the Perl script - I will add a pointer to this forum / post in the server-pages info for the next release. All
      Message 2 of 2 , Dec 6, 2011
      • 0 Attachment
        Hello Mike,

        Thanks for the info and for sharing the Perl script - I will add a pointer to this forum / post in the server-pages info for the next release.

        All the best,
           Wolf .

        Am 05.12.2011 21:19, schrieb vbifyz:
         

        Hi all,

        I have a setup running that repeatedly goes through a list of frequencies (BIB11 broadcast schedule) and logs the SNR for each line of the schedule if it is above some threshold. Effectively, this is automated SWL, taking all the fun out of the hobby :)

        I struggled with Javascript for a while to make this a browser-only project, but then gave up because of requirement to read/write files and call other programs.

        The radio is FT-817 for now, but I plan to replace it with a Softrock. Mode is USB, the frequency is set 1kHz below the carrier to analyze the 1kHz beat tone.
        Spectrum Lab is running in mono mode, will be I/Q with the Softrock. HTTP server is enabled.
        The "brains" of the setup is a Perl script. It reads the schedule, sets the frequency by calling Hamlib/rigctl and then sends an HTTP request to SL to get the peak and noise in a 400Hz band around 1kHz. The response is parsed to strip the Javascript off and the results are written to files, one per schedule pass.
        This setup can be modified to monitor pretty much anything.

        Oh, and this is running on a P2-266 laptop.

        Here are the relevant lines from the script. Wolf, you can include this in the README_server_pages.txt file if you wish.

        # include the HTTP package (part of all popular Perl distributions)
        use LWP::Simple;

        ...

        # pause after the frequency change, so that the click is out of the sample buffer
        select(undef, undef, undef, 0.2);
        # call SL ifunc
        $content = get("http://127.0.0.1:2112/_ifunc.html?pk_a=peak_a(800,1200)&pk_f=peak_f(800,1200)&band_n=noise_n(800,1200)");
        # regexp match picks up the numerical value after "pk_a" in the HTTP response
        if ($content =~ m/pk_a\',\'(-\d+\.\d+)/ ) {
        $pk_a = $1;
        }
        # same for peak frequency
        if ($content =~ m/pk_f\',\'(\d+\.\d+)/ ) {
        $pk_f = $1 - 1000;
        }
        # same for noise level
        if ($content =~ m/band_n\',\'(-\d+\.\d+)/ ) {
        $band_n = $1;
        }
        # signal to noise ratio, allows to measure the station relative strength with AGC working.
        # All numbers are in dB, division becomes subtraction
        $s2n = $pk_a - $band_n;

        ...

        73, Mike


      Your message has been successfully submitted and would be delivered to recipients shortly.