Digital DownConverter
Translate digital signal from intermediate frequency (IF) band to baseband and decimate it
Libraries:
DSP System Toolbox /
Signal Operations
Description
The Digital DownConverter (DDC) block converts a digitized real signal centered at an intermediate frequency (IF) to a baseband complex signal centered at zero frequency. The DDC block downsamples the frequency downconverted signal using a cascade of three decimation filters. This block designs the decimation filters according to the filter parameters you set in the block dialog box.
Examples
Ports
Input
Input 1 — Data input
column vector  matrix
Specify the data input as a column vector or a matrix. The number of rows in the input signal must be a multiple of the decimation factor that you specify in the Decimation factor parameter.
When the input data type is double
or single
precision, the output data type is the same as that of the input. When
the input data type is a signed integer or fixedpoint type, the output
data type is defined by the Output parameter on the
Data Types tab.
When the input is fixedpoint, it must be signed only.
Data Types: single
 double
 int8
 int16
 int32
 int64
 fixed point
Complex Number Support: Yes
Osc — Oscillator signal
column vector  matrix
Specify the oscillator signal that the block uses to frequency down convert the input signal as a column vector or a matrix. The signal must be complex and its length must be equal to the length of the input.
When the oscillator input is fixedpoint, it must be signed only.
Dependencies
To enable this port, set the Type of oscillator parameter to
Input port
.
Data Types: single
 double
 int8
 int16
 int32
 int64
 fixed point
Complex Number Support: Yes
Output
Output 1 — Downconverted and downsampled signal
column vector  matrix
The block outputs the downconverted and downsampled signal as a column vector or a matrix. The length of the output is equal to the length of the input divided by the value you specify in the Decimation factor parameter.
When the data type of the input is double
or
single
precision, the data type of the output is
the same as that of the input. When the input data type is fixedpoint
type or a signed integer, the output data type is defined by the
Output parameter on the Data
Types tab.
Data Types: single
 double
 int8
 int16
 int32
 int64
 fixed point
Complex Number Support: Yes
Parameters
Main Tab
Decimation factor — Decimation factor
100
(default)  positive integer ≥ 2  vector of positive integers
Specify the decimation factor as a positive integer ≥ 2, or as a 1by2 or 1by3 vector of positive integers.
When you set this parameter to a scalar value, the block applies the same decimation factor to the three decimation filtering stages.
When you set this parameter to a 1by2 vector, the block applies the first and second values in the vector to the first and second filtering stages, respectively, and bypasses the third stage. Both elements of Decimation factor must be greater than 1.
When you set this parameter to a 1by3 vector, the block applies the values in the vector to the corresponding filtering stages. The first and second elements of Decimation factor must be greater than 1, and the third element must be 1 or 2.
Minimum order filter design — Design minimumorder filter
on
(default)  off
When you select this check box, the block designs filters with the minimum possible order that meets the requirements specified in these parameters:
Passband ripple of cascade response (dB)
Stopband attenuation of cascade response (dB)
Two sided bandwidth of input signal (Hz)
Source of stopband frequency
Stopband frequency (Hz)
When you clear this check box, the block designs filters with orders that you specify in Number of sections of CIC decimator, Order of CIC compensation filter stage, and Order of third filter stage. The filter designs meet the passband and stopband frequency specifications that you set in Two sided bandwidth of input signal (Hz), Source of stopband frequency, and Stopband frequency (Hz). By default, this check box is selected.
Number of sections of CIC decimator — Number of sections in CIC decimator
3
(default)  positive integer
Specify the number of sections in the CIC decimator as a positive integer.
Dependencies
To enable this parameter, clear the Minimum order filter design parameter.
Order of third filter stage — Order of third filter stage
10
(default)  even positive integer
Specify the order of the third filter stage as an even positive integer. When you specify Decimation factor as a 1by2 vector, the block ignores the value in this parameter because the block bypasses the third filter stage.
Dependencies
To enable this parameter, clear the Minimum order filter design parameter.
Source of stopband frequency — Source of stopband frequency
Auto
(default)  Property
Specify the source of the stopband frequency as
Auto
or
Property
.
When you set this parameter to Auto
, the
block places the cutoff frequency of the cascade filter response at
approximately F_{c} =
SampleRate / M/2 Hz, where
M is the total decimation factor specified in
Decimation factor.
SampleRate is computed as 1
/
Ts, where Ts is the sample
time of the input signal. The block computes the stopband frequency as
F_{stop} =
F_{c} + (TW /
2). TW is the transition bandwidth of the cascade
response, computed as
2×(F_{c}–F_{p}),
where the passband frequency
F_{p} equals
Bandwidth/2.
When you set this parameter to Property
,
specify the stopband frequency in Stopband frequency
(Hz).
Type of oscillator — Type of oscillator
Sine wave
(default)  NCO
 Input port
 None
Specify the oscillator type as one of the following:
Sine wave
(default) — The block performs frequency down conversion on the input signal using a complex exponential obtained from samples of a sinusoidal trigonometric function.NCO
— The block performs frequency down conversion on the input signal with a complex exponential obtained using a numerically controlled oscillator (NCO).Input port
— The block performs frequency down conversion on the input signal using the complex signal that you provide through the Osc input port.None
— The block does not require the mixer stage and acts as a threestage cascaded decimator.
Center frequency of output signal (Hz) — Center frequency of output signal
14e6
(default)  positive scalar
Specify the center frequency of the output signal in Hz as a
doubleprecision positive scalar that is less than or equal to half the
sample rate. The block downconverts the input signal from the passband
center frequency, which you specify in Center frequency of
input signal (Hz), to 0
Hz.
Dependency
To enable this parameter, set Type of
oscillator to Sine wave
or
NCO
.
Order of CIC compensation filter stage — Order of CIC compensation filter stage
12
(default)  positive integer
Specify the order of the CIC compensation filter stage as a positive integer.
Dependencies
To enable this parameter, clear the Minimum order filter design parameter.
Twosided bandwidth of input signal (Hz) — Twosided bandwidth of input signal
200000
(default)  positive integer
Specify the twosided bandwidth of the input signal in Hz as a
positive integer. The block sets the passband frequency of the cascade
of filters to half of the value you specify in this parameter. Set the
value of this parameter to less than Input sample
rate/Decimation factor. When you
select the Inherit sample rate from input check
box, set this value to less than
((1
/Ts) / Decimation
factor), where Ts is the sample time
of the input signal.
Stopband frequency (Hz) — Stopband frequency
150000
(default)  positive scalar
Specify the stopband frequency in Hz as a doubleprecision positive scalar.
Dependencies
To enable this parameter, set Source of stopband
frequency to
Property
.
Passband ripple of cascade response (dB) — Passband ripple of cascade response
0.1
(default)  positive scalar
Specify the passband ripple of the cascade response in dB as a doubleprecision positive scalar. When you select the Minimum order filter design, the block designs the filters so that the cascade response meets the passband ripple that you specify in Passband ripple of cascade response (dB).
Dependencies
To enable this parameter, select the Minimum order filter design parameter.
Stopband attenuation of cascade response (dB) — Stopband attenuation of cascade response
60
(default)  positive scalar
Specify the stopband attenuation of the cascade response in dB as a doubleprecision positive scalar. When you select the Minimum order filter design parameter, the block designs the filters such that the cascade response meets the stopband attenuation that you specify in this parameter.
Dependencies
To enable this parameter, select the Minimum order filter design parameter.
Number of NCO accumulator bits — Number of NCO accumulator bits
16
(default)  positive integer
Specify the number of NCO accumulator bits as an integer scalar in the
range [1 128
].
Dependencies
To enable this parameter, set Type of
oscillator to NCO
.
Number of NCO quantized accumulator bits — Number of NCO quantized accumulator bits
12
(default)  positive integer in the range [1 128]
Specify the number of NCO quantized accumulator bits as an integer
scalar in the range [1 128]
. This value must be less
than the value you specify in Number of NCO accumulator
bits.
Dependencies
To enable this parameter, set Type of
oscillator to NCO
.
Dither control for NCO — Dither control for NCO
on
(default)  off
When you select this check box, the block applies dither to the NCO signal according to the number of dither bits you specify in Number of NCO dither bits. By default, this check box is selected.
Dependencies
To enable this parameter, set Type of
oscillator to NCO
.
Number of NCO dither bits — Number of NCO dither bits
4
(default)  positive integer
Specify the number of NCO dither bits as an integer scalar smaller than the number of accumulator bits in Number of NCO accumulator bits.
Dependencies
To enable this parameter, set Type of
oscillator to NCO
and
select the Dither control for NCO
parameter.
Inherit sample rate from input — Inherit sample rate from input
off
(default)  on
When you select this check box, the block computes the sample rate as
N
/Ts, where
N is the frame size of the input signal, and
Ts is the sample time of the input signal. When
you clear this check box, the block sets the sample rate to the value in
Input sample rate (Hz).
Input sample rate (Hz) — Sample rate of input signal
30e6
(default)  positive scalar
Specify the sample rate of the input signal in Hz as a positive scalar value greater than or equal to twice the value in Center frequency of input signal (Hz).
Dependencies
To enable this parameter, clear the Inherit sample rate from input parameter.
View Filter Response — View Filter Response
button
Click this button to open the Filter Visualization Tool (FVTool) and display the magnitude and phase response of each stage as well as the cascade of stages in the Digital DownConverter. The response is based on the values you specify in the block parameters dialog box. Changes made to these parameters update FVTool.
To update the magnitude response while FVTool is running, modify the parameters in the dialog box and click Apply.
Simulate using — Simulate using
Code generation
(default)  Interpreted execution
Specify the type of simulation to run. You can set this parameter to:
Code generation
(default)Simulate model using generated C code. The first time you run a simulation, Simulink^{®} generates C code for the block. The C code is reused for subsequent simulations, as long as the model does not change. This option requires additional startup time but provides faster simulation speed than
Interpreted execution
.Interpreted execution
Simulate model using the MATLAB^{®} interpreter. This option shortens startup time but has slower simulation speed than
Code generation
.
Data Types Tab
Stage input — Stage input
Inherit: Same as
input
(default)  fixdt([],16,0)
Specify the data type of the input in the first, second, and third filter stages. You can set this parameter to one of the following:
Inherit: Same as input
(default) — The block inherits the Stage input data type from the input signal.fixdt([],16,0)
— The block uses the fixedpoint data type with binarypoint scaling. Specify the sign mode of this data type as[]
ortrue
.An expression that evaluates to a data type, for example,
numerictype([],16,15)
. Specify the sign mode of this data type as[]
ortrue
.
For help with setting the stage input parameter, you can click the Show data type assistant button to display the data type assistant.
See Specify Data Types Using Data Type Assistant (Simulink) for more information.
Output — Output
Inherit: Same as
input
(default) 
fixdt([],16,0)
Specify the data type of the block output. You can set this parameter to:
Inherit: Same as input
(default) — The block Inherits the output datatype from the input.fixdt([],16,0)
— The block uses the fixedpoint data type with binary point scaling. Specify the sign mode of this data type as[]
ortrue
.An expression that evaluates to a data type, for example,
numerictype([],16,15)
. Specify the sign mode of this data type as[]
ortrue
.
For help with setting the Output parameter, you can click the Show data type assistant button to display the data type assistant.
See Specify Data Types Using Data Type Assistant (Simulink) for more information.
Minimum — Minimum
[]
(default)  scalar
Specify the minimum value of the block output. The default value is
[]
(unspecified). Simulink software uses this value to perform:
Simulation range checking (see Specify Signal Ranges (Simulink))
Automatic scaling of fixedpoint data types
Maximum — Maximum
[]
(default)  scalar
Maximum value of the block output. The default value is
[]
(unspecified). Simulink software uses this value to perform:
Simulation range checking (see Specify Signal Ranges (Simulink))
Automatic scaling of fixedpoint data types
Lock data type settings against changes by the fixedpoint tools — Prevent fixedpoint tools from overriding data types
off
(default)  on
Select this parameter to prevent the fixedpoint tools from overriding the data types you specify in the block dialog box.
Block Characteristics
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

More About
Fixed Point
The following block diagram represents the DDC arithmetic with signed fixedpoint inputs.
WL
is the word length of the input, andFL
is the fraction length of the input.The input of each filter is cast to the filter input data type. In the
dsp.DigitalDownConverter
object, you can specify the filter input data type through theFiltersInputDataType
andCustomFiltersInputDataType
properties. In the Digital DownConverter block, you can specify the filter input data type through the Stage input parameter.The oscillator output is cast to a word length equal to the input word length plus one. The fraction length is equal to the input word length minus one.
The scaling at the output of the CIC decimator consists of coarse and finegain adjustments. The coarse gain is achieved using the
reinterpretcast
(FixedPoint Designer) function on the CIC decimator output. The fine gain is achieved using fullprecision multiplication.
The following figure depicts the coarsegain and finegain operations.
If the normalization gain is G (where 0<G≦1), then:
WLcic
is the word length of the CIC decimator output andFLcic
is the fraction length of the CIC decimator output.F1 = abs(nextpow2(G))
, indicating the part of G achieved using bit shifts (coarse gain).F2
= fraction length specified by the filter input data type.fg = fi((2^F1)*G, true, 16)
, which indicates that the remaining gain cannot be achieved with a bit shift (fine gain).
Algorithms
The digital down converter downconverts the input signal by multiplying it with a complex exponential that has the specified center frequency. The algorithm downsamples the frequency downconverted signal using a cascade of three decimation filters. In this case, the filter cascade consists of a CIC decimator, a CIC compensator, and a third FIR decimation stage. The following block diagram shows the architecture of the digital down converter.
The scaling section normalizes the CIC gain and the oscillator power. It can also contain a correction factor to achieve the desired ripple specification. When you specify an oscillator signal through the input port, the normalization factor does not include the oscillator power factor. Depending on how you set the decimation factor, the block bypasses the third filter stage. When the input data type is double or single, the algorithm implements an Nsection CIC decimation filter as an FIR filter with a response that corresponds to a cascade of N boxcar filters. The algorithm emulates a CIC filter with an FIR filter so that you can run simulations with floatingpoint data. When the input data type is fixedpoint, the algorithm implements a true CIC filter with actual comb and integrator sections.
This block diagram represents the DDC arithmetic with single or doubleprecision, floatingpoint inputs.
For details about fixedpoint operation, see Fixed Point.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
FixedPoint Conversion
Design and simulate fixedpoint systems using FixedPoint Designer™.
If the input is fixed point, it must be a signed integer or a signed fixed point value with a poweroftwo slope and zero bias.
Version History
Introduced in R2015a
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi 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)