Documentation

2-D DCT

Compute 2-D discrete cosine transform (DCT)

图书馆

变换

VisionTransforms

描述

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 C ( m ) , C ( n ) = 1 / 2 for m , n = 0 C ( m ) , C ( n ) = 1 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

输入

强度值的向量或矩阵

  • 双精度浮点

  • 单精度浮点

  • Fixed point

  • 8-,16-,32位签名的整数

  • 8-, 16-, 32-bit unsigned integer

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 selectTrigonometric fcn,该块在模拟过程中计算正弦和余弦值。如果您选择Table lookup,该块在模拟启动之前计算并存储三角值。在这种情况下,块需要额外的内存。

Rounding mode

选择Rounding Modesfor fixed-point operations. The sine table values do not obey this parameter; they always round toNearest.

整数溢出饱和

选择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 toNearest.

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 assistantbuttonto 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 assistantbuttonto 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:

    W L i d e a l o u t p u t = W L i n p u t + f l o o r ( 日志 2 ( D C T l e n g t h 1 ) ) + 1

    F L i d e a l o u t p u t = F L i n p u t

    使用这些理想的结果,内部规则然后选择适合您硬件的单词长度和分数长度。有关更多信息,请参阅通过内部规则继承.

  • 评估有效数据类型的表达式,例如fixdt(1,16,0)

点击Show data type assistantbuttonto 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, seefxptdlg,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.

看Also

2-D IDCT

计算机视觉工具箱™软件

2-D FFT

Computer Vision Toolbox software

2-D IFFT

Computer Vision Toolbox software

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

在R2006a之前引入