Frequency-shift and combine signals
System object™ interpolates, shifts input signals to the specified frequency bands, and then
combines them into a single signal. For more information, see the Algorithms section.
To frequency-shift and combine signals:
comm.MultibandCombinerobject 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?
creates a multiband combiner System object to frequency-shift and combine input signals.
multibandcombiner = comm.MultibandCombiner
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.
InputSampleRate — Input signal sample rate
1e6 (default) | positive scalar
Input signal sample rate in Hz, specified as a positive scalar.
FrequencyOffsets — Frequency offsets
[0 1e6] (default) | scalar | 1-by-Nchan vector
Frequency offsets in Hz, specified as one of these options.
Scalar — Each channel of the input signal is frequency-shifted by this scalar value.
1-by- Nchan vector — Each channel of the input signal is frequency-shifted by the corresponding value in this vector. Nchan is the number of channels in the input signal
OutputSampleRateSource — Source of output sample rate
'Auto' (default) |
Source of the output sample rate, specified as one of these values.
'Auto'— The object interpolates the input signals to ensure that the resulting sample rate of the signals is sufficient to avoid distorting the frequency content of the original signals after they are frequency-shifted to produce the output signal.
'Property'— Specify the output sample rate by using the
OutputSampleRate — Output signal sample rate
3e6 (default) | positive scalar
Output signal sample rate in Hz, specified as a positive scalar.
To avoid distortion, specify this value to be greater than or equal to the
automatically computed output sample rate. To determine the automatically computed
output sample rate, first run the object with the
OutputSampleRateSource property set to
To enable this property, set the
OutputSampleRateSource property to
x — Input signals
Input signals, specified as an Nsamp-by-Nchan matrix. Nsamp is the number of input samples per channel, and Nchan is the number of channels.
Complex Number Support: Yes
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
Combine QPSK and GMSK Signals
Combine two 60 KHz frequency bands that are adjacent to each other.
Set simulation parameters.
M = 4; % QPSK modulation N = 2000; % Frame length Fs1 = 60e3; % Input sample rate
Generate QPSK and GMSK signals.
data = randi([0,M-1],N,1); modSig = pskmod(data,M,pi/4,"gray"); qpskTxFilter = comm.RaisedCosineTransmitFilter( ... OutputSamplesPerSymbol=2); qpsksig = qpskTxFilter(modSig); data = randi([0 1],N,1); gmskMod = comm.GMSKModulator( ... BitInput=true, ... SamplesPerSymbol=2); gmsksig = gmskMod(data);
Create a multiband combiner and two spectrum analyzer System objects. Use the
info object function to determine the output sample rate for the combined signal. Use this output sample rate when configuring the spectrum analyzer objects.
mbc = comm.MultibandCombiner( ... InputSampleRate=Fs1, ... FrequencyOffsets=[-30e3 30e3], ... OutputSampleRateSource="Auto"); mbcInfo = info(mbc); Fs2 = mbcInfo.OutputSampleRate
Fs2 = 120000
sa = spectrumAnalyzer( ... SampleRate=Fs2, ... ShowLegend=true, ... ChannelNames=["qpsk","gmsk"]); sacombined = spectrumAnalyzer( ... SampleRate=Fs2, ... ShowLegend=true, ... ChannelNames="combined");
Use the multiband combiner object to interpolate, frequency-shift, and combine the two signals.
combinedsig = mbc([qpsksig,gmsksig]);
Use the spectrum analyzer objects to view the individual signals at 60 kHz and the combined signal at 120 kHz.
This figure shows how the multiband combiner algorithm processes input signal data.
When the output sample rate is greater than the input sample rate, the input signal is
interpolated to avoid distortion in the frequency-shifted signal. Each column of the input
signal is frequency-shifted by the corresponding value specified in the
property. The frequency-shifted signals are then added together into a single channel output
signal. Each channel in the input must have the same number of samples.
'Auto' automatically configures
the algorithm to compute the output sample rate as RO = RI × L, where:
Multiband Combining Delay
Multiband combining introduces a delay computed as delay =
length(num)/2). The numerator coefficients, num, are computed as num =
1), where L is the interpolation
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).
Introduced in R2021b