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.FMBroadcastModulator System object

Modulate broadcast FM signal

Description

The comm.FMBroadcastModulator System object™ pre-emphasizes an audio signal and modulates it onto a baseband FM signal. If the Stereo property is set to true, the object modulates the audio input (LR) in the 38 kHz band, in addition to modulating it in the baseband (L+R). If the RBDS property is set to true, the object modulates a baseband RBDS signal at 57 kHz. For more details, see Algorithms.

To FM modulate an audio signal:

  1. Define and set up the comm.FMBroadcastModulator object. See Construction.

  2. Call step to apply broadcast FM modulation to an audio signal according to the properties of comm.FMBroadcastModulator.

Note

Starting in R2016b, 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

fmbMod = comm.FMBroadcastModulator creates a modulator System object, fmbMod, that frequency modulates an input signal.

fmbMod = comm.FMBroadcastModulator(demod) creates a broadcast FM modulator object whose properties are determined by the corresponding broadcast FM demodulator object, demod.

fmbMod = comm.FMBroadcastModulator(Name,Value) creates a broadcast FM modulator object with each specified property Name set to the specified Value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN).

Properties

SampleRate

Output signal sample rate (Hz)

Specify the sample rate of the output signal in Hz as a positive real scalar. The default value is 240e3. This property is nontunable.

FrequencyDeviation

Peak deviation of the output signal frequency (Hz)

Specify the frequency deviation of the FM modulator in Hz as a positive real scalar. The default value is 75e3. The system bandwidth is equal to twice the sum of the frequency deviation and the message bandwidth. FM broadcast standards specify a value of 75 kHz in the United States and 50 kHz in Europe. This property is nontunable.

FilterTimeConstant

Filter time constant (s)

Specify the pre-emphasis highpass filter time constant as a positive real scalar. FM broadcast standards specify a value of 75 μs in the United States and 50 μs in Europe. The default value is 7.5e-05. The property is nontunable.

AudioSampleRate

Sample rate of the input audio signal (Hz)

Specify the audio sample rate as a positive real scalar. The default value is 48000. This property is nontunable.

Stereo

Flag to set stereo operations

Set this property to true if the input is a stereophonic audio signal. Set to false if the input signal is monophonic. The default is false. This property is nontunable.

RBDS

Flag to modulate RBDS waveform

If RBDS is set to true, the step method accepts the baseband RBDS waveform as its second input and the object modulates the signal at 57 kHz. The default value is false. This property is nontunable.

RBDSSamplesPerSymbol

Oversampling factor of RBDS input

Specify the number of samples per RBDS symbol as a positive integer. The RBDS sample rate is given by RBDSSamplesPerSymbol × 1187.5 Hz. According to the RBDS standard, the sample rate of each bit is 1187.5 Hz.

This property applies only when you set RBDS to true.

The default is 10.

Methods

infoFilter information about FM broadcast modulator
resetReset states of the FM broadcast modulator object
stepApply FM broadcast modulation
Common to All System Objects
clone

Create System object with same property values

getNumInputs

Expected number of inputs to a System object

getNumOutputs

Expected number of outputs of a System object

isLocked

Check locked states of a System object (logical)

release

Allow System object property value changes

Examples

expand all

Modulate and demodulate an audio signal with the FM broadcast modulator and demodulator objects. Plot the frequency responses of the input and demodulated signals.

Create an audio file reader System object™ and read the file guitartune.wav. Set the SamplesPerFrame property to include the entire file.

audio = dsp.AudioFileReader('guitartune.wav','SamplesPerFrame',44100);
x = audio();

Create spectrum analyzer objects to plot the spectra of the modulated and demodulated signals.

SAaudio = dsp.SpectrumAnalyzer('SampleRate',44100,'ShowLegend',true, ...
    'Title','Audio Signal', ...
    'ChannelNames',{'Input Signal' 'Demodulated Signal'});
SAfm = dsp.SpectrumAnalyzer('SampleRate',152e3, ...
    'Title','FM Broadcast Signal');

Create FM broadcast modulator and demodulator objects. Set the AudioSampleRate property to match the sample rate of the input signal. Set the SampleRate property of the demodulator to match the specified sample rate of the modulator.

fmbMod = comm.FMBroadcastModulator('AudioSampleRate',audio.SampleRate, ...
    'SampleRate',200e3);
fmbDemod = comm.FMBroadcastDemodulator( ...
    'AudioSampleRate',audio.SampleRate,'SampleRate',200e3);

Use the info method to determine the audio decimation factor of the filter in the modulator object. The length of the sequence input to the object must be an integer multiple of the object's decimation factor.

info(fmbMod)
ans = 

  struct with fields:

       AudioDecimationFactor: 441
    AudioInterpolationFactor: 2000
        RBDSDecimationFactor: 19
     RBDSInterpolationFactor: 320

Use the info method to determine the audio decimation factor of the filter in the demodulator object.

info(fmbDemod)
ans = 

  struct with fields:

       AudioDecimationFactor: 50
    AudioInterpolationFactor: 57
        RBDSDecimationFactor: 50
     RBDSInterpolationFactor: 57

The audio decimation factor of the modulator is a multiple of the audio frame length of 44100. The audio decimation factor of the demodulator is an integer multiple of the 200000 samples data sequence length of the modulator output.

Modulate the audio signal and plot its spectrum.

y = fmbMod(x);
SAfm(y)

Demodulate y and plot the resultant spectrum. Compare the input signal spectrum with the demodulated signal spectrum. The spectra are similar except that demodulated signal has smaller high frequency components.

z = fmbDemod(y);
SAaudio([x z])

Modulate and demodulate a streaming audio signal with the FM broadcast modulator and demodulator objects. Play the audio signal using a default audio device.

Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,x).

Create an audio file reader System object™ and read the file guitartune.wav.

audio = dsp.AudioFileReader('guitartune.wav','SamplesPerFrame',4410);

Create FM broadcast modulator and demodulator objects. Set the AudioSampleRate property to match the sample rate of the input signal. Set the SampleRate property of the demodulator to match the specified sample rate of the modulator. Set the PlaySound property of the demodulator to true to enable audio playback.

fmbMod = comm.FMBroadcastModulator('AudioSampleRate',audio.SampleRate, ...
    'SampleRate',240e3);
fmbDemod = comm.FMBroadcastDemodulator( ...
    'AudioSampleRate',audio.SampleRate, ...
    'SampleRate',240e3,'PlaySound',true);

Read the audio data in frames of length 4410, apply FM broadcast modulation, demodulate the FM signal and playback the audio input.

while ~isDone(audio)
    audioData = audio();
    modData = fmbMod(audioData);
    demodData = fmbDemod(modData);
end

Generate a basic RBDS waveform, FM modulate it with an audio signal, and then demodulate it.

Note: This example runs only in R2017a or later.

Create a RBDS waveform with 19 groups per frame and 10 samples per symbol. The sample rate of the RBDS waveform is given by 1187.5 x 10. Set the audio sample rate to 1187.5 x 40.

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 current audio input. Generate RBDS information at the same configured rate as audio. FM modulate the stereo audio with RBDS information. Add additive white Gaussian noise. FM demodulate the audio and RBDS waveforms. View the waveforms in a time scope.

for idx = 1:7
    input = afr();
    rbdsWave = rbds();
    yFM = fmMod([input input], rbdsWave);
    rcv = awgn(yFM, 40);
    [audioRcv, rbdsRcv] = fmDemod(rcv);
    scope(rbdsRcv);
end

Algorithms

The FM Broadcast modulator includes the functionality of the baseband FM modulator, pre-emphasis filtering, and the ability to transmit stereophonic signals. The algorithms which govern basic FM modulation and demodulation are covered in comm.FMModulator.

Filtering

FM amplifies high-frequency noise and degrades the overall signal-to-noise ratio. To compensate, FM broadcasters insert a pre-emphasis filter prior to FM modulation to amplify the high-frequency content. The FM receiver has a reciprocal de-emphasis filter after the FM demodulator to attenuate high-frequency noise and restore a flat signal spectrum.

The pre-emphasis filter has a highpass characteristic transfer function given by

Hp(f)=1+j2πfτs,

where τs is the filter time constant. The time constant is 50 μs in Europe and 75 μs in the United States. Similarly, the transfer function for the lowpass de-emphasis filter is given by

Hd(f)=11+j2πfτs.

Irrespective of the audio sampling rate, the signal is converted to a 152 kHz output sampling rate. For an audio sample rate of 44.1 kHz, the pre-emphasis filter has the following response.

Stereo and RBDS FM – Multiplex Signal

The FM broadcast modulator supports stereophonic and monophonic operations. To support stereo transmission, the left (L) and right (R) channel information (L+R) is assigned to the mono portion of the spectrum (0 to 15 kHz). The (L-R) information is amplitude modulated onto the 23 to 53 kHz region of the baseband spectrum using a 38 kHz subcarrier signal. A pilot tone at 19 kHz in the multiplexed signal enables the FM receiver to coherently demodulate the stereo and RBDS signals. Here is the spectrum of the multiplex baseband signal.

Here is the block diagram of the FM broadcast modulator, which is used to generate the multiplex baseband signal. L(t) and R(t) denote the time-domain waveforms from the left and right channels. RBDS(t) denotes the time-domain waveform of the RBDS signal.

The multiplex message signal, m(t) is given by

m(t)=C0[L(t)+R(t)]+C1cos(2π×19kHz×t)+C0[L(t)R(t)]cos(2π×38kHz×t)+C2RBDS(t)cos(2π×57kHz×t),

where C0, C1, and C2 are gains. To generate the appropriate modulation level, these gains scale the amplitudes of the (L(t)±R(t)) signals, the 19 kHz pilot tone, and the RBDS subcarrier, respectively.

Limitations

  • If RBDS is true, both the audio and RBDS inputs must satisfy the following equation:

    audioLengthaudioSampleRate=RBDSLengthRBDSSampleRate

  • The input length of the audio signal must be an integer multiple of the AudioDecimationFactor property. The input length of the RBDS signal must be an integer multiple of the RBDSDecimationFactor property. For more information on these two properties, see the info method.

References

[1] Chakrabarti, I. H., and Hatai, I. “A New High-Performance Digital FM Modulator and Demodulator for Software-Defined Radio and Its FPGA Implementation.” International Journal of Reconfigurable Computing. Vol. 2011, No. 10.1155/2011, 2011, p. 10.

[2] Taub, Herbert, and Donald L. Schilling. Principles of Communication Systems. New York: McGraw-Hill, 1971, pp. 142–155.

[3] Der, Lawrence. “Frequency Modulation (FM) Tutorial”. FM Tutorial. Silicon Laboratories Inc., pp. 4–8.

Extended Capabilities

Introduced in R2015a

Was this topic helpful?