Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
литература / Digital_Video_and_HD_Second_Edition_Algorithms_and_Interfaces.pdf
Скачиваний:
0
Добавлен:
13.05.2026
Размер:
38.02 Mб
Скачать

Details of the relationship between the Dirac delta, the Kronecker delta, and sampling in DSP are found on page 122 of Rorabaugh’s book, cited at the end of the chapter.

In Equation 20.2, g is a sequence (whose index is enclosed in square brackets), not a function (whose argument would be in parentheses); sj is sample number j.

Eq 20.2

Symmetry:

f (x) = f (x)

Antisymmetry:

f (x) = − f (x)

Impulse response

I have explained filtering as weighted integration along the time axis. I coined the term temporal weighting function to denote the weights. I consider my explanation of filtering in terms of its operation in the temporal domain to be more intuitive to a digital technologist than a more conventional explanation that starts in the frequency domain. But my term temporal weighting function is nonstandard, and I must now introduce the usual but nonintuitive term impulse response.

An analog impulse signal has infinitesimal duration, infinite amplitude, and an integral of unity. (An analog impulse is conceptually equivalent to the Dirac or Kronecker deltas of mathematics.) A digital impulse signal is a solitary sample having unity amplitude amid a stream of zeros; The impulse response of a digital filter is its response to an input that is identically zero except for a solitary unity-valued sample.

Finite impulse response (FIR) filters

In each of the filters that I have described so far, only a few coefficients are nonzero. When a digital impulse is presented to such a filter, the result is simply the weighting coefficients scanned out in turn. The response to an impulse is limited in duration; the examples that I have described have finite impulse response. They are FIR filters. In these filters, the impulse response is identical to the set of coefficients. The digital filters that I described on page 202 implement temporal weighting directly. The impulse responses of these filters, scaled to unity, are [12, 12], [12, -12], [12, 0, 12], and [12, 0, -12], respectively.

The particular set of weights in Figure 20.18 approximate a sampled Gaussian waveform; so, the frequency response of this filter is approximately Gaussian. The action of this filter can be expressed algebraically:

g[ j] =

13

sj−2 +

56

sj−1

+

118

sj +

56

sj+1 +

13

sj+2

 

256

 

256

256

256

 

 

256

 

 

 

I have described impulse responses that are symmetrical around an instant in time. You might think t=0 should denote the beginning of time, but it is usually convenient to shift the time axis so that t=0 corresponds to

CHAPTER 20

FILTERING AND SAMPLING

207

Here I use the word truncation to indicate the forcing to zero of a filter’s weighting function beyond a certain tap. The nonzero coefficients in a weighting function may involve theoretical values that have been quantized to a certain number of bits. This coefficient quantization can be accomplished by rounding or by truncation. Be careful to distinguish between truncation of impulse response and truncation of coefficients.

the central point of a filter’s impulse response. An FIR (or nonrecursive) filter has a limited number of coefficients that are nonzero. When the input impulse lies outside this interval, the response is zero. Most digital filters used in video are FIR filters, and most have impulse responses either symmetric or antisymmetric around t=0.

You can view an FIR filter as having a fixed structure, with the data shifting along underneath. Alternatively, you might think of the data as being fixed, and the filter sliding across the data. Both notions are equivalent.

Physical realizability of a filter

In order to be implemented, a digital filter must be physically realizable: It is a practical necessity to have a temporal weighting function (impulse response) of limited duration. An FIR filter requires storage of several input samples, and it requires several multiplication operations to be performed during each sample period. The number of input samples stored is called the order of the filter, or its number of taps. If a particular filter has fixed coefficients, then its multiplications can be performed by table lookup. A straightforward technique can be used to exploit the symmetry of the impulse response to eliminate half the multiplications; this is often advantageous!

When a temporal weighting function is truncated past a certain point, its transform – its frequency response characteristics – will suffer. The science and craft of filter design involves carefully choosing the order of the filter – that is, the position beyond which the weighting function is forced to zero. That position needs to be far enough from the center tap that the filter’s high-frequency response is small enough to be negligible for the application.

Signal processing accommodates the use of impulse responses having negative values, and negative coefficients are common in digital signal processing. But image capture and image display involve sensing and generating light, which cannot have negative power, so negative weights cannot always be realized. If you study the transform pairs on page 201 you will see that your ability to tailor the frequency response of a filter is severely limited when you cannot use negative weights.

208

DIGITAL VIDEO AND HD ALGORITHMS AND INTERFACES

125 ns, 45° at 1 MHz

125 ns, 90° at 2 MHz Figure 20.21 Linear phase

Impulse response is generally directly evident in the design of an FIR digital filter. Although it is possible to implement a boxcar filter directly in the analog domain, analog filters rarely implement temporal weighting directly, and the implementation of an analog filter generally bears a nonobvious relationship to its impulse response. Analog filters are best described in terms of Laplace transforms, not Fourier transforms. Impulse responses of analog filters are rarely considered directly in the design process. Despite the major conceptual and implementation differences, analog filters and FIR filters – and IIR filters, to be described – are all characterized by their frequency response.

Phase response (group delay)

Until now I have described the magnitude frequency response of filters. Phase frequency response – often called phase response – is also important. Consider

a symmetrical FIR filter having 15 taps. No matter what the input signal, the output will have an effective delay of 8 sample periods, corresponding to the central sample of the filter’s impulse response. The time delay of an FIR filter is constant, independent of frequency.

Consider a sine wave at 1 MHz, and a second sine wave at 1 MHz but delayed 125 ns. The situation is sketched in Figure 20.21 in the margin. The 125 ns delay could be expressed as a phase shift of 45° at 1 MHz. However, if the time delay remains constant

and the frequency doubles, the phase offset doubles to 90°. With constant time delay, phase offset increases in direct (linear) proportion to the increase in frequency. Since in this condition phase delay is directly proportional to frequency, its synonym is linear phase.

A closely related condition is constant group delay, where the first derivative of delay is constant but a fixed time delay may be present. All FIR filters exhibit constant group delay, but only symmetric FIR filters exhibit strictly linear phase.

It is characteristic of many filters – such as IIR filters, to be described in a moment – that delay varies somewhat as a function of frequency. An image signal contains many frequencies, produced by scene elements at different scales. If the horizontal displacement of a reproduced object were dependent upon

CHAPTER 20

FILTERING AND SAMPLING

209

Figure 20.22 An IIR (“recur-

sive”) filter computes IN 0.25IN a weighted sum of input

samples (here, just 0.25 times the current

sample), and adds to this a weighted sum of previous result samples. Every IIR filter exhibits nonlinear phase response.

OUT

R

0.75

What a signal processing engineer calls an IIR filter is known in the finance and statistics communities as autoregressive moving average (ARMA).

frequency, objectionable artifacts would result. Symmetric FIR filters exhibit linear phase in their passbands, and avoid this artifact. So, in image processing and in video, FIR filters are strongly preferred over other sorts of filters: Linear phase is a highly desirable property in a video system.

Infinite impulse response (IIR) filters

The digital filters described so far have been members of the FIR class. A second class of digital filter is characterized by having a potentially infinite impulse response (IIR). An IIR (or recursive) filter computes a weighted sum of input samples – as is the case in an FIR filter – but adds to this a weighted sum of previous output samples.

A simple IIR is sketched in Figure 20.22: The input sample is weighted by 14, and the previous output is weighted by 34. These weighted values are summed to form the filter result. The filter result is then fed back to become an input to the computation of the next sample. The impulse response jumps rapidly upon the onset of the input impulse, and tails off over many samples. This is a simple one-tap lowpass filter; its time-domain response closely resembles an analog RC lowpass filter. A highpass filter is formed by taking the difference of the input sample from the previously stored filter result.

In an IIR filter having just one tap, the designer’s ability to tailor frequency response is severely limited. An IIR filter can be extended by storing several previous filter results, and adding (or subtracting) a fraction of each to a fraction of the current input sample. In such a multitap IIR filter, a fine degree of control can be exercised over frequency response using just a handful of taps. Just three or four taps in an IIR filter can

210

DIGITAL VIDEO AND HD ALGORITHMS AND INTERFACES

Соседние файлы в папке литература