# dsp.ChannelSynthesizer

Polyphase FFT synthesis filter bank

## Description

The `dsp.ChannelSynthesizer`

System object™ merges multiple narrowband signals into a broadband signal by using an FFT based
synthesis filter bank. The filter bank uses a prototype lowpass filter and is implemented
using a polyphase structure. You can specify the filter coefficients directly or through
design parameters.

To merge multiple narrowband signals into a broadband signal:

Create the

`dsp.ChannelSynthesizer`

object 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?

## Creation

### Description

creates
a synthesizer object, using the default properties.`synthesizer`

= dsp.ChannelSynthesizer

`synthesizer = dsp.ChannelSynthesizer(`

specifies additional properties using one ore more `Name=Value`

)`Name-Value`

arguments. For example, you can set `NumTapsPerBand`

to 20 and
`StopbandAttenuation`

to 140.

**Example: **```
synthesizer =
dsp.ChannelSynthesizer(NumTapsPerBand=20,StopbandAttenuation=140)
```

## Properties

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.

`InterpolationFactor`

— Interpolation factor

`'Number of frequency bands'`

(default) | positive integer

*Since R2024a*

Interpolation factor *L*, specified as one of these:

`'Number of frequency bands'`

–– When you change the number of frequency bands, the interpolation factor changes automatically.Positive integer greater than or equal to the number of frequency bands

*M*.

The number of frequency bands equals the number of channels in the input signal. If
the interpolation factor *L* equals the number of frequency bands
*M*, then the *L*/*M* ratio equals
1, and the synthesizer is known as the critically sampled channel synthesizer.

If *L* is greater than *M*, then the
*L*/*M* ratio must be an integer.

**Data Types: **`single`

| `double`

| `int8`

| `int16`

| `int32`

| `int64`

| `uint8`

| `uint16`

| `uint32`

| `uint64`

`Specification`

— Filter design parameters or coefficients

```
"Number of taps per band and stopband
attenuation"
```

(default) | `"Coefficients"`

Filter design parameters or filter coefficients, specified as one of these options:

`"Number of taps per band and stopband attenuation"`

— Specify the filter design parameters through the`NumTapsPerBand`

and`StopbandAttenuation`

properties.`"Coefficients"`

— Specify the filter coefficients directly using`LowpassCoefficients`

.

`NumTapsPerBand`

— Number of filter coefficients per frequency band

`12`

(default) | positive integer

Number of filter coefficients each polyphase branch uses, specified as a positive
integer. The number of polyphase branches matches the number of frequency bands. The
total number of filter coefficients for the prototype lowpass filter is given by product
of the number of frequency bands and `NumTapsPerBand`

. For a given
stopband attenuation, increasing the number of taps per band narrows the transition
width of the filter. As a result, there is more usable bandwidth for each frequency band
at the expense of increased computation.

#### Dependencies

To enable this property, set `Specification`

to
`"Number of taps per band and stopband attenuation"`

.

**Data Types: **`single`

| `double`

| `int8`

| `int16`

| `int32`

| `int64`

| `uint8`

| `uint16`

| `uint32`

| `uint64`

`StopbandAttenuation`

— Stopband attenuation

`80`

(default) | positive real scalar

Stopband attenuation of the lowpass filter, specified as a positive real scalar in dB. This value controls the maximum amount of aliasing from one frequency band to the next. Larger is the stopband attenuation, smaller is the passband ripple.

#### Dependencies

To enable this property, set `Specification`

to
`"Number of taps per band and stopband attenuation"`

.

**Data Types: **`single`

| `double`

`LowpassCoefficients`

— Coefficients of the prototype lowpass filter

`[1×49 double]`

(default) | row vector

Coefficients of the prototype lowpass filter, specified as a row vector. The default
vector of coefficients is obtained using
`rcosdesign(0.25,6,8,"sqrt")`

. There must be at least one
coefficient per frequency band. If the length of the lowpass filter is less than the
number of frequency bands, the object zero-pads the coefficients.

If you specify complex coefficients, the object designs a prototype filter that is
centered at a nonzero frequency, also known as a bandpass filter. The modulated versions
of the prototype bandpass filter appear with respect to the prototype filter and are
wrapped around the frequency range [−*F*_{s}
*F*_{s}].

**Tunable: **Yes

#### Dependencies

To enable this property, set `Specification`

to
`"Coefficients"`

.

**Data Types: **`single`

| `double`

**Complex Number Support: **Yes

## Usage

### Description

### Input Arguments

`input`

— Narrowband signals

matrix | 3-D array

Narrowband signals, specified as a matrix or a 3-D array. Each narrowband signal
is stored as a column in the input signal. The number of columns in
`input`

corresponds to the number of frequency bands of the
filter bank. If `input`

is three-dimensional, each matrix
corresponds to a separate channel. If *M* is the number of frequency
bands, and `input`

is an
*Q*-by-*M* matrix, then the output signal,
`synthOut`

, has dimensions *Q×M*-by-1. If
`input`

has dimensions
*Q*-by-*M*-by-*N*, then
`synthOut`

has dimensions
*Q×M*-by-*N*.

This object accepts variable-size inputs, that is, once the object is locked, you can change the size of each input channel. The number of channels cannot change.

**Data Types: **`single`

| `double`

**Complex Number Support: **Yes

### Output Arguments

`synthOut`

— Merged broadband signal

matrix | 3-D array

Merged broadband signal, returned as a matrix or a 3-D array. If
*M* is the number of frequency bands, and
`input`

is an *Q*-by-*M*
matrix, then the output signal, `synthOut`

, has dimensions
*Q×M*-by-1. If `input`

has dimensions
*Q*-by-*M*-by-*N*, then
`synthOut`

has dimensions
*Q×M*-by-*N*.

**Data Types: **`single`

| `double`

**Complex Number Support: **Yes

## 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 named `obj`

, use
this syntax:

release(obj)

### Specific to dsp.ChannelSynthesizer

## Examples

### Channelize and Synthesize Sine Wave in MATLAB

Channelize and synthesize a sine wave signal with multiple frequencies using an *M* -channel filter bank.

The *M* -channel filter bank contains an analysis filter bank section and a synthesis filter bank section. The `dsp.Channelizer`

object implements the analysis filter bank section. The `dsp.ChannelSynthesizer`

object implements the synthesis filter bank section. These objects use an efficient polyphase structure to implement the filter bank. For more details, see **Polyphase Implementation** under **Algorithms** on the object reference pages.

**Initialization**

Initialize the `dsp.Channelizer`

and `dsp.ChannelSynthesizer`

System objects. Each object is set up with 8 frequency bands, 8 polyphase branches in each filter, 12 coefficients per polyphase branch, and a stopband attenuation of 140 dB. Use a sine wave with multiple frequencies as the input signal. View the input spectrum and the output spectrum using a spectrum analyzer.

offsets = [-40,-30,-20,10,15,25,35,-15]; sinewave = dsp.SineWave(ComplexOutput=true,Frequency=offsets+(-375:125:500),... SamplesPerFrame=800); channelizer = dsp.Channelizer(StopbandAttenuation=140); synthesizer = dsp.ChannelSynthesizer(StopbandAttenuation=140); scope = spectrumAnalyzer(ShowLegend=true,... SampleRate=sinewave.SampleRate,... ChannelNames=["Input","Output"],... Title="Input and Output Spectra");

**Streaming**

Use the channelizer to split the broadband input signal into multiple narrow bands. Then pass the multiple narrowband signals into the synthesizer, which merges these signals to form the broadband signal. Compare the spectra of the input and output signals. The input and output spectra match very closely.

for i = 1:5000 x = sum(sinewave(),2); y = channelizer(x); v = synthesizer(y); scope(x,v) end

### Synthesize and Channelize Audio in MATLAB

*Since R2024a*

Synthesize a series of four stereo signals into a broadband signal by using the `dsp.ChannelSynthesizer`

object. At the receiving end, split this broadband signal back into the individual narrowband signals by using the `dsp.Channelizer`

object.

Increase the oversampling ratio of channel synthesizer to 4. Inspect the effect on the spectrum of the broadband signal.

**Initialization**

The audio signals are four stereo signals.

`FunkyDrums.mp3`

`SoftGuitar.ogg`

`RockDrums.mp3`

`RockGuitar.wav`

Each signal is of the size 1024-by-2 samples. The two columns (channels) represent the left channel and the right channel of the stereo signal. Read the signals using the `dsp.AudioFileReader`

object.

af1 = dsp.AudioFileReader(Filename='FunkyDrums.mp3',SamplesPerFrame=1024); af2 = dsp.AudioFileReader(Filename='SoftGuitar.ogg',SamplesPerFrame=1024); af3 = dsp.AudioFileReader(Filename='RockDrums.mp3',SamplesPerFrame=1024); af4 = dsp.AudioFileReader(Filename='RockGuitar.wav',SamplesPerFrame=1024);

The `stereo2complex`

function converts each signal into complex signals. The first column in the signal forms the real part of the complex signal, and the second column in the signal forms the imaginary part of the complex signal.

`type stereo2complex`

function y = stereo2complex(u) y = complex(u(:,1),u(:,2)); end

Specify the number of frequency bands *M* to 4, which is the same as the number of audio files. Specify the decimation factor *D* of the channelizer to 4 and the interpolation factor *I* of the channel synthesizer to 4.

M = 4; D = 4; I = 4;

Specify the number of taps per band to 48 and the stopband attenuation to 120 dB.

NTPB = 48; Astop = 120;

Initialize the `dsp.ChannelSynthesizer `

and `dsp.Channelizer`

objects with the above parameters. The *L*/*M* ratio in the channel synthesizer is 4/4, or 1, making it a critically sampled channel synthesizer. The *M*/*D* ratio in the channelizer is 4/4, or 1, making it a maximally decimated channelizer.

```
synthesizer = dsp.ChannelSynthesizer(NumTapsPerBand=48,...
StopbandAttenuation=120,InterpolationFactor=I)
```

synthesizer = dsp.ChannelSynthesizer with properties: InterpolationFactor: 4 Specification: 'Number of taps per band and stopband attenuation' NumTapsPerBand: 48 StopbandAttenuation: 120

```
channelizer = dsp.Channelizer(NumFrequencyBands=M,...
DecimationFactor=D,NumTapsPerBand=NTPB,StopbandAttenuation=Astop)
```

channelizer = dsp.Channelizer with properties: Main NumFrequencyBands: 4 DecimationFactor: 4 Specification: 'Number of taps per band and stopband attenuation' NumTapsPerBand: 48 StopbandAttenuation: 120 Use get to show all properties

Set up the `spectrumAnalyzer`

objects to visualize the input spectrum, multiplexed broadband spectrum, and the spectrum of the individual channelized audio files.

inputDataSpectrum = spectrumAnalyzer(SampleRate=44100,... Position=[4 880 800 500],Title="Input Data Spectrum"); muxedSpectrum = spectrumAnalyzer(SampleRate=I*44100,... Position=[810 880 800 500],Title="Muxed Spectrum With No Oversampling"); channelizedSpectrum = spectrumAnalyzer(SampleRate=I/D*44100,... Position=[1620 880 800 500],Title="Demuxed Spectrum");

**Streaming**

Stream in the four audio files. Convert the signals into complex signals and multiplex them to form a 1024-by-4 matrix *u*. The `dsp.ChannelSynthesizer`

object synthesizes these four signals into a single broadband signal *umuxed*. The `dsp.Channelizer`

object splits this broadband signal back into narrow subbands. Each column in the channelizer output represents a narrowband signal.

Visualize the spectrum of the input signal, multiplexed broadband signal, and the individual channelized audio files in the spectrum analyzer. You can see that the multiplexed broadband signal spectrum is critically sampled and that there is no separation between the narrow bands in the spectrum.

for idx = 1:100 u1 = af1(); u2 = af2(); u3 = af3(); u4 = af4(); u = [stereo2complex(u1) stereo2complex(u2) stereo2complex(u3) stereo2complex(u4)]; umuxed = synthesizer(u); uchannelized = channelizer(umuxed); inputDataSpectrum(u); muxedSpectrum(umuxed); channelizedSpectrum(uchannelized); end

**Increasing Oversampling Ratio of Channel Synthesizer**

To increase the separation between the individual bands in the multiplexed spectrum, increase the interpolation factor *L* to 16. This value increases the oversampling ratio *L*/*M* of the channel synthesizer to 16/4, or 4.

Rerun the simulation with the new *L*/*M* ratio. You can see that the there is more frequency separation now between the individual narrowbands in the multiplexed spectrum.

I = 16; synthesizer = dsp.ChannelSynthesizer(NumTapsPerBand=48,... StopbandAttenuation=120,InterpolationFactor=I); muxed4xSpectrum = spectrumAnalyzer(SampleRate=I*44100,... Position=[810 880 800 500],Title="Muxed 4x Oversampling Spectrum"); for idx = 1:100 u1 = af1(); u2 = af2(); u3 = af3(); u4 = af4(); u = [stereo2complex(u1) stereo2complex(u2) stereo2complex(u3) stereo2complex(u4)]; umuxed = synthesizer(u); uchannelized = channelizer(umuxed); inputDataSpectrum(u); muxed4xSpectrum(umuxed); channelizedSpectrum(uchannelized); end

## More About

### Synthesis Filter Bank

The synthesis filter bank consists of a set of parallel bandpass filters that merge multiple
input narrowband signals,
*y _{0}*[

*m*],

*y*[

_{1}*m*], … ,

*y*[

_{M-1}*m*] into a single broadband signal,

*v*[

*n*]. The input narrowband signals are in the baseband. Each narrowband signal is interpolated to a higher sampling rate by using the upsampler, and then filtered by the lowpass filter. A complex exponential that follows the lowpass filter centers the baseband signal around

*w*.

_{k}### Prototype Lowpass Filter

To implement the synthesis filter bank efficiently, the synthesizer uses a prototype lowpass
filter. This filter has an impulse response of
*h*[*n*], a normalized two-sided
bandwidth of 2π/*M*, and a cutoff frequency of
π/*M*. *M* is the number of
frequency bands, that is, the branches of the synthesis filter bank. This
value corresponds to the FFT length that the filter bank uses.
*M* can be high, in the order of 2048 or more. The
stopband attenuation determines the minimum level of interference (aliasing)
from one frequency band to another. The passband ripple must be small so
that the input signal is not distorted in the passband.

The prototype lowpass filter models the first branch of the filter bank. The other
*M* – 1 branches are modeled by filters that are
modulated versions of the prototype filter. The modulation factor is given
by $${e}^{j{w}_{k}n},\text{\hspace{1em}}{w}_{k}=2\pi k/M,\text{\hspace{1em}}k=0,1,\mathrm{...},M-1$$.

The output of each bandpass filter forms a specific portion of the broadband signal. The
output of all the branches are added to form the broadband signal,
*v*[*n*].

## Algorithms

### Polyphase Implementation

The synthesis filter bank can be implemented efficiently using the polyphase structure.

To derive the polyphase structure, start with the transfer function of the prototype lowpass filter.

$${H}_{0}(z)={b}_{0}+{b}_{1}{z}^{-1}+\mathrm{...}+{b}_{N}{z}^{-N}$$

*N* + 1 is the length of the prototype filter.

You can rearrange this equation as follows:

$${H}_{0}(z)=\begin{array}{c}\left({b}_{0}+{b}_{L}{z}^{-L}+{b}_{2L}{z}^{-2L}+\mathrm{..}+{b}_{N-L+1}{z}^{-(N-L+1)}\right)+\\ {z}^{-1}\left({b}_{1}+{b}_{L+1}{z}^{-L}+{b}_{2L+1}{z}^{-2L}+\mathrm{..}+{b}_{N-L+2}{z}^{-(N-L+1)}\right)+\\ \begin{array}{c}\vdots \\ {z}^{-(L-1)}\left({b}_{L-1}+{b}_{2L-1}{z}^{-L}+{b}_{3L-1}{z}^{-2L}+\mathrm{..}+{b}_{N}{z}^{-(N-L+1)}\right)\end{array}\end{array}$$

*L* is the number of polyphase components and equals
the interpolation factor.

You can write this equation as:

$${H}_{0}(z)={E}_{0}\left({z}^{L}\right)+{z}^{-1}{E}_{1}\left({z}^{L}\right)+\mathrm{...}+{z}^{-(L-1)}{E}_{L-1}\left({z}^{L}\right)$$

*E*_{0}(*z*^{L}),
*E*_{1}(*z*^{L}),
… ,
*E*_{L−1}(*z*^{L})
are polyphase components of the prototype lowpass filter,
*H*_{0}(*z*).

The other filters in the filter bank,
*H*_{k}(*z*),
where *k* = 1, … , *M* − 1, are modulated versions of
the prototype filter,
*H*_{0}(*z*).

You can write the transfer function of the *k*th modulated bandpass filter as $${H}_{k}(z)={H}_{0}(z{e}^{j{w}_{k}})$$. Replacing *z* with
*ze ^{jwk}*,

$${H}_{k}(z)={h}_{0}+{h}_{1}{e}^{jwk}{z}^{-1}+{h}_{2}{e}^{j2wk}{z}^{-2}\mathrm{...}+{h}_{N}{e}^{jNwk}{z}^{-N}$$

*N* + 1 is the length of the *k*th filter.

In polyphase form, the equation is as follows:

$${H}_{k}(z)=\left[1\text{\hspace{1em}}{e}^{j{w}_{k}}\text{\hspace{1em}}{e}^{j2{w}_{k}}\text{\hspace{1em}}\mathrm{...}\text{\hspace{1em}}{e}^{j(L-1){w}_{k}}\right]\left[\begin{array}{c}{E}_{0}\left({z}^{L}\right)\\ {z}^{-1}{E}_{1}\left({z}^{L}\right)\\ \vdots \\ {z}^{-(L-1)}{E}_{L-1}\left({z}^{L}\right)\end{array}\right]$$

For all *M* channels in the filter bank, the MIMO transfer function,
*H*(*z*), is given by:

$$H(z)=\left[\begin{array}{ccccc}1& 1& 1& \mathrm{...}& 1\\ 1& {e}^{j{w}_{1}}& {e}^{j2{w}_{1}}& \mathrm{...}& {e}^{j\left(L-1\right){w}_{1}}\\ & & \vdots & & \\ 1& {e}^{j{w}_{M-1}}& {e}^{j2{w}_{M-1}}& \mathrm{...}& {e}^{j(L-1){w}_{M-1}}\end{array}\right]\left[\begin{array}{c}{E}_{0}\left({z}^{L}\right)\\ {z}^{-1}{E}_{1}\left({z}^{L}\right)\\ \vdots \\ {z}^{-(L-1)}{E}_{L-1}\left({z}^{L}\right)\end{array}\right]$$

Here is the multirate noble identity for interpolation:

For illustration, consider the first branch of the filter bank that contains the lowpass filter.

Replace *H _{0}*(

*z*) with its polyphase representation.

After applying the noble identity for interpolation, you can replace the delays, interpolation factor, and the adder with a commutator switch.

For all the *M* channels in the filter bank, the MIMO transfer function,
*H*(*z*), is given by:

$$H(z)=\left[\begin{array}{ccccc}1& 1& 1& \mathrm{...}& 1\\ 1& {e}^{j{w}_{1}}& {e}^{j2{w}_{1}}& \mathrm{...}& {e}^{j(L-1){w}_{1}}\\ & & & & \\ 1& {e}^{j{w}_{M-1}}& {e}^{j2{w}_{M-1}}& \mathrm{...}& {e}^{j(L-1){w}_{M-1}}\end{array}\right]\left[\begin{array}{c}{E}_{0}(z)\\ {E}_{1}(z)\\ \vdots \\ {E}_{L-1}(z)\end{array}\right]$$

The matrix on the left is an IDFT matrix. With the IDFT matrix, the efficient implementation of the lowpass prototype based filter bank looks like the following.

## References

[1] Harris, Fredric J, *Multirate Signal Processing for
Communication Systems*, Prentice Hall PTR, 2004.

[2] Harris, F.J., Chris Dick, Michael Rice. "Digital Receivers and Transmitters Using Polyphase Filter Banks for Wireless Communications." IEEE Transactions on microwave theory and techniques. Vol. 51, Number 4, April 2003.

## Extended Capabilities

### 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).

## Version History

**Introduced in R2016b**

### R2024a: Support for integer oversampling

Use the new `InterpolationFactor`

property to specify an
interpolation factor *L* that is greater than or equal to the number of
frequency bands *M*. If *L* > *M*, then
the ratio *L*/*M* must be an integer and the synthesizer
is known as an oversampled channel synthesizer.

## See Also

### Functions

### Objects

`dsp.Channelizer`

|`dsp.FIRHalfbandDecimator`

|`dsp.FIRHalfbandInterpolator`

|`dsp.IIRHalfbandInterpolator`

|`dsp.DyadicSynthesisFilterBank`

### Blocks

- Channel Synthesizer | Channelizer | Dyadic Analysis Filter Bank | Two-Channel Analysis Subband Filter

### Functions

## Comando de MATLAB

Ha hecho clic en un enlace que corresponde a este comando de MATLAB:

Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)