Analyzing the coefficients, Analyzing the coefficients –8 – Altera FIR Compiler User Manual

Page 32

Advertising
background image

3–8

Chapter 3: Parameter Settings

Analyzing the Coefficients

FIR Compiler User Guide

© May 2011

Altera Corporation

Analyzing the Coefficients

The FIR Compiler contains a coefficient analysis tool, which you can use to create sets
of coefficients and perform actions on each set.

Some actions, such as scaling, apply to all sets. Other actions, such as recreating,
reloading, or deleting, apply to the set you are currently viewing.

The FIR Compiler supports up to 16 sets of coefficients. You can switch between sets
using the coefficient tabs in the Parameterize - FIR Compiler page. (The coefficient
sets are numbered, for example, Low Pass Set 1, Low Pass Set 2 and so on.)

When you select a set, the frequency response of the floating-point coefficients is
displayed in blue, and the frequency response of the fixed-point coefficients in green.
You can also view the actual coefficient values. by clicking the Time Response &
Coefficient Values

tab.

The FIR Compiler supports two’s complement, signed binary fractional notation,
which allows you to monitor which bits are preserved and which bits are removed
during filtering. A signed binary fractional number has the format:

<sign> <integer bits>.<fractional bits>

A signed binary fractional number is interpreted as shown below:

<sign> <x

1

integer bits>.<y

1

fractional bits>

Original input data

<sign> <x

2

integer bits>.<y

2

fractional bits>

Original coefficient data

<sign> <i integer bits>.<y

1

+ y

2

fractional bits>

Full precision after FIR calculation

<sign> <x

3

integer bits>.<y

3

fractional bits>

Output data after limiting precision

where i = ceil(log

2

(number of coefficients)) + x

1

+ x

2

If, for example, the number has 3 fractional bits and 4 integer bits plus a sign bit, the
entire 8-bit integer number is divided by 8, which yields a number with a binary
fractional component.

1

DSP Builder incorporates the sign bit as part of the integer bits. Thus, if you are using
the FIR filter in a DSP Builder design, DSP builder will recognize the sign bit as an
additional integer bit.

When converted to decimal numbers, certain fractions have an infinite number of
binary bits. For example, converting 1/3 to a decimal number yields 0.333n with n
representing an infinite number of 3s. Similarly, numbers such as 1/10 cannot be
represented in a finite number of binary digits with full precision. If you use signed
binary fractional notation, the FIR Compiler uses the fractional number that most
closely matches the original number for the number of bits of precision you select.

For this tutorial, select Auto for Coefficients Scaling and 12 for the Coefficient Bit
Width

.

1

Auto scaling (without the power of two option) provides the maximum signal-to-
noise ratio. All other scaling factors such as Signed Binary Fractional can result in a
loss of effective bits (that is, where each effective bit provides 6dB of SNR).

Advertising