03.08.2013 Views

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Expressions<br />

for k from 0 to D – 1 , where N is the size of the specified array and D is the size of the DCT. If only<br />

one argument is given, then D is set to equal the next power of two larger than N . If a second argu-<br />

ment is given, then its value is the order of the DCT, and the size of the DCT is . If a third argument<br />

is given, then it specifies the scaling factors according to the following table:<br />

The default, if a third argument is not given, is “Normalized.”<br />

The IDCT function is similar, and can also take one, two, or three arguments. The formula in this<br />

case is<br />

3.8 Fixed Point Numbers<br />

xn skX ( 2n + 1)k.<br />

(5)<br />

k π<br />

=<br />

⎛ ------⎞<br />

∑ cos<br />

⎝ 2D⎠<br />

Ptolemy <strong>II</strong> includes a preliminary fixed point data type. We represent a fixed point value in the<br />

expression language using the following format:<br />

fix(value, totalBits, integerBits)<br />

Thus, a fixed point value of 5.375 that uses 8 bit precision of which 4 bits are used to represent the<br />

(signed) integer part can be represented as:<br />

fix(5.375, 8, 4)<br />

TABLE 3: Normalization options for the DCT function<br />

Name Third argument Normalization<br />

Normalized 0<br />

Unnormalized 1<br />

Orthonormal 2<br />

N – 1<br />

Xk sk xn ( 2n + 1)k<br />

π<br />

=<br />

⎛ ------ ⎞<br />

∑ cos<br />

⎝ 2D⎠<br />

N – 1<br />

k = 0<br />

n = 0<br />

s k<br />

s k<br />

s k<br />

s k<br />

1/ 2; k = 0<br />

1 ; otherwise<br />

2 order<br />

The value can also be a matrix of doubles. The values are rounded, yielding the nearest value representable<br />

with the specified precision. If the value to represent is out of range, then it is saturated, meaning<br />

that the maximum or minimum fixed point value is returned, depending on the sign of the specified<br />

114 Ptolemy <strong>II</strong><br />

=<br />

=<br />

=<br />

⎧<br />

⎨<br />

⎩<br />

1<br />

⎧<br />

⎪<br />

⎨<br />

⎪<br />

⎩<br />

1/ D; k = 0<br />

2/D ; otherwise<br />

(4)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!