Information about FM broadcast modulator or demodulator
The modulator input sequence length for the audio input must be a multiple of
The modulator input sequence length for the RDS/RBDS input must be a multiple of
true, the demodulator input sequence length must be a multiple of
false, the demodulator input sequence length must be a multiple of
Modulate and Demodulate Streaming Audio Signals Using FM Broadcast Method
Modulate and demodulate an audio signal with the FM broadcast modulator and demodulator System objects. Plot the frequency responses to compare the input and demodulated audio signals.
Load the audio file
guitartune.wav by 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.
saFM = spectrumAnalyzer( ... SampleRate=152e3, ... Title="FM Broadcast Signal"); saAudio = spectrumAnalyzer( ... SampleRate=44100, ... ShowLegend=true, ... Title="Audio Signal", ... ChannelNames=["Input signal" "Demodulated 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 the
info object function.
ans = struct with fields: AudioDecimationFactor: 441 AudioInterpolationFactor: 2000 RBDSDecimationFactor: 19 RBDSInterpolationFactor: 320
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)
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])
fmbInfo — FM broadcast object information
FM broadcast object information, returned as a structure containing these fields.
Decimation factor of the audio modulator or demodulator filter.
Interpolation factor of the audio modulator or demodulator filter.
Decimation factor of the RDS/RBDS modulator or demodulator filter.
Interpolation factor of the RDS/RBDS modulator or demodulator filter.
Introduced in R2015a