2-D DCT
Compute 2-D discrete cosine transform (DCT)
图书馆
变换
VisionTransforms
![](http://www.tatmou.com/help/releases/R2019b/vision/ref/2d_dct_block.gif)
描述
The 2-D DCT block calculates the two-dimensional discrete cosine transform of the input signal. The equation for the two-dimensional DCT is
where for 和 otherwise.
The number of rows and columns of the input signal must be powers of two. The output of this block has dimensions the same dimensions as the input.
Port | 输入/Output | 金宝app支持的数据类型 | 支持的复杂值金宝app |
---|---|---|---|
输入 |
强度值的向量或矩阵 |
|
不 |
Output |
输入的2-D DCT |
Same as Input port |
不 |
如果输入信号的数据类型是浮点,则块的输出为相同的数据类型。
Use the正弦和余弦计算参数以指定块如何计算DCT算法中的正弦和余弦项。如果您选择Trigonometric fcn
,该块在模拟过程中计算正弦和余弦值。如果您选择Table lookup
,该块在模拟启动之前计算并存储三角值。在这种情况下,块需要额外的内存。
定点数据类型
下图显示了固定点信号中2-D DCT块中使用的数据类型。输入首先施放到输出数据类型中,并存储在输出缓冲区中。每个蝴蝶阶段的过程都在累加器数据类型中信号,其中蝴蝶的最终输出被抛入输出数据类型中。
The output of the multiplier is in the product output data type when at least one of the inputs to the multiplier is real. When both inputs to the multiplier are complex, the result of the multiplication is in the accumulator data type. For details on the complex multiplication performed, refer toMultiplication Data Types. You can set the sine table, product output, accumulator, and output data types in the block mask as discussed in the next section.
Parameters
- 正弦和余弦计算
-
Specify how the block computes the sine and cosine terms in the DCT algorithm. If you select
Trigonometric fcn
,该块在模拟过程中计算正弦和余弦值。如果您选择Table lookup
,该块在模拟启动之前计算并存储三角值。在这种情况下,块需要额外的内存。
- Rounding mode
-
选择Rounding Modesfor fixed-point operations. The sine table values do not obey this parameter; they always round to
Nearest
. - 整数溢出饱和
-
选择overflow mode for fixed-point operations. SeePrecision and Range. The sine table values do not obey this parameter; instead, they are always saturated.
- Sine table data type
-
Choose how you specify the word length of the values of the sine table. The fraction length of the sine table values always equals the word length minus one. You can set this parameter to:
A rule that inherits a data type, for example,
继承:与输入相同的单词长度
评估有效数据类型的表达式,例如
FIXDT(1,16)
The sine table values do not obey theRounding mode和整数溢出饱和parameters; instead, they are always saturated and rounded to
Nearest
. - Product output data type
-
指定产品输出数据类型。看定点数据类型和Multiplication Data Typesfor illustrations depicting the use of the product output data type in this block. You can set this parameter to:
A rule that inherits a data type, for example,
Inherit: Inherit via internal rule
评估有效数据类型的表达式,例如
fixdt(1,16,0)
点击Show data type assistantbutton
to display theData Type Assistant, which helps you set theProduct output data typeparameter.
看指定数据类型使用数据泰pe Assistant(Simulink) for more information.
- Accumulator data type
-
Specify the accumulator data type. See定点数据类型为了描述该块中累加器数据类型的使用。您可以将此参数设置为:
A rule that inherits a data type, for example,
Inherit: Inherit via internal rule
评估有效数据类型的表达式,例如
fixdt(1,16,0)
点击Show data type assistantbutton
to display theData Type Assistant, which helps you set theAccumulator data typeparameter.
看指定数据类型使用数据泰pe Assistant(Simulink) for more information.
- 输出数据类型
-
Specify the output data type. See定点数据类型for illustrations depicting the use of the output data type in this block. You can set this parameter to:
A rule that inherits a data type, for example,
Inherit: Inherit via internal rule
.当您选择时
Inherit: Inherit via internal rule
, the block calculates the output word length and fraction length automatically. The internal rule first calculates an ideal output word length and fraction length using the following equations:使用这些理想的结果,内部规则然后选择适合您硬件的单词长度和分数长度。有关更多信息,请参阅通过内部规则继承.
评估有效数据类型的表达式,例如
fixdt(1,16,0)
点击Show data type assistantbutton
to display theData Type Assistant, which helps you set the输出数据类型parameter.
看指定数据类型使用数据泰pe Assistant(Simulink) for more information.
- Lock scaling against changes by the autoscaling tool
-
选择此参数,以防止您在此块蒙版中指定的任何定点缩放缩放,以免被定点工具中的自动级工具覆盖。有关更多信息,请参阅
fxptdlg
,Simulink中的定点工具上的参考页面金宝app®文档。 - Lock data type settings against change by the fixed-point tools
-
Select this parameter to prevent the fixed-point tools from overriding the data types you specify on the block mask. For more information, see
fxptdlg
,Simulink文档中的定点工具上的参考页面。金宝app
参考
[1] Chen, W.H, C.H. Smith, and S.C. Fralick, “A fast computational algorithm for the discrete cosine transform,”IEEE Trans. Commun.,卷。COM-25,第1004-1009页。1977年。
[2] Wang, Z. “Fast algorithms for the discrete W transform and for the discrete Fourier transform,”IEEE Trans. Acoust., Speech, Signal Processing,卷。ASSP-32, pp. 803-816, Aug. 1984.