SDRReceiver icon indicating copy to clipboard operation
SDRReceiver copied to clipboard

ScytaleC ZeroMQ support

Open microp11 opened this issue 3 years ago • 12 comments
trafficstars

Hi, this is microp11, the author of ScytaleC decoder for STD-C. I just learned about your project and wanted to know if the USB demodulated signal comes out as audio or I/Q? The std-c channels are 5kHz separated, alongside the JAERO band, 4kHz in width, 1200 baud unfiltered BPSK. Can such a signal be extracted using the receiver, USB demodulated at 48k? Is the output Audio or I/Q? I think it would be worth adding 0MQ messaging to the ScytaleC because it can than run in parallel as well.

I was working on something similar using GNU Radio, to get the demodulated signal out. And I have a feeling that your project already does that and a lot more. Excellent work!

https://bitbucket.org/scytalec/scytalec/

Thanks.

microp11 avatar Jan 12 '22 18:01 microp11

Hi!

For jaero the output is USB since it expects that but it does have the ability to send I/Q data although it needs a little tinkering to make it work properly but that should be straight forward.

Otherwise yes I think that should work fine. You could define 48Khz USB VFO's in the receiver and then consume this data in your application with a zmq subscriber. You could use the low pass filter in the receiver with maybe a 10Khz filter to remove adjacent channels if needed.

Not sure what bandwidth you need to cover all channels but it may be enough with a 288Khz sample rate on the RTL? That way you keep CPU nice and low. Jaero decodes 1200 bps MSK at 12Khz sample rate just fine so you may be able to drop the rate for each VFO down to that but I guess it depends on your application. Or are you saying all the channels would fit into a single 48Khz VFO?

Thanks :-)

/Jeroen

jeroenbeijer avatar Jan 13 '22 14:01 jeroenbeijer

Hi @jeroenbeijer, thank you for the answer. I wills set up my system with your app and will investigate. The reason I did not answer is that I was (and still) not able yet to find any time, but would like to acknowledge your answer and let you know it is much appreciated. Just need to catch up. Thanks, Paul

microp11 avatar Jan 19 '22 14:01 microp11

Hi Paul, I think time is something we could all use a little more of :-)

I setup an ini file for the receiver with the STD-C channels I found on 25E in the center. I found a bunch of channels around 1539.465 that I could decode with your excellent decoder. I will post the ini file below. I used 1536000 as the sample rate, seems the RTL gives some weird results at 288K so will have to look at that later.

Just for fun I connected jaero to one of the VFO's and low and behold it locks onto the PSK signal!

So in summary I think if you add a ZMQ receiver in your program for USB audio at either 48Khz and connect to the SDR host and port number defined in the ini file with the right topic name you should be good to go. Keep in mind you will receive alternating packets of data and a packet (4 byte) indicating the samplerate of the audio.

/Jeroen

image

image

sample_rate=1536000 center_frequency=1539465000

zmq_address=tcp://*:6005

#valid tuner gains r82xx_gains[] = { 0, 9, 14, 27, 37, 77, 87, 125, 144, 157, 166, 197, 207, 229, 254, 280, 297, 328, 338, 364, 372, 386, 402, 421, 434, 439, 445, 480, 496 }; tuner_gain=496 correct_dc_bias=1

[main_vfos] size=1 1\frequency=1539550000 1\out_rate=288000

[vfos] size=7 1\frequency=1539415000 1\gain=10 1\out_rate=48000 1\filter_bandwidth=5000 1\topic=VFO01

2\frequency=1539445000 2\gain=10 2\out_rate=48000 2\filter_bandwidth=5000 2\topic=VFO02

3\frequency=1539455000 3\gain=10 3\out_rate=48000 3\filter_bandwidth=5000 3\topic=VFO03

4\frequency=1539465000 4\gain=10 4\out_rate=48000 4\filter_bandwidth=5000 4\topic=VFO04

5\frequency=1539475000 5\gain=10 5\out_rate=48000 5\filter_bandwidth=5000 5\topic=VFO05

6\frequency=1539485000 6\gain=10 6\out_rate=48000 6\filter_bandwidth=5000 6\topic=VFO06

7\frequency=1539495000 7\gain=10 7\out_rate=48000 7\filter_bandwidth=5000 7\topic=VFO07

jeroenbeijer avatar Jan 30 '22 14:01 jeroenbeijer

I don't know why my issue posting is linked to this one. I don't believe there is any connection.

DaveNF2G avatar Jul 18 '22 14:07 DaveNF2G

I have started today to look into adding support for ZMQ into scytalec. First step, finding the NCS on 54W done:

#list of frequencies at https://forums.radioreference.com/threads/scytale-and-sdr-newbie-inmarsat-questions.425814/, by dlwtrunked

sample_rate=1536000
#center_frequency=1539465000
center_frequency=1541450000

zmq_address=tcp://*:6005

#valid tuner gains r82xx_gains[] = { 0, 9, 14, 27, 37, 77, 87, 125, 144, 157, 166, 197, 207, 229, 254, 280, 297, 328, 338, 364, 372, 386, 402, 421, 434, 439, 445, 480, 496 };
tuner_gain=496
correct_dc_bias=1

[main_vfos]
size=1
1\frequency=1541450000
1\out_rate=288000

[vfos]
size=1

#1541.4500,54W,Inmarsat-C,NCS,144,,
1\frequency=1541440000
1\gain=10
1\out_rate=48000
1\filter_bandwidth=4000
1\topic=VFO01

2\frequency=1539445000
2\gain=10
2\out_rate=48000
2\filter_bandwidth=5000
2\topic=VFO02

image

Now to read the ZMQ documentation.

microp11 avatar Aug 29 '22 17:08 microp11

My test client now receives:

56464F3031 = VFO01 in ASCII (topic)
80BB0000 = 48000 (output sample rate)
D4006901E801540...  (data)
56464F3031
80BB0000
E302E102A90...

microp11 avatar Aug 30 '22 17:08 microp11

Hi @jeroenbeijer , I am saving the data-only (no topic or rate) into a binary file, and trying to open it with audacity in raw mode hoping to hear the known signal. What format is the data? I have tried different variations but no success? Thanks image

microp11 avatar Aug 31 '22 02:08 microp11

Need help, what is the data format?

IQ (one sample real, one imaginary? Int16? or other LSB?

Tried a bunch but nothing clear yet.

microp11 avatar Aug 31 '22 12:08 microp11

How to intepret the data? I brought it in scytalec, however... image

microp11 avatar Sep 03 '22 03:09 microp11

Hi Paul, sorry for the late response, been very busy and not had much time for this project. Basically on the SDR side each USB sample is converted from float to 16 bit short. So each bucket of data you receive is basically an array of 16 bits shorts. When jaero receives this from zmq the byte or is maintained and so basically the right most bit in each short is the least significant. Not sure how you pick this up and if this may affect the formatting.

jeroenbeijer avatar Sep 04 '22 08:09 jeroenbeijer

Hi, thank you:

Does this make sense?


Each sample contains short I and short Q
-----------------------------------------

Bucket 0, byte 0 is first received, byte length-1 is last received in the bucket array

Byte 0 | Byte 1 | Byte 2 | Byte 3 |      ...      | Byte length-4 | Byte lenght-3 | Byte length-2 | Byte length-1 |
-------------------------------------------------------------------------------------------------------------------
   short   I    |   short  Q      |      ...      |            short   I          |         short  Q              |
-------------------------------------------------------------------------------------------------------------------
              Sample 0            |      ...      |                        Sample length/4                        |
-------------------------------------------------------------------------------------------------------------------


Bucket 1, byte 0 is the first byte in the next bucket following byte length-1 from the previous bucket

      
Byte 0 | Byte 1 | Byte 2 | Byte 3 |      ...      | Byte length-4 | Byte lenght-3 | Byte length-2 | Byte length-1 |
-------------------------------------------------------------------------------------------------------------------
   short I      |    short Q      |      ...      |         short I               |           short Q             |
-------------------------------------------------------------------------------------------------------------------
              Sample 0            |      ...      |                        Sample length/4                        | 
-------------------------------------------------------------------------------------------------------------------


The short is LSB:

0xABCD = -21555 

microp11 avatar Sep 05 '22 13:09 microp11

Hi, the audio from the receiver out is not I/Q but USB, upper side band only.

jeroenbeijer avatar Sep 05 '22 20:09 jeroenbeijer