Rdsspy
Rdsspy
02
Table of Content
1 Installation/Update ............................................................................................... 2
2 Hardware and Software Requirements................................................................ 2
3 RDS Data Sources .............................................................................................. 3
3.1 Serial COM Port ........................................................................................... 3
3.2 Sound card – Data and Clock....................................................................... 4
3.3 Sound card – RDS Encoder ......................................................................... 7
3.4 Sound card – Direct MPX or RDS input........................................................ 8
4 Command Line Options ....................................................................................... 9
5 RDS Spy Options............................................................................................... 10
5.1 General....................................................................................................... 10
5.2 Playback ..................................................................................................... 11
5.3 Recording ................................................................................................... 11
5.4 Reports ....................................................................................................... 11
6 Recording and Playing RDS Files...................................................................... 12
6.1 File Types ................................................................................................... 12
6.2 Recording ................................................................................................... 12
6.3 Playback ..................................................................................................... 12
7 Creating Reports and Logs ................................................................................ 13
7.1 Simple Automated Logging......................................................................... 14
7.2 Template Files ............................................................................................ 15
8 Plugin Administration ......................................................................................... 16
9 Special Options.................................................................................................. 16
9.1 Super PI Detector ....................................................................................... 16
10 Frequently Asked Questions .......................................................................... 17
11 Support........................................................................................................... 19
12 Annexes ......................................................................................................... 20
12.1 RDS Spy Files Specification ....................................................................... 20
12.2 Serial Protocol Specification ....................................................................... 20
12.3 RDS/RBDS Group Format.......................................................................... 22
12.4 Group Analyzer Plugin Description (grpconts.dll) ....................................... 24
12.5 List of Abbreviations ................................................................................... 25
1 Installation/Update
1. Download and run the installation exe file.
2. Select the setup language and finish the installation using Next button.
3. Run the RDS Spy and select the RDS source.
4. Arrange the workspace as required and save your settings using menu item
File – Save Workspace.
The RDS Spy can be installed more times on the same machine if each
installation is placed in different subfolder (for example
C:\Program Files\RDS Spy\ and C:\Program Files\RDS Spy 2\).
Recommended configuration
• CPU 1 GHz
• 256 MB RAM
• Screen resolution 1366x768 @ 32-bit colors
• Windows XP
These basic skills may be required but are not discussed in this manual:
• Working with folders and files (especially if Windows ‘UAC’ is enabled)
• Recording audio via PC sound card (only if using sound card source)
• Soldering and understanding cable wiring
3 RDS Data Sources
Several RDS data sources are provided for live RDS decoding:
• Serial COM Port – The RDS Data and Clock signals must be converted
using a simple circuit. This ensures compatibility with all RS232 ports and
USB to RS232 adapters.
• Sound card – Data and Clock – The Data and Clock signals are fed to
your sound card’s recording line input.
• Sound card – RDS Encoder – For any RDS encoder output data analysis.
The RDS encoder output is fed to the sound card through a simple half-
wave rectifier circuit.
• Sound card – Direct MPX or RDS input – The RDS or MPX signal is fed
directly to the sound card input. The sound card must support 192 kHz
sampling rate for recording.
• ASCII G Protocol – P75/P175 FM Analyzer – Measuring device
connected either via RS232/USB or Ethernet.
• ASCII G Protocol – P132 RDS Encoder – RDS encoder with remote
output monitoring feature, connected either via RS232/USB or Ethernet.
• (No source) – The software provides playback features only.
Old DOS-based RDS decoders use special pins of the RS232 port to feed the
Clock and Data signals to the PC. Today this solution has a few big
disadvantages like compatibility problems with USB adapters and virtual
machines, higher CPU load or gaps in RDS reception when the PC is busy.
Following simple circuit converts the Clock and Data signals to valid ASCII
characters on its TxD output. These are received by the PC via RxD pin of the
COM port as any other standard serial communication.
The converter above can be powered either from the receiver’s internal +5V path
or using the power supply circuit as follows. This circuit provides +5V directly from
the same RS232 port the converter is connected to. If the power supply voltage
provided by the port is too weak (especially when using some laptops or USB to
RS232 converters), an external power adaptor can be connected:
Wiring summary:
Converter PC
wire port pin
TxD 2
GND 5
DSR 4
CTS 7
If your PC is not equipped with any RS232 port or if you do not want to solder the
converter above, you can simply plug the Data and Clock signals to a stereo input
of the sound card. The application ensures excellent compatibility with almost any
sound card using software defined PLL, numerically controlled oscillator (NCO)
and edge detector.
In basic configuration the Data is connected to right channel and Clock is
connected to left channel. The Ground must always be connected.
It's recommended to insert 1k resistor to each the Data and Clock signal path
rather than connect them directly. This may help to suppress RF interference
caused by digital signal edges, protect your sound card and improve frequency
characteristics. Do not use longer cable than it's required for the connection.
If you hear the data from the speakers, unselect the Line input in the Playback
properties or simply mute the sound card.
In Vista, Seven or later, the sound system is different and a little bit confusing. In
these systems the user must select the input directly in the RDS Source dialog.
Adjusting of the input level is possible if you open the Mixer and configure
appropriate input:
In case you cannot get the decoder working, then select View – Status
Information and check how the signal looks like. You should see something like
this in the oscilloscope window:
Left
channel
(Clock)
Right
channel
(Data)
Eventual clipping (overload) has no effect on right functioning. Close any other
application accessing the sound card input before running the RDS Spy.
To make your life much easier there is a bit of “intelligence” implemented in the
application. The RDS decoding will still work if any combination of these
conditions occurs:
If you see “steps” (more than two voltage levels) in the oscilloscope window, it’s
probably caused by summing the Clock and Data signals into one channel (the
sound card input is mono or there’s a short-circuit inside some connector). In this
case disconnect the Clock signal and the decoding will work.
By default, the application automatically configures the sound card as follows:
The sound card source permits the user to select if data are valid at rising or
falling edge of the clock signal. Please remember that this option has no effect if
you use RDS demodulator based on TDA7330, SAA6579 or similar. Which clock
transition (positive or negative going clock) the data change occurs in, depends
on the lock conditions and it's arbitrary.
In special cases the input signal may require polarity inversion. This may occur for
example when using optocouplers, playing from wave file or using specific sound
card. For this purpose the Invert option is provided. This option must be selected
manually.
Please note that choosing this source, the PC is unable to decode RDS directly
from the demodulated audio signal. There must be an RDS demodulator present
inside the receiver or connected externally that provides the Clock and Data
signals required.
Note: Some sound cards do not work correctly with sample rate below 44100 Hz.
The user may force the 44100 Hz sample rate using appropriate check box in
Options – General. However, enabling this option may consume a bit of CPU time
on very slow machines.
Important note: If your sound card provides “advanced” functions like noise
reduction, automatic gain control, echo cancellation, digital preamplifier or
similar, they must be turned off!
RDS Encoder is a device that puts the RDS signal on-air on the transmitter site.
The RDS Spy allows analyzing the RDS data and adjusting all RDS services
before final installation of the encoder.
Notes:
Note: This option is applicable only if your sound card supports 192 kHz sampling
rate for recording. Most of sound cards do not provide this key facility. Please
follow the sound card’s documentation or visit the online forum.
Choosing this option the entire connection becomes as simple as on the picture:
The RDS Spy provides complete DSP processing of the input signal, including
57 kHz band-pass filtering, subcarrier synchronization and demodulation via
Costas Loop equivalent structure, RDS clock regeneration, biphase symbol
decoding and differential decoding of RDS data. Thus the RDS Spy entirely
removes a need of any external RDS processing circuit.
Note: If your FM tuner does not provide MPX output and no such modification is
possible, use the audio line output instead. Although typical FM tuner suppresses
RDS signal on the audio output, there are usually some RDS signal residues
remaining so the RDS decoding is still possible. Connect both audio channels,
right to right, left to left.
Examples:
rdsspy.exe c:\file1.spy
rdsspy.exe "D:\RDS Files\11-02-06 City FM.spy"
rdsspy.exe stream:localhost:23
rdsspy.exe /ws:myworkspace.rsw
rdsspy.exe /rec
5 RDS Spy Options
To enter the Options dialogue window, select Configure – Options in the main
menu.
5.1 General
Enable seeking and show Shows seeking bar when playing a RDS file.
total group count Requires processing of the file before play so it
may cause a delay on very long RDS files.
Socket streams: Check/uncheck this option if playing from a socket
synchronize source is not continuous.
5.3 Recording
5.4 Reports
Default path and file name Default path and file name of the report file that is
used to avoid entering the file name manually for
each report. See the section 'Creating Reports' for
more information.
Always confirm frequency Shows a frequency confirmation window each
time the report is written.
Since the RDS Spy usually don't know the
frequency of the station (that does not apply for
P75/P175), the user must enter the frequency
manually in order to show it in the report.
6 Recording and Playing RDS Files
The RDS Spy supports two types of RDS files for recording and playback: RDS
Spy files (*.spy) and RRDS files (*.smp). The user may decide for any of them.
6.2 Recording
Before recording a RDS file check the Recording folder and file name in Options.
You may also assign the file name manually before each new recording by
pressing the button with three dots next to the REC button. In this case the file
name will appear on the LCD.
6.3 Playback
To play the RDS file choose menu item File / Play File or click on the PLAY button
or simply move the file from the Total Commander or similar file manager to the
RDS Spy main window.
During the playback you may adjust the playback speed or pause the playback
using the track bar on the left. If appropriate feature is enabled in Options, you
may move to any position in the file using the seeking bar.
After the file reaches its end, you may return to live decoding by pressing the
Reset button.
To create a report, select the option File / Create Report in the main menu and fill
the file name desired. Optionally you may be asked for the tuned frequency which
is included in the report.
Logs can be saved automatically. This is especially useful for logging occasional
FM station reception. The logging event occurs before any data reset, for example
before PI reset, timeout reset, application exit etc. Note that if a folder is specified
in the options, it must be created manually.
Each report (log) may occupy a separate file or all reports (logs) may append into
a single file.
7.1 Simple Automated Logging
Following instructions describe how to configure the RDS Spy in order to leave a
single line in the report file for each station received.
Fill a file name the logging will occur to. Optionally use the %date tag.
Enable saving the logs automatically and appending the log data.
Select appropriate template file. For a single line logging, fill single.srt
3. Tune some stations one by another. The log file will look like this:
Line added by
Super PI detector
(No BER)
The user may customize the report content by selecting appropriate template file
in the options.
The template file (*.srt) may be edited in any plain text editor such as Notepad.
When done, save the template file under another name but keeping the .srt
extension. All dynamic tags are delimited by % in the template. These tags are
replaced by appropriate value in the report.
To get the list of all dynamic tags, use the menu item View / Decoder Data or
open the default template supplied with the application.
Please note that some fields in the report may stay empty if appropriate plugin is
not installed.
Note:
The template may be a HTML file as well. If <HTML> and </HTML> tags are
found in the template file, all dynamic content is “HTML encoded” as follows:
< changed to <
> changed to >
& changed to &
Other characters without change.
8 Plugin Administration
Plugins are located in the folder named plugins. For example, if the main
application is installed to C:\Program Files\RDS Spy\, the plugins are placed in
C:\Program Files\RDS Spy\plugins\. Any plugin placed in this folder is
automatically active. To deactivate the plugin, delete it from this folder or move it
to another folder.
The application searches for installed plugins at stat-up. You can show the plugin
using the menu item View. You can configure the plugin using the menu item
Configure.
Tip: If you need to run more instances of the same plugin, copy it to the plugin
folder more times using different file names, for example grpconts1.dll,
grpconts2.dll etc. Each instance will use own settings.
9 Special Options
The PI is usually unique for each station within a country. Since the PI is
transmitted frequently, it can be used for the station identification although the
station’s signal is weak and other RDS services like PS are hard to decode.
The Super PI detector is unique in the fact that it can read the PI code although
there are no correct blocks in the data being received. It does not require group
and block synchronization at all. However it is not a miracle. It gives best results
on stable weak signals which start to be noisy on mono listening. Note that it may
give a spurious PI occasionally which is usually simple to recognize and it's
replaced by the right PI after a moment.
The output from the Super PI detector is also used for PI reset, reports and
logging. It is however not possible to record the “super” PI as recording works with
RDS groups, i.e. only when synchronization is present.
If the Super PI detector is receiving a PI, the signal timeout will not occur although
the group counter is not counting.
10 Frequently Asked Questions
Q: I can't find Line-in input on my notebook. There's MIC input only which is
mono. Can I decode RDS using this hardware?
A: Yes, you can still decode RDS using the sound card if its sample rate
frequency is accurate enough. Due to software defined PLL the application is
able to synchronize also using the edges of the Data signal in the Clock
channel. Try this connection:
In the sound card configuration switch off all "features" like MIC boost, 20 dB
gain, echo cancellation, compressor etc. Some sound cards may require
separation capacitor due to high DC voltage on the MIC input (used as the
microphone power supply). In this case place a 10 µF capacitor in series with
the resistor.
Q: I'm getting PI although the receiver is switched off or the station tuned
does not use RDS. How is that possible?
A: Nothing doing. This is a characteristic of the RDS system combined with high
PI detection sensitivity. From time to time the PI (valid block 1) can be found
repeatedly in almost any signal. The probability is extremely low in random
signal (typically noisy reception). However it's more frequent in signals that do
not contain any RDS information but also are not really random. It can be
noted that specific combinations of equipment and conditions generate
repeatedly the same spurious PI codes.
Q: My new radio receiver does not contain any of the RDS demodulator IC.
However I have found some clock and data signals inside the receiver.
Why RDS decoding does not work with RDS Spy using these signals?
A: There exist probably tens of different serial buses based on clock and data
signals carrying various data. The RDS serial bus based on continuous stream
of 1187.5 bit/s is not the only one bus type present in receivers. Moreover this
bus is not accessible on many new receivers as the RDS demodulation and
decoding is made internally inside DSP unit. RDS Spy cannot read other serial
buses like I2C or SPI as these buses often does not carry the data required
and use a communication speed of up to several MHz which exceeds
capabilities of any sound card or serial port. If MPX output is accessible, an
external RDS demodulator can be used to get RDS clock and data.
Q: Why AF Method B shows the same frequency pair in two different AF
lists? Why there are more AF pairs in some lists than indicated?
A: This happens if there can be found two AF lists whose tuning (base)
frequencies are equal to the frequencies in the AF pair affected. For example
AF pair 95.4, 102.8 will be included in AF list with tuning frequency 95.4 and in
AF list with tuning frequency 102.8, regardless of which AF list the pair was
originally inserted to.
Although this may look like a bug, it is an intention. The software is made to
strictly meet some key RDS standard rules, especially the arbitrary group
order. There's no memory or anything in the software that makes decisions
depending on how the RDS groups are going one after another. So it may
occur that some AF B lists contain AF pairs from another AF B lists if one of
the frequencies matches to the tuning frequency.
One may say that it is clear from the group order where the list begins and
ends and where another list starts so AF pair mixture can be avoided. Yes,
that's almost true, but only in case of excellent signal; it does not apply in
general! The algorithm implemented in the software is made to give the same
result regardless of the signal quality and number of groups lost. In our opinion
it's the only one correct algorithm although it is sometimes not visually perfect.
11 Support
The software is provided as is, without warranty of any kind. Please send us your
suggestions or bug reports, it will help us to improve the software. Your feedback
is important. Visit the online forum.
Please note that we are not able to provide individual support and consultancy
related to the software use or electronic circuit modifications. Hope you’ll have a
success in the online forum.
Although the RDS Spy is provided as a freeware also for commercial use, please
always keep in mind these points:
• You may redistribute the application only with original documentation and a
link to the original location (rdsspy.com).
• You may not reverse engineer, decompile, disassemble, rent or lease this
application or any part.
• The rdsspy.exe sources are not available anywise.
• The author is not liable for any damages, including but not limited to, lost
profits, lost savings, or other incidental or consequential damages arising out
of the use of the application or its documentation.
The RDS Spy can play any RDS content that meets following minimum
specification:
• Input options: file or socket stream (File – Play File; File – Play Stream)
• File name and extension: not limited
• Content type: ASCII text 8-bit
• Content structure: one RDS group per one line
• Line delimiter: CR+LF for files, CR+LF, LF+CR or CR for sockets
• Line order: top line in the file contains the oldest group and it's played first
• Line structure: each line must start with RDS group. Space characters are
ignored. If there's any other information in the rest of the line, it is ignored.
Exception exists for time information, which - if present - should be the last
information on the line.
Lines that are shorter than 16 characters are ignored.
• RDS group structure:
AAAABBBBCCCCDDDD, where AAAA is block 1 (PI) in hexadecimal,
BBBB is block 2, etc. There may be space characters between any
hexadecimal digits. Bad blocks must be replaced by ----.
• Time information structure (optional):
YYYY?MM?DD?HH:NN:SS?CC
where '?' can be any character, centiseconds (?CC) are optional.
Line example:
2205 0548 A8BB 4631 @2011/08/30 15:30:52.50
This section explains how to feed the RDS Spy directly from a customized
external device. For a device equipped with USB or RS232 interface it is better to
use this interface also as the RDS data output rather than connecting it to the
sound card. The RDS Spy is able to read data that are provided via serial port
(implemented in hardware or realized by USB driver, virtual COM port etc.). The
software accepts two different protocols via serial port. The first is the one with
Clock and Data converter, let's call it Bit protocol. The second is the P75/P175
protocol.
Bit protocol
Using this protocol all RDS data bits from RDS demodulator are translated into
serial data bytes. These bytes are sent using 19200 Bd, no parity, 1 stop bit.
Bit value Byte value
0 0xF0
1 0xFE
Thus one bit of the original RDS data occupies one byte in the serial data. The
RDS Spy performs all data processing like block and group synchronization or
CRC checking.
ASCII G protocol
The device must perform all data processing like block and group synchronization
and CRC checking. It sends the groups in ASCII representation in this form:
"G:"+#13+#10+"AAAABBBBCCCCDDDD"+#13+#10+#13+#10
where AAAA is PI, BBBB is block 2 etc. No CRC or offsets are included. Bad
blocks must be recognized in the device and replaced by ----. For example:
G:
AAAABBBB----DDDD
G:
AAAA------------
etc.
Completely bad groups can be simply omitted. There's no need to send the
groups continuously. The data are sent on 19200 Bd, no parity, 1 stop bit or via
TCP/IP sockets.
A special group RESET------- will have the same effect as clicking on the
Reset button in the application. A special group EXIT-------- will have the
same effect as clicking on the Close button in the application.
Especially the command *R can be used by the device to activate the RDS group
sending. If this is not required, the initialization commands should be ignored.
12.3 RDS/RBDS Group Format
The largest element in the RDS coding structure is called a "group" consisting of
104 bits. The group comprises 4 blocks of 26 bits each. Each block comprises an
information word and a checkword. Each information word comprises 16 bits.
Each checkword comprises 10 bits.
All information words, checkwords, binary numbers or binary address values have
their most significant bit (MSB) transmitted first.
The data transmission is fully synchronous and there are no gaps between the
groups or blocks. The basic data-rate of the system is 1187.5 bit/s. Thus
transmission of one group takes about 87.6 ms and about 11.4 groups are
transmitted per one second.
• The services which are to be repeated most frequently, and for which a short
acquisition time is required (PI, TP, PTY), in general occupy the same fixed
positions within every group.
• There is no fixed rhythm of repetition of the various types of group, i.e.
there is ample flexibility to interleave the various kinds of message to suit the
needs of the users at any given time.
• The first four bits of the second block of every group are allocated to a four-bit
code which specifies the application of the group - group type. Groups are
referred to as types 0 to 15.
• For each type (0 to 15) two "versions" can be defined. The "version" is
specified by the fifth bit of block 2: 0 = version A, 1 = version B.
• For all groups of version B the PI is inserted also in block 3 so this block
cannot carry any other information when version B of the group is used.
Group types
Time (hh:mm:ss)
Block 1 to 4 (HEX)
Group type
TP
PTY (BIN)
Block 2 <4..0> (BIN) Block 3 to 4 (DEC)
Block 3 to 4 (BIN) Block 3 to 4 (ASCII)
Mask examples:
Show groups 3A
containing 0xCD46 in
block 4
12.5 List of Abbreviations
AF Alternative Frequencies
ASCII American Standard Code for Information Interchange
BER Block Error Rate
BIN Binary number
CR Carriage Return character (0x0D)
CRC Cyclic Redundancy Check
DC Direct Current
DEC Decimal number
DSP Digital Signal Processing
FM Frequency Modulation
HEX Hexadecimal number
LF Line Feed character (0x0A)
MIC Microphone
MPX Multiplex stereo+RDS
PC Personal Computer
PI Program Identification code
PLL Phase Locked Loop
PS Program Service name
PTY Program Type code
RBDS Radio Broadcast Data System
RDS Radio Data System
RF Radio Frequency
UAC User Account Control
USB Universal Serial Bus