myriadrf / RASDR

Radio Astronomy Software Defined Radio
50 stars 13 forks source link

Integrate with Radio Sky Spectrograph (RSS) #11

Open bvacaliuc opened 7 years ago

bvacaliuc commented 7 years ago

There is a desire to integrate RASDR software with Jim Sky's Radio Sky Spectrograph.

bvacaliuc commented 7 years ago

Ok. So with commit https://github.com/myriadrf/RASDR/commit/61676c46aee677ad215d5187084a92b41269834f this feature is introduced. To enable it, open the Setup RSS Output panel and define the settings as follows:

rasdrproc-configure-rss-output

On RSS, tell it to use the Radio that is an RTL Dongle Receiver:

rss-configure-rasdrproc-input

The server is setup when you 'Start Acquisition' on RASDRproc and torn down when you 'Stop Acquisition'. RSS will make a connection to the server when you press 'Start' in its GUI. If you change parameters that will affect the frequency plan, RASDRproc will disconnect and you can just press 'Start' again in RSS to pick up the new frequencies, etc.

Please let me know what issues there may be. I'm not certain about the colors on RSS, so I might have gotten the bytes swabbed the wrong way.

bvacaliuc commented 7 years ago

With commit https://github.com/myriadrf/RASDR/commit/44efacb8, I have updated the control panel to provide additional controls:

rasdrproc-configure-rss-output-update1

These affect the calculation of the spectrum output as follows: S[n] = (( s[n] + offset ) * gain ) + bias

These will enforce the spectral outputs to prevent RSS from slowing down or going unresponsive.

This can be used if you are using an upconverter to provide the correct offset frequency so that RSS will display the actual RF frequency instead of the IF frequency that the RASDR unit is tuned to. NOTE: by rights, this is needed to be known by RASDRproc itself, but so far it was not implemented that way. In the future this control may move to a different place, but for now it is listed here with the RSS stuff.

There are a few caveats (as of RSS 2.4.20 used to test this release):

bvacaliuc commented 7 years ago

With commit https://github.com/myriadrf/RASDR/commit/a54af6bd, I have fixed an issue with the values taken for frequency bins and tested with RSS 2.8.19. The above caveats are no longer applicable, and you can go to 512 channels as documented.

bvacaliuc commented 7 years ago

With commit 2cc77702f06800347a3d1c64e526fbd9f2fd9c57, I have updated the control panel layout based on user feedback:

rasdrproc-v0 2 3 5-setup-rss-output

The values in the Adjustments box can be made without closing the control panel and are applied immediately to the processing stream so real-time feedback can be observed. When the OK/Close button is pressed, the values are applied and any stream connections are closed.

bvacaliuc commented 7 years ago

It was noted that the implementation of the above is not explained very well. Here is a rudimentary explanation:

  1. For every FFT computed (either with or without averaging) a call to LMLL_Testing_SetFFTSpectra() is made which places a range of bins onto a FIFO (m_fftAvgFIFO with a packet format of FFTAvgPacket) that includes the center and offset frequencies as well as the amplitudes.
  2. When the user STARTs acquisition, and the RSS output is enabled, a thread is created that uses the socket library to bind/listen/accept incoming connections.
  3. The above thread, upon receiving a connection, reads a spectra from the FIFO to respond according to the RSS protocol, using this code.
  4. Afterward, it continuously obtains spectra from the FIFO to perform offset/gain/bias/clip corrections on the FFT amplitudes array using this code; then sends the data over the socket.
bvacaliuc commented 4 years ago

As of today, Spectrograph 2.9.30 requires a slightly different setting to connect to RASDRproc. See below.

rss-settings-2 3 30+

bvacaliuc commented 3 months ago

Might want to check to make sure latest version of RSS works with RASDR, so keeping this open for a bit longer.