Showing Linearity and Time Invariance, or Not

The filter $ y(n) = 2 x^2(n)$ is nonlinear and time invariant. The scaling property of linearity clearly fails since, scaling $ x(n)$ by $ g$ gives the output signal $ 2[gx(n)]^2 = 2g^2x^2(n)$, while $ gy(n) =
2gx^2(n)$. The filter is time invariant, however, because delaying $ x$ by $ m$ samples gives $ 2x^2(n-m)$ which is the same as $ y(n-m)$.

The filter $ y(n) = n x(n) + x(n-1)$ is linear and time varying. We can show linearity by setting the input to a linear combination of two signals $ x(n) = \alpha x_1(n) + \beta x_2(n)$, where $ \alpha$ and $ \beta$ are constants:

n [\alpha x_1(n) + \beta x_2(n)] &+& [\alpha x_1(n-1) + \beta ...
... [n x_2(n) + x_2(n-1)]\\
&\isdef & \alpha y_1(n) + \beta y_2(n)

Thus, scaling and superposition are verified. The filter is time-varying, however, since the time-shifted output is $ y(n-m) =
(n-m) x(n-m) + x(n-m-1)$ which is not the same as the filter applied to a time-shifted input ( $ n x(n-m) + x(n-m-1)$). Note that in applying the time-invariance test, we time-shift the input signal only, not the coefficients.

The filter $ y(n) = c$, where $ c$ is any constant, is nonlinear and time-invariant, in general. The condition for time invariance is satisfied (in a degenerate way) because a constant signal equals all shifts of itself. The constant filter is technically linear, however, for $ c=0$, since $ 0\cdot(\alpha x_1 + \beta x_2) =
\alpha(0\cdot x_1) + \beta(0\cdot x_2) = 0$, even though the input signal has no effect on the output signal at all.

Any filter of the form $ y(n) = b_0x(n) + b_1 x(n - 1)$ is linear and time-invariant. This is a special case of a sliding linear combination (also called a running weighted sum, or moving average when $ b_0=b_1=1/2$). All sliding linear combinations are linear, and they are time-invariant as well when the coefficients ( $ b_0,
b_1,\ldots$) are constant with respect to time.

Sliding linear combinations may also include past output samples as well (feedback terms). A simple example is any filter of the form

$\displaystyle y(n) = b_0 x(n) + b_1 x(n-1) - a_1 y(n-1). \protect$ (5.7)

Since linear combinations of linear combinations are linear combinations, we can use induction to show linearity and time invariance of a constant sliding linear combination including feedback terms. In the case of this example, we have, for an input signal $ x(n)$ starting at time zero,

y(0) &=& b_0 x(0)\\
y(1) &=& b_0 x(1) + b_1 x(0) - a_1 y(0) \...
...(b_1 -a_1 b_0) x(1) - (a_1 b_1 - a_1^2 b_0) x(0)\\
&=& \cdots.

If the input signal is now replaced by $ x_2(n)\isdeftext x(n-m)$, which is $ x(n)$ delayed by $ m$ samples, then the output $ y_2(n)$ is $ y_2(n)=0$ for $ n<m$, followed by

y_2(m) &=& b_0 x(0)\\
y_2(m+1) &=& b_0 x(1) + b_1 x(0) - a_1 ...
...(b_1 -a_1 b_0) x(1) - (a_1 b_1 - a_1^2 b_0) x(0)\\
&=& \cdots,

or $ y_2(n) = y(n-m)$ for all $ n\geq m$ and $ m\geq 0$. This establishes that each output sample from the filter of Eq.$ \,$(4.7) can be expressed as a time-invariant linear combination of present and past samples.

Next Section:
Nonlinear Filter Example: Dynamic Range Compression
Previous Section:
Time-Invariant Filters