Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

comm.RBDSWaveformGenerator System object

Generate RBDS waveform

Description

The comm.RBDSWaveformGenerator System object™ generates configurable standard-compliant baseband RBDS waveforms in MATLAB®. RBDS waveforms supplement FM radio stations with additional textual information, such as song title, artist name, and station description. The RBDS signal lies in the 57-kHz band of the baseband FM radio signal.

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 RBDS waveforms:

  1. Create a comm.RBDSWaveformGenerator object and set the properties of the object.

  2. Call step to generate the waveform.

Note

Alternatively, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Construction

rbdsgen = comm.RBDSWaveformGenerator creates an RBDS waveform generator object, rbdsgen, using the default properties.

rbdsgen = comm.RBDSWaveformGenerator(Name,Value) specifies additional properties using Name,Value pairs. Unspecified properties have default values.

Example:

rbdsgen = comm.RBDSWaveformGenerator('GroupsPerFrame',20,'SamplesPerSymbol',10,...
                                      'SendRadioTextPlus',true);

Properties

expand all

If a property is listed as tunable, then you can change its value even when the object is locked.

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.

Number of groups per output frame, specified as a scalar integer. Each group is 104 symbols (bits) long.

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.

Tunable: Yes

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.

Tunable: Yes

Program identification (PI) code, specified as a 16-bit row vector. In North America, the PI code conveys the call letters of the station. Example call letters include 'WABC' and 'KXYZ'.

To generate North American PI codes for a station's call letters, use the callLettersToPICode method.

Program type, specified as a character vector containing one of the 31 values allowed by the RBDS standard. For a list of program types that the RBDS standard allows in North America, see [1].

Tunable: Yes

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 generated.

Tunable: Yes

Option to advertise the date and time, specified as either false or true. When you set this property to true, one 4A group is periodically generated every 685 groups (once a minute).

Alternative frequencies, specified as a numeric 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.

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 RadioTextType1, RadioTextType2, and the two RT+ substrings indexed by RadioTextIndices are conveyed with the open-format type 11A group.

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 [2].

Tunable: Yes

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 [2].

Tunable: Yes

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.

Tunable: Yes

Methods

callLettersToPICodeConvert North-American call letters to binary PI code
registerODARegister a custom encoding implementation for an ODA
resetReset states of RBDS waveform generator object
stepGenerate RBDS waveform

Examples

expand all

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 = dsp.TimeScope('SampleRate',outRate,'YLimits',10^-2*[-1 1]);

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.

for idx = 1:7
    input = afr();                         % get current audio input
    rbdsWave = rbds();                     % generate RBDS info at the same configured rate
    yFM = fmMod([input input], rbdsWave);  % FM modulate stereo audio with RBDS info
    rcv = awgn(yFM, 40);                   % add noise
    [audioRcv, rbdsRcv] = fmDemod(rcv);    % FM demodulate the audio and RBDS waveforms
    scope(rbdsRcv);
end

Create a 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 RadioTextIndices property.

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.step();
end

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 = 

  2x1 struct array with fields:

    ID
    GroupType
    FunctionMain
    Function3A

Generate 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);
scope = dsp.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 = [99.1 102.5]; % info sent in type 0A groups
wave = rbds.step();
scope(wave)

Algorithms

expand all

comm.RBDSWaveformGenerator generates waveforms according to the RBDS standard [1]. The RBDS standard consists of three layers: physical layer, data-link layer, and session and application layer.

References

[1] 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.

[2] Westdeutscher Rundfunk WDR, Nokia, and Institut für Rundfunktechnik IRT. RadioText Plus (RT+) Specification, Version 2.1. 2006.

Extended Capabilities

Introduced in R2017a

Was this topic helpful?