Generate RDS/RBDS waveform
System object™ generates configurable standard-compliant baseband
RDS/RBDS waveforms in MATLAB®. RDS/RBDS waveforms supplement FM radio stations with additional textual
information, such as song title, artist name, and station description. The RDS/RBDS
signal lies in the 57 kHz band of the baseband FM radio signal.
You can use this object to generate a waveform containing RadioText Plus (RT+) information and register a custom encoding implementation for an open data application (ODA). You can also specify the time, data, and the program type. The object supports short, scrolling 8-character text and longer 32-character or 64-character text.
To generate baseband RDS/RBDS waveforms:
comm.RBDSWaveformGeneratorobject and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
rbdsgen = comm.RBDSWaveformGenerator creates an RDS/RBDS
waveform generator object,
rbdsgen, using the
rbdsgen = comm.RBDSWaveformGenerator(Name=Value)
specifies additional properties using name-value arguments. For example,
creates an RDS/RBDS waveform generator that expects 20 groups per output frame
and 10 samples per symbol.
Unless otherwise indicated, properties are nontunable, which means you cannot change their
values after calling the object. Objects lock when you call them, and the
release function unlocks them.
If a property is tunable, you can change its value at any time.
For more information on changing property values, see System Design in MATLAB Using System Objects.
If a property is listed as tunable, then you can change its value even when the object is locked.
SamplesPerSymbol — Number of samples per symbol
10 (default) | positive even integer
Number of samples per symbol (bit), specified as a positive even integer. Half of the samples represent one amplitude level of Manchester coding. The other half of the samples represent the opposite level.
GroupsPerFrame — Number of groups per output frame
10 (default) | scalar integer
Number of groups per output frame, specified as a scalar integer. Each group is 104 symbols (bits) long.
RadioText — Long text conveyed with type 2A groups
'Long text' (default) | character vector
Radio text conveyed with type 2A groups, specified as a character vector that is up to 64 characters long. The object transmits the specified text four characters at a time, using type 2A groups.
ProgramServiceName — Label of program service
'ShortTxt' (default) | character vector
Label of the program service, specified as a character vector that is up to eight characters long. This information is conveyed as a short text with type 0A groups, two characters at a time.
ProgramIdentificationCode — Program identification code
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0] (default) | 16-bit row vector
Program identification (PI) code, specified as a 16-bit row vector. In North America, the PI code conveys the call letters of the station.
To generate North American PI codes for the call letters of a radio
station, use the
Example: Example call letters include
ProgramType — Program type
'No program type or undefined' (default) | character vector
Program type, specified as a character vector containing one of the 31 values allowed by the RDS/RBDS standard. For a list of program types that the RDS/RBDS standard allows in North America, see .
ProgramTypeName — Program type name
'' (default) | character vector
Program type name, specified as a character vector that is up to eight
characters long. This text further characterizes the program type, such as
'Football' for the program type
'Sports'. The object conveys the program type name
using type 10A groups. If this property is empty, then no 10A groups are
SendDateTime — Option to advertise date and time
0 (default) |
Option to advertise the date and time, specified as a logical
1). When you set this
true, one 4A group is periodically generated
every 685 groups (once a minute).
AlternativeFrequencies — Alternative frequencies
 (default) | row vector
Alternative frequencies, specified as a row vector in MHz. This information is conveyed with type 0A groups. It indicates other transmitters broadcasting the same program in the same or adjacent reception areas. With this information, receivers can switch to a different frequency with better reception.
SendRadioTextPlus — Option to send RT+ information
0 (default) |
Option to transmit RadioText Plus (RT+) information, specified as a scalar
logical. When you set this property to
true, the RT+ ODA
information is advertised with type 3A groups. In addition, the RT+ content
types, specified in
RadioTextType2, and the two RT+ substrings indexed
RadioTextIndices are conveyed with the open-format
type 11A group.
RadioTextType1 — Content type of first RT+ substring
'Item.Artist' (default) | character vector
Content type of the first RT+ substring, specified as a character vector. Allowed values are the class names specified in the RT+ standard. For more details, see .
RadioTextType2 — Content type of second RT+ substring
'Item.Title' (default) | character vector
Content type of the second RT+ substring, specified as a character vector. Allowed values are the class names specified in the RT+ standard. For more details, see .
RadioTextIndices — Start and end indices of RT+ substrings
[1 2; 3 4] (default) | 2-by-2 matrix of positive integers
Start and end indices of RT+ substrings, specified as a 2-by-2 matrix of positive integers. The first column indexes the beginning of each RT+ substring. The second column indexes the end of each substring.
outputs a frame of the
baseband RDS/RBDS waveform in column vector
Y = rbdsgen
Y. The waveform
contains the number of 104-bit groups, specified in the
property of the object. The object oversamples each symbol according to the
property. The object uses an internal scheduler to determine the order and
frequency of the transmitted group types.
Y — Output signal
Output signal, returned as a column vector. The returned vector
contains a (
SamplesPerSymbol × 104 ×
GroupsPerFrame) sample frame of the baseband RDS/RBDS
waveform. The waveform contains the number of (104-bit) groups specified
GroupsPerFrame property. Each symbol is
oversampled according to the
property. The object uses a scheduler to determine the order and
frequency of the generated group types.
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named
Generate RBDS Waveform and Apply FM Modulation
Generate a basic RBDS waveform, FM-modulate the waveform with an audio signal, and then demodulate the waveform.
Each frame of the RBDS waveform contains 19 groups, with a group length of 104 bits (symbols) each. Set the number of samples per RBDS symbol to 10. Therefore, the number of samples in each frame of RBDS waveform is 104 x 10 x 19 = 19,760. According to the RBDS standard, the bit rate is 1187.5 Hz. So, the RBDS sample rate = 1187.5 x samples per RBDS symbol. Set the audio frame rate to 40 x 1187.5 = 47,500.
groupLen = 104; sps = 10; groupsPerFrame = 19; rbdsFrameLen = groupLen*sps*groupsPerFrame; afrRate = 40*1187.5; rbdsRate = 1187.5*sps; outRate = 4*57000; afr = dsp.AudioFileReader( ... "rbds_capture_47500.wav", ... SamplesPerFrame=rbdsFrameLen*afrRate/rbdsRate); rbds = comm.RBDSWaveformGenerator( ... GroupsPerFrame=groupsPerFrame, ... SamplesPerSymbol=sps); fmMod = comm.FMBroadcastModulator( ... AudioSampleRate=afr.SampleRate, ... SampleRate=outRate,... Stereo=true, ... RBDS=true, ... RBDSSamplesPerSymbol=sps); fmDemod = comm.FMBroadcastDemodulator( ... SampleRate=outRate,... Stereo=true, ... RBDS=true, ... PlaySound=true); scope = timescope( ... SampleRate=outRate, ... TimeSpanSource="Property", ... TimeSpan=0.002, ... TimeDisplayOffset=0.5, ... YLimits=10^-3*[-5 5]);
Get the audio input and generate the RBDS waveform. FM-modulate the stereo audio with the RBDS waveform, add noise, and FM-demodulate the audio and RBDS waveforms. View the demodulated RBDS waveform in the time scope to show the differential Manchester encoded pulses.
for idx = 1:7 % Get current audio input input = afr(); % Generate RBDS info at the same configured rate rbdsWave = rbds(); % FM-modulate stereo audio with RBDS info yFM = fmMod( ... [input input], ... rbdsWave); % Add noise rcv = awgn(yFM, 40); % FM-demodulate the audio and RBDS waveforms [audioRcv, rbdsRcv] = fmDemod(rcv); scope(rbdsRcv); end release(scope)
Generate RBDS Waveform with RT+ Information
comm.RBDSWaveformGenerator System object™ with 20 groups per frame and 10 samples per symbol. Add the Radio Text plus (RT+) information, such as artist name and song title to the waveform. Indicate the start and end of the RT+ substrings by using the
rbds = comm.RBDSWaveformGenerator( ... GroupsPerFrame=20, ... SamplesPerSymbol=10, ... SendRadioTextPlus=true); rbds.RadioText = 'MyArtist - MySongTitle'; rbds.RadioTextType1 = 'Item.Artist'; rbds.RadioTextType2 = 'Item.Title'; rbds.RadioTextIndices = [1 8; 12 22]; for idx = 1:10 rbds(); end
Register Custom Encoding Implementation
Register a custom encoding implementation for an open data application (ODA) by using the
registerODA method of the
comm.RBDSWaveformGenerator System object™. Set the ODA ID to
'CD46', which is the ID for the traffic message channel. The allocated group type is 8A.
rbds = comm.RBDSWaveformGenerator(); odaID = 'CD46'; allocatedGroupType = '8A';
This example uses the following templates as a starting point for custom encoding implementation.
mainProcessingFcn = @CustomODAEncodingMain; fcn3A = @CustomODAEncoding3A; registerODA(rbds,odaID,allocatedGroupType,mainProcessingFcn,fcn3A); s = info(rbds); s.ODAMap
ans=2×1 struct array with fields: ID GroupType FunctionMain Function3A
Configure RBDS Waveform with Date and Time Information
Generate an RBDS waveform with date and time information, the program type, and alternative frequencies. The
comm.RBDSWaveformGenerator object uses type 4A groups for date and time information, type 10A groups for the program type information, and type 0A groups for alternative frequencies. View the waveform in a spectrum analyzer.
rbds = comm.RBDSWaveformGenerator( ... GroupsPerFrame=1000); sa = spectrumAnalyzer( ... SampleRate=1187.5*rbds.SamplesPerSymbol, ... YLimits=[-140 20]); rbds.SendDateTime = true; % Send type 4A groups rbds.ProgramType = "Sports"; rbds.ProgramTypeName = "Football"; % Send type 10A groups rbds.AlternativeFrequencies = ... % Send info in type 0A groups [99.1 102.5]; wave = rbds(); sa(wave) release(sa)
System object generates waveforms according to the RDS/RBDS standard . The
RDS/RBDS standard consists of three layers: physical layer, data link layer, and session
and application layer.
The physical layer (first layer) converts the data link bits to an analog waveform by conducting differential encoding and biphase symbol encoding (Manchester encoding) and pulse-shaping filtering.
Data Link Layer
The data link layer (second layer) performs (26, 16) cyclic encoding shortened from (341, 331) encoding . The second layer is responsible for error detection, error correction, and the establishment of group-level synchronization. Each group of RDS/RBDS frames contains four blocks of 26 bits (that is 104 bits) each. Each block contains an information word and a check word. Each information word contains 16 bits, and each check word contains 10 bits.
This figure shows the baseband coding structure for the RDS/RBDS waveform. For more details, see .
For each block, a unique offset word is modulo-2 added to the checkword bits. The added offset word provides a group and block synchronization system in the receiver (decoder). Because the addition of the offset is reversible in the decoder, the normal additive error-detecting and error-correcting properties of the basic code are unaffected.
Session and Application Layer
The first block in every group contains a program identification (PI) code. The first four bits of the second block of every group are allocated to a four-bit code. This code specifies the application of the group. Groups are referred to as types 0–15 according to the binary weighting A3 = 8, A2 = 4, A1 = 2, A0 = 1. The fifth bit of the second block, B0, defines the version of the application. If B0 = 0, the version of the group is A. The PI code in this version is inserted into block 1 only. Example group types include 0A, 1A, 2A, 3A, and 4A.
The program type code and traffic program identification occupy fixed locations in block 2 of every group.
|Group Type||Group Type Code/Version||Description|
|0A||0||0||0||0||0||Basic station information. Short, usually scrolling text, up to 8 characters long. Transmitted 2 characters at a time.|
|2A||0||0||1||0||0||Radio test. Long text, up to 64 characters long. Transmitted 4 characters at a time.|
|3A||0||0||1||1||0||Specification of used open data applications and their allocation group type. Example: RT+ information is sent using 11A group.|
|4A||0||1||0||0||0||Date and time. Optional group that can be transmitted once in every 685 groups (once a minute).|
|10A||1||0||1||0||0||Program type name. Example Football for |
|11A||1||0||1||1||0||Open data application. Example: RT+|
 National Radio Systems Committee. United States RBDS Standard: Specification of the radio broadcast data system (RBDS). Electronic Industries Association and National Association of Broadcasters. April 9, 1998.
 Westdeutscher Rundfunk WDR, Nokia, and Institut für Rundfunktechnik IRT. RadioText Plus (RT+) Specification, Version 2.1. 2006.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
See System Objects in MATLAB Code Generation (MATLAB Coder).
In addition, the following limitations apply when you generate code that contains this System object or when you use this object in a MATLAB Function (Simulink) block.
Introduced in R2017a