All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Oct 20, 2019 12:20 pm 
User avatar

Joined: Tue Mar 04, 2014 10:17 am
Posts: 65
Hi there
I was wondering what kind of RDS Signal do I need for stereo Tool to accept it

if I am not mistaken I should create BPSK Modulated Signal 2.2khz wide on one half of 57khz then mirror that on the other half of 57khz to get 4khz wide RDS signal

IEC 62106: http://downloads.dxing.si/download.php? ... /62106.pdf
mentiones RDS as being:
"
The subcarrier is amplitude-modulated by the shaped and biphase coded data signal (see 4.8).
The subcarrier is suppressed. This method of modulation may alternatively be thought of as a
form of two-phase phase-shift-keying (psk) with a phase deviation of ±90º.

"

but BPSK is 180° out of phase so I am a bit confused here

here is my BPSK modulation code in C# if anyone wants it, it kinda works but doesn't produce anything close to RDS Physical layer
Code:
using NAudio.Wave;
using NAudio.Wave.SampleProviders;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace SineWaveGenerator
{
    class Program
    {
        //static DeviceNumber = 1; //Virtual Audio Cable
        static int DeviceNumber = 5; //Speakers

        //BPSK Modulation
        static int DATALENGTH = 1000;
        static double carrierFrequency = 56e3; //carrier frequency (56khz)
        static double amplitudeGain = 1; // amplitude gain of the carrier frequencyž
        static double samplingRate = 192e3; // sampling rate of carrier generator (192khz)
        static void Main(string[] args)
        {
            Program prg = new Program();
            Random rnd = new Random();
            
        
        
            int[] inputData = new int[DATALENGTH];
            double[] outputData = new double[DATALENGTH];
            for (int i = 0; i < DATALENGTH; i++)
            {
                inputData[i] = rnd.Next() % 2;
                BPSK_mod(inputData, ref outputData, DATALENGTH);
            }

            //Send to sound card
            byte[] BPSKArray = Tools.GetBytes(outputData);
            using (var wo = new WaveOutEvent() { DeviceNumber = 1 }) //Virtual Audio Cable Line 1 Cable
            //using (var wo = new WaveOutEvent()) //Default sound card
            {
                IWaveProvider provider = new RawSourceWaveStream(
                         new MemoryStream(BPSKArray), new WaveFormat());
            
                wo.Init(provider);
                wo.Play();
                while (wo.PlaybackState == PlaybackState.Playing)
                {
                    Thread.Sleep(500);
                }
            }            
        }

        static void BPSK_mod(int[] input, ref double[] output, int size)
        {
            for (int i = 0; i < size; i++)
                output[i] = amplitudeGain * Math.Sin(2 * Math.PI * ((carrierFrequency * i / samplingRate) + input[i]));
        }
    }
}

but its output looks horrible even if using 192khz Virtual Audio cable
Image

not sure Hans how are you doing BPSK modulation? (if it even is BPSK)

Yea I want to write RDS encoder for exercise :)


Top
   
PostPosted: Wed Oct 23, 2019 5:32 pm 
Site Admin
User avatar

Joined: Mon Mar 17, 2008 1:40 am
Posts: 9953
If you're asking what Stereo Tool needs: It will just pass on anything it sees at 57 kHz +/- 2.4 kHz, and attempt (with a good RDS signal this will succceed) to synchronize its 19 and 38 kHz signals to it.

That other part.. I don't know where you found that description but I don't understand what it's saying. Mirroring? Why so difficult? Just generate the 2.4 kHz signal and modulate that at 57 kHz... That's the easy part though, the rest is not.....

Edit: And your code says 56 kHz, not 57!


Top
   
PostPosted: Sun Oct 27, 2019 4:29 pm 
User avatar

Joined: Tue Mar 04, 2014 10:17 am
Posts: 65
Quote:
If you're asking what Stereo Tool needs: It will just pass on anything it sees at 57 kHz +/- 2.4 kHz, and attempt (with a good RDS signal this will succceed) to synchronize its 19 and 38 kHz signals to it.

That other part.. I don't know where you found that description but I don't understand what it's saying. Mirroring? Why so difficult? Just generate the 2.4 kHz signal and modulate that at 57 kHz... That's the easy part though, the rest is not.....

Edit: And your code says 56 kHz, not 57!
Thanks
I found the mirroring part here: https://www.sigidwiki.com/wiki/Radio_Data_System_(RDS)
Quote:
The RDS mode transmitted is actually one PSK signal identically duplicated and mirrored across the 57 kHz carrier for robustness and redundancy
here it also says its BPSK modulated but specs says it is not so I am a bit confused :) (is it BPSK or it is not?)
Quote:
Edit: And your code says 56 kHz, not 57!
whoopsy thats a typo :) but that still doesn't explain why isn't my signal at 56 khz but all across 192khz in the picture?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+02:00


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited