# Connexions

You are here: Home » Content » DSPA » Scaling

### Lenses

What is a lens?

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

#### In these lenses

• Lens for Engineering

This module is included inLens: Lens for Engineering
By: Sidney Burrus

Click the "Lens for Engineering" link to see all content selected in this lens.

### Recently Viewed

This feature requires Javascript to be enabled.

Inside Collection (Course):

Course by: Janko Calic. E-mail the author

# Scaling

Module by: Douglas L. Jones. E-mail the author

Summary: Digital filters must be properly scaled to prevent overflow in fixed-point implementations. Scaling by the sum of the absolute value of the impulse response of a filter prevents overflow. However, this is sometimes too conservative in practice, so less stringent rules are often used.

Overflow is clearly a serious problem, since the errors it introduces are very large. As we shall see, it is also responsible for large-scale limit cycles, which cannot be tolerated. One way to prevent overflow, or to render it acceptably unlikely, is to scale the input to a filter such that overflow cannot (or is sufficiently unlikely to) occur.

In a fixed-point system, the range of the input signal is limited by the fractional fixed-point number representation to |xn|1 x n 1 . If we scale the input by multiplying it by a value ββ, 0<β<1 0 β 1 , then |βxn|β β x n β .

Another option is to incorporate the scaling directly into the filter coefficients.

## FIR Filter Scaling

What value of ββ is required so that the output of an FIR filter cannot overflow ( |yn|1   n y n 1 , |xn|1   n x n 1 )? |yn|=| k =0M1hkβxnk| k =0M1|hk||β||xnk|β k =0M1|hk|1 y n k 0 M 1 h k β x n k k 0 M 1 h k β x n k β k M 1 0 h k 1 β< k =0M1|hk| β k M 1 0 h k Alternatively, we can incorporate the scaling directly into the filter, and require that k =0M1|hk|<1 k M 1 0 h k 1 to prevent overflow.

## IIR Filter Scaling

To prevent the output from overflowing in an IIR filter, the condition above still holds: ( M= M ) |yn|< k =0|hk| y n k 0 h k so an initial scaling factor β<1 k =0|hk| β 1 k 0 h k can be used, or the filter itself can be scaled.

However, it is also necessary to prevent the states from overflowing, and to prevent overflow at any point in the signal flow graph where the arithmetic hardware would thereby produce errors. To prevent the states from overflowing, we determine the transfer function from the input to all states ii, and scale the filter such that k =0| h i k|1   i k 0 h i k 1

Although this method of scaling guarantees no overflows, it is often too conservative. Note that a worst-case signal is xn=signhn x n sign h n ; this input may be extremely unlikely. In the relatively common situation in which the input is expected to be mainly a single-frequency sinusoid of unknown frequency and amplitude less than 1, a scaling condition of |Hw|1   w H w 1 is sufficient to guarantee no overflow. This scaling condition is often used. If there are several potential overflow locations ii in the digital filter structure, the scaling conditions are | H i w|1   i w H i w 1 where H i w H i w is the frequency response from the input to location ii in the filter.

Even this condition may be excessively conservative, for example if the input is more-or-less random, or if occasional overflow can be tolerated. In practice, experimentation and simulation are often the best ways to optimize the scaling factors in a given application.

For filters implemented in the cascade form, rather than scaling for the entire filter at the beginning, (which introduces lots of quantization of the input) the filter is usually scaled so that each stage is just prevented from overflowing. This is best in terms of reducing the quantization noise. The scaling factors are incorporated either into the previous or the next stage, whichever is most convenient.

Some heurisitc rules for grouping poles and zeros in a cascade implementation are:

1. Order the poles in terms of decreasing radius. Take the pole pair closest to the unit circle and group it with the zero pair closest to that pole pair (to minimize the gain in that section). Keep doing this with all remaining poles and zeros.
2. Order the section with those with highest gain ( argmax| H i w| H i w ) in the middle, and those with lower gain on the ends.

Leland B. Jackson has an excellent intuitive discussion of finite-precision problems in digital filters. The book by Roberts and Mullis is one of the most thorough in terms of detail.

## References

1. Leland B. Jackson. (1989). Digital Filters and Signal Processing. (2nd Edition). Kluwer Academic Publishers.
2. Richard A. Roberts and Clifford T. Mullis. (1987). Digital Signal Processing. Prentice Hall.

## Content actions

PDF | EPUB (?)

### What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

PDF | EPUB (?)

### What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

#### Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

#### Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks