# Wave Walker DSP

## Trending

DSP for Beginners: Simple Explanations for Complex Numbers! The second edition includes a new chapter on complex sinusoids.

Time Invariant and Time Varying Filters
September 3, 2021

#### Introduction

The response of time invariant filters is independent of time and have filter weights which do not change over time. Time invariance (TI) is a nice quality for filters to have when analyzing them mathematically and have many applications in which adaptation is not needed. Time-varying filters (TV) are common in radio receivers such as equalizers, automatic gain control and polyphase filters. For example an equalizer is time-varying because the filter weights are dependent on previous input samples. Understanding TI filters is necessary for having a proper DSP foundation before moving onto TV filters.

#### Time Invariant FIR Filters

The output of a finite pulse response (FIR) filter h[n] is represented by convolution,

(1)

or alternatively,

(2)

Figure 1 is an example of a FIR filter.

From(2) it can be seen that x[k] is time reversed, x[-k], and delayed by n samples,

(3)

Mathematically either x[n] or h[n] could be time reversed and delayed and the same output would be produced. However for easier analysis the convolution will be implemented by time reversing and delaying x[n].

Expanding (2),

(4)

Delaying x[n] by T samples and substituting into (4) results in

(5)

which can be simplified as

(6)

and

(7)

From (7) it can be seen that a delay in x[k] by T samples, x[k-T], results in a delay of the output y[n] by T samples, y[n-T] with no other affects. Figure 2 shows how a delay on an input signal results in the same delay in the output when filtered by a time-invariant FIR filter.

#### Time Invariant IIR Filters

IIR filters are implemented using a difference equation

(8)

which can be written closed-form as

(9)

An example of an IIR filter is given in Figure 3.

Delaying x[n] by T samples, x[n-T], and substituting into (9) results in

(10)

From (10), delaying x[n] by T results in the output being delayed by the same amount, y[n-T], with no other impact. The output y[n] is dependent on the input x[n] and the filter weights ak and bk. The filter weights ak and bk are constant for all time and therefore will not being time-varying. A delay of x[n] therefore corresponds directly to a delay in y[n]. Figure 4 gives an example of time-invariance in an IIR filter.

#### Time-Varying Filters

A decimating FIR filter is a simple case of a time-varying filter. A basic decimation operation is performed by first low-pass filtering and then downsampling, shown in Figure 5.

Combining the low-pass filtering with the downsampling operation will reveal the time-varying nature of the filtering operation and will produce computational efficiencies, referred to as a polyphase decimating filter. The low-pass filter output can be written as

(11)

Downsampling by 2 discards every other sample. Mathematically, it allows for the opportunity to select even indices,

(12)

or odd indices,

(13)

Both (12) and (13) are valid and only differ by delaying the input to the downsample by 1 sample. Choosing

(14)

and substituting (12) into (11) gives

(15)

The filter h[n] produces a single output  for each input x[n]. However, the downsampling by 2 operation discards all of the odd indices  wasting the computation. The filter h[n] will be rearranged into a polyphase structure to avoid wasting the computation and making the decimation more efficient.

The filter output is arranged into even time indices x[2n] and odd time indices x[2n+1].

(16)

From (16) it can be seen that the even input samples x[2(n-k)] are filtered by the even filter weights h[2k] while the odd input samples x[2(n-k)+1] are filtered by the odd filter weights h[2k+1]. The time index of the input samples x[n] therefore indicates which set of filter weights will be applied. Figure 6 gives the polyphase partitioning and shows how the input switch for x[n] controls which filter weights will be applied.

The polyphase decimating filter is therefore periodically time-varying as it produces different filter responses based on the time delay of the input signal. Figure 7 gives an example of how the PTV nature of the polyphase decimating filter effects delays on the input signal.

Note that the decimate by 2 polyphase filter is periodically time-varying (PTV) with a period of 2 samples. Delaying the input signal into the filter by 2k synchronizes the input signal to the periodic nature of the cycling filter weights and the filter response becomes time-invariant under these conditions. Similarly, delaying the input by 2k+1 will also be time-invariant. Figure 7 shows that delaying the input signal by 0 and 2 samples results in the same output signal but with a 1 sample delay. Conversely, delaying the input sample by 1 sample produces a different filter response and results in a 1/2 sample delay.

#### Other Examples of Time Varying Filters

A subset of time-varying filters include adaptive filters whose filter weights are effected by previous samples of the input signal. Such adaptive filters include equalizers and automatic gain control. Another class of time-varying filters are periodically time varying filters which includes polyphase filters.

#### Conclusion

Delaying the input to a time invariant filter produces the same delay of the output signal with no other modifications. Time-invariant filters have mathematically useful properties for filter analysis and also form the basis for more sophisticated time-varying filters. A polyphase decimating filter is an example of a periodically time-varying filter because the filter response depends on the time delay of the input signal.

For everything there is a season, and a time for every matter under heaven. A time to cast away stones, and a time to gather stones together. A time to embrace, and a time to refrain from embracing. Ecclesiastes 3:1,5
The earth was without form and void, and darkness was over the face of the deep. And the Spirit of God was hovering over the face of the waters. Genesis 1:2
Behold, I am toward God as you are; I too was pinched off from a piece of clay. Job 33:6
Enter His gates with thanksgiving, and His courts with praise! Give thanks to Him; bless His name! Psalm 100:4
Lift up your hands to the holy place and bless the Lord! Psalm 134:2
Blessed is the man who trusts in the Lord, whose trust is the Lord. He is like a tree planted by water, that sends out its roots by the stream, and does not fear when heat comes, for its leaves remain green, and is not anxious in the year of drought, for it does not cease to bear fruit. Jeremiah 17:7-8
He said to him, “You shall love the Lord your God with all your heart and with all your soul and with all your mind. This is the great and first commandment. And a second is like it: You shall love your neighbor as yourself. On these two commandments depend all the Law and the Prophets.” Matthew 22:37-39
Then He said to me, “Prophesy over these bones, and say to them, O dry bones, hear the word of the Lord. Thus says the Lord God to these bones: Behold, I will cause breath to enter you, and you shall live." Ezekiel 37:4-5
Riches do not profit in the day of wrath, but righteousness delivers from death. Proverbs 11:4
The angel of the Lord appeared to him in a flame of fire out of the midst of a bush. He looked, and behold, the bush was burning, yet it was not consumed. And Moses said, “I will turn aside to see this great sight, why the bush is not burned.” When the Lord saw that he turned aside to see, God called to him out of the bush, “Moses, Moses!” And he said, “Here I am.” Exodus 3:2-3
Daniel answered and said: “Blessed be the name of God forever and ever, to whom belong wisdom and might. He changes times and seasons; He removes kings and sets up kings; He gives wisdom to the wise and knowledge to those who have understanding." Daniel 2:20-21
Now the Lord is the Spirit, and where the Spirit of the Lord is, there is freedom. 2 Corinthians 3:17

This website participates in the Amazon Associates program. As an Amazon Associate I earn from qualifying purchases.