Main Content

comm.FMBroadcastModulator

Modulate broadcast FM audio signal

Description

Thecomm.FMBroadcastModulatorSystem object™ pre-emphasizes an audio signal and modulates it onto a baseband FM signal. For more information, see theAlgorithmssection.

To modulate a broadcast FM audio signal:

  1. Create thecomm.FMBroadcastModulatorobject and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, seeWhat Are System Objects?

Creation

Description

fmbmodulator= comm.FMBroadcastModulatorcreates a FM broadcast modulator System object.

example

fmbmodulator= comm.FMBroadcastModulator(Name,Value)sets properties using one or more name-value arguments. For example,'SampleRate',400e3specifies a sample rate of 400 kHz.

fmbmodulator= comm.FMBroadcastModulator(fmbdemodulator)sets properties based on configuration of the inputcomm.FMBroadcastDemodulatorSystem object,fmbdemodulator.

Properties

expand all

Unless otherwise indicated, properties arenontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and thereleasefunction unlocks them.

If a property istunable, you can change its value at any time.

For more information on changing property values, seeSystem Design in MATLAB Using System Objects.

Sample rate of the output of the modulator in Hz, specified as a positive scalar. The sample rate must be greater than twice the frequency deviation (that is,SampleRate> 2×FrequencyDeviation).

Data Types:double

Peak deviation of the output signal frequency in Hz, specified a positive scalar. The frequency deviation must be less than half the sample rate (that is,FrequencyDeviation<SampleRate/2).

The system bandwidthBT= 2×(FrequencyDeviation+BM), whereBMis the message bandwidth in Hz. For more information, see theAlgorithmssection.

FM broadcast standards specify a value of 75 kHz in the United States and 50 kHz in Europe.

Data Types:double

Pre-emphasis highpass filter time constant in seconds, specified as a positive scalar. FM broadcast standards specify a value of 75 μs in the United States and 50 μs in Europe.

Data Types:double

Sample rate of the input audio signal in Hz, specified as a positive scalar.

Data Types:double

Option to enable stereo modulation, specified as a logical0(false) or1(true).

  • 将此属性设置为falsefor monophonic audio signals.

  • 将此属性设置为truefor stereophonic audio signals. The object modulates the audio input (LR在38 kHz乐队除了来modulating the audio signal in the baseband (L+R).

For more information, see theAlgorithmssection.

Data Types:logical

Option to enable RDS (or RBDS) waveform modulation, specified as a logical0(false) or1(true). If you set this property totrue, the object accepts the baseband RDS (or RBDS) waveform as its second input and modulates the RDS (or RBDS) signal at 57 kHz. For more information, see theAlgorithmssection.

Data Types:logical

Oversampling factor of the RDS (or RBDS) input signal, specified as a positive integer. The sample rate of RDS (or RBDS) broadcast data is 1187.5 Hz. The RDS (or RBDS) signal sample rate isRBDSSamplesPerSymbol×1187.5Hz.

Dependencies

To enable this property, set theRBDSproperty totrue.

Data Types:double

Usage

Description

example

outsig= fmbmodulator(audiosig)pre-emphasizes the input audio signal and modulates the pre-emphasized signal onto an FM-modulated baseband audio signal.

example

outsig= fmbmodulator(audiosig,rbdssig)also modulates a baseband RBDS signal at 57 kHz. To enable this syntax, set theRBDSproperty totrue.

Input Arguments

expand all

Audio signal, specified as one of these options.

  • N-element column vector for mono signals — If you set theStereoproperty tofalse, you must specify the audio signal as a column vector.Nis the number of samples in the audio signal.

  • M-by-Nmatrix for stereo signals —Mis the number of stereo channels.Nis the number of samples in the audio signal per channel.

For information about signal length restrictions, seeLimitations.

If you set theStereoproperty totrue, the audio signal must have at least two channels and the System object performs stereo encoding after pre-emphasis filtering.

Data Types:double|single
Complex Number Support:Yes

RBDS signal, specified as a column vector. For information about RDBS signal length restrictions, seeLimitations.

To generate the RBDS signal, use thecomm.RBDSWaveformGeneratorSystem object.

Data Types:double|single
Complex Number Support:Yes

Output Arguments

expand all

FM-modulated baseband signal, returned as a column vector of complex values of the same data type as the input signal,audiosig. The length of this output islength(audiosig) × (SampleRate/AudioSampleRate).

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object namedobj, use this syntax:

release(obj)

expand all

info Information about FM broadcast modulator or demodulator
step RunSystem objectalgorithm
release Release resources and allow changes toSystem objectproperty values and input characteristics
reset Reset internal states ofSystem object

Examples

collapse all

Play back an audio file after applying FM broadcast modulation and demodulation using System objects to process the data in streaming mode.

Load the audio fileguitartune.wavby using an audio file reader System object™ with the samples per frame set to 4410.

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

Create FM broadcast modulator and demodulator objects. Set the sample rate of the output audio signal to match the sample rate of the input audio signal. Set the sample rate of the demodulator to match the specified sample rate of the modulator. Enable audio playback for the broadcast demodulator.

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

Read the audio data in frames of length 4410, apply FM broadcast modulation, demodulate the FM signal, and play back the demodulated signal (demodData).

while~isDone(audiofilereader) audioData = audiofilereader(); modData = fmbMod(audioData); demodData = fmbDemod(modData);% Demodulate and play signalend

调制和解调的音频信号M broadcast modulator and demodulator System objects. Plot the frequency responses to compare the input and demodulated audio signals.

Load the audio fileguitartune.wavby using an audio file reader System object™. Set the samples per frame to 44,100, which is large enough to include the entire audio file.

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

Create spectrum analyzer System 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 sample rate of the output audio signal to match the sample rate of the input audio signal. Configure the demodulator to match the specified modulator.

fmbMod = comm.FMBroadcastModulator(...'AudioSampleRate',audiofilereader.SampleRate,...'SampleRate',200e3); fmbDemod = comm.FMBroadcastDemodulator(fmbMod)
fmbDemod = comm.FMBroadcastDemodulator with properties: SampleRate: 200000 FrequencyDeviation: 75000 FilterTimeConstant: 7.5000e-05 AudioSampleRate: 44100 PlaySound: false Stereo: false RBDS: false

The length of the sequence input to the object must be an integer multiple of the decimation factor. To determine the audio decimation factor of the filter in the modulator and demodulator, use theinfoobject function.

info(fmbMod)
ans =struct with fields:AudioDecimationFactor: 441 AudioInterpolationFactor: 2000 RBDSDecimationFactor: 19 RBDSInterpolationFactor: 320
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 44,100. The audio decimation factor of the demodulator is an integer multiple of the 200,000 samples data sequence length of the modulator output.

Modulate the audio signal and plot the spectrum of the modulated signal.

y = fmbMod(x); SAfm(y)

Figure Spectrum Analyzer contains an axes object and other objects of type uiflowcontainer, uimenu, uitoolbar. The axes object with title FM Broadcast Signal contains an object of type line. This object represents Channel 1.

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

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

Figure Spectrum Analyzer contains an axes object and other objects of type uiflowcontainer, uimenu, uitoolbar. The axes object with title Audio Signal contains 2 objects of type line. These objects represent Input signal, Demodulated signal.

Generate an RBDS waveform, FM broadcast modulate the RBDS waveform with an audio signal, and FM broadcast demodulate the FM signal.

参数指定一个19 gr的rbd波形oups 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;

Load the audio fileguitartune.wavby using an audio file reader System object™ while setting the samples per frame. Create RBDS waveform generator, FM broadcast modulator, FM broadcast demodulator, and time scope System objects. Configure the modulator and demodulator objects to process a stereo audio file and an RBDS waveform.

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,...'YLimits',10^-2*[-1 1]);

Read the audio signal. Generate RBDS information at the same configured rate as audio. FM broadcast modulate the stereo audio signal with RBDS information. Add additive white Gaussian noise. FM-demodulate the audio signal and RBDS waveforms. View the waveforms in a time scope.

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

Limitations

  • If you set theRBDStrue, both the audio and RDS (or RBDS) inputs must satisfy this equation.

    a u d i o L e n g t h a u d i o S a m p l e R a t e = R B D S L e n g t h R B D S S a m p l e R a t e

  • The RDS (or RBDS) signal sample rate isRBDSSamplesPerSymbol×1187.5Hz.

  • The length of the input RDS (or RBDS) signal,rbdssig, must be an integer multiple of theRBDSDecimationFactorproperty. The input length of the audio signal,audiosig, must be an integer multiple of theAudioDecimationFactorproperty. For more information onRBDSDecimationFactorandAudioDecimationFactor, see theinfoobject function.

Algorithms

expand all

The FM Broadcast modulator includes the functionality of the baseband FM modulator, pre-emphasis filtering, and the ability to transmit stereophonic signals. For more information about the algorithms used for basic FM modulation and demodulation, see thecomm.FMModulatorSystem object.

References

[1]Hatai, I., and I. Chakrabarti. “A New High-Performance Digital FM Modulator and Demodulator for Software-Defined Radio and Its FPGA Implementation.”International Journal of Reconfigurable Computing(December 25, 2011): 1-10. https://doi.org/10.1155/2011/342532.

[2]Taub, H., and D. Schilling.Principles of Communication Systems. McGraw-Hill Series in Electrical Engineering. New York: McGraw-Hill, 1971, pp. 142–155.

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

Extended Capabilities

Introduced in R2015a