Digital signal processing begins with a sequence of numbers and a rule that transforms one sequence into another. In this article, we will examine discrete-time signals, the unit impulse, the impulse response, linearity, and time invariance. We will then add the responses to two impulses and see the idea that leads to convolution.
Every definition is accompanied by examples. You can expand the detailed derivations by selecting their headings; answers to the self-check questions are hidden separately. To follow the article, you only need to understand indices, addition, and multiplication.
What is a discrete-time signal?
Sound in air consists of continuous variations in pressure. During digital recording, the signal is measured at individual points in time. The resulting values are called samples. When measurements are taken at equal intervals, the samples form a sequence that is convenient to process in software.
We denote a continuous-time signal by \(x(t)\), where the argument \(t\) is time. We denote a discrete-time signal by \(x[n]\), where the integer index \(n\) identifies the sample.
Definition: a discrete-time signal is a sequence of values \(x[n]\) defined at integer indices \(n\). The index specifies a position in the sequence, and \(x[n]\) is the value at that position.
Consider four samples:
A compact notation for this segment is \([2;\,5;\,3;\,0]\), provided that the first element is specified to correspond to \(n=0\). The number \(5\) is a signal value, and the number \(1\) in \(x[1]\) is its index. The zero value \(x[3]=0\) is also a sample and occupies its own position in the sequence.
Four samples of a discrete-time signal
In our finite examples, indexing starts at zero. This is a choice of origin: the first recorded element has index \(0\), the second has index \(1\), and the third has index \(2\). A discrete-time signal can also have negative indices, depending on the chosen time origin. Below, we will explicitly state when values before the start of an example are assumed to be zero.
A plot of a discrete-time signal marks individual samples. The sequence itself does not specify values between integer indices. At this stage, we are working with \(x[n]\).
The unit impulse
To investigate a system, it is useful to choose a very simple input signal. Let just one sample equal one, with all other samples equal to zero. This sequence is called the unit impulse and is denoted by the Greek letter \(\delta\), delta.
The definition applies to all integer indices. In particular, \(\delta[-1]=0\), \(\delta[0]=1\), and \(\delta[1]=0\). Written from index zero onward, the sequence is \([1;\,0;\,0;\,\ldots]\). In a plot that includes negative indices, the single one appears in the middle of the displayed segment.
Unit impulse δ[n]
Multiplying by a number \(a\) gives \(a\delta[n]\): the value at index zero is now \(a\), and all other values remain zero. For example, \(2\delta[n]\) starts with \([2;\,0;\,0;\,\ldots]\). Scaling this simple signal will help us understand how a response is scaled.
Here, an impulse is a mathematical discrete-time sequence with a finite value of 1; it does not necessarily correspond to an audible short sound.
The impulse response
A system receives an input sequence and produces an output sequence. Let \(T\) denote its processing rule. The notation \(y=T\{x\}\) means that the system processes the entire input signal \(x\) to produce the output signal \(y\). The notation \(T\{x\}[n]\) denotes a particular sample of that output.
Apply a unit impulse to the input. Assume that the system is initially at rest: it has no stored response to earlier inputs. This condition allows us to associate the observed output with the chosen test signal.
Definition: the impulse response \(h[n]\) is the system's response to a unit impulse under zero initial conditions. The abbreviation IR stands for impulse response.
Suppose that, in our example, the measured or calculated response begins as follows:
For this particular filter, let \(h[n]=0\) when \(n<0\) and when \(n\ge3\). Starting at index zero, its impulse response can be written compactly as \([0.5;\,0.3;\,0.2;\,0;\ldots]\).
The input unit impulse and the filter's impulse response
An input concentrated in one sample has spread across several output samples. A system can retain the influence of an input sample and exhibit it later. The current output can therefore depend on earlier inputs.
\(h[n]\) is the system's response to a unit impulse under zero initial conditions. For an LTI system under these conditions, convolving \(h[n]\) with the input gives the output whenever this convolution is defined.
The three-coefficient sequence was chosen for illustration. The definition of an impulse response does not require every system's response to end after three samples. Here, we have simply fixed a short example that we will scale, shift, and add.
Scaling
What happens if we double the amplitude of the input impulse? The definition of an impulse response alone does not determine the answer. The required system property is called homogeneity: multiplying the entire input signal by a number multiplies the entire response by the same number.
Here, \(a\) is a constant real coefficient, and \(x\) is any admissible input signal. On the left, we first multiply the input samples by \(a\), then process them. On the right, we first process the original signal, then multiply the output samples by \(a\). Homogeneity states that these two results are equal for every \(n\).
Assume that our filter has this property. Its response to \(2\delta[n]\) is then \(2h[n]\). Numerically, this gives:
Doubling the amplitude of the impulse response
The coefficient \(a\) can also be negative: the signs of all output values then change along with the sign of the input. For \(a=0\), homogeneity gives a zero response to a zero input. These conclusions apply to a system with this property, under the same zero initial conditions.
Important: a single example of doubling is insufficient to prove homogeneity. The equality must hold for all admissible inputs and coefficients. Linearity also requires another property: additivity.
Linearity consists of two properties
Additivity means that the response to the sum of two input signals equals the sum of their individual responses:
Signals are added at matching indices: \((x+z)[n]=x[n]+z[n]\). Outputs are added in the same way. Imagine three experiments with the same system: process \(x\), process \(z\), then process \(x+z\) and compare the last result with the sum of the first two. The initial conditions must be identical and zero in all three experiments.
Definition: a system is linear if it is both homogeneous and additive. The two requirements can be combined into one equality for arbitrary signals \(x,z\) and constant real coefficients \(a,b\):
Given homogeneity and additivity, the general equality follows in two steps: first separate the response to \(ax+bz\) into two responses, then factor out \(a\) and \(b\). Conversely, choosing \(a=b=1\) gives additivity, and choosing \(b=0\) gives homogeneity. This is the definition of linearity; it still needs to be verified for a particular algorithm.
Example: averaging two adjacent samples
For the proof, consider a separate, fully specified filter, denoted by \(A\). It computes the average of the current and previous input samples:
For example, if the current sample is 4 and the previous sample is 2, the output is \((4+2)/2=3\). This filter's impulse response begins with \([0.5;\,0.5;\,0;\ldots]\) (this is a different example from the response \([0.5;\,0.3;\,0.2]\) used in the preceding sections).
Proof of linearity for the averaging filter
Let \(u=ax+bz\). By the definitions of sequence addition and scaling:
Substitute these two samples into the averaging rule. We are processing the sum of the inputs, so we have not yet assumed linearity:
Group the terms with matching coefficients:
The last line matches the definition of linearity. We have not fixed the signal values, the coefficients \(a,b\), or the index \(n\). The property is therefore proved for any admissible inputs to this filter.
The averaging filter is linear: it satisfies both scaling and addition of responses. This conclusion follows from its processing rule. Any other system requires its own verification.
Time shifts
A signal can arrive earlier or later relative to the chosen time origin. A delay of an integer number \(d>0\) of samples is written as \(x[n-d]\). To understand the sign, find the nonzero sample of \(\delta[n-d]\): it occurs when \(n-d=0\), or \(n=d\). The minus sign inside the argument therefore indicates a shift to the right, toward later indices.
For example, \(\delta[n-1]\), written from \(n=0\) onward, is \([0;\,1;\,0;\,\ldots]\). The input impulse still has amplitude 1, but now occurs at index 1. For \(\delta[n-2]\), the one appears at index 2.
Time invariance means that if an input \(x\) produces an output \(y\), shifting the entire input causes the same shift of the entire output. The response's shape and values are preserved.
In the general definition, the equality must hold for all admissible signals and integer shifts \(d\). Positive \(d\) denotes a delay; a negative shift moves the signal toward smaller indices. The numerical examples below use delays.
Assume that the system with impulse response \([0.5;\,0.3;\,0.2]\) is time-invariant. Moving the input impulse from index 0 to index 1 then shifts its entire response by one position:
Shifting the impulse response by one sample
The first zero in the lower row follows from our assumption that \(h[n]=0\) at negative indices: \(h[-1]=0\). For a sequence with nonzero values before the displayed segment, a shift is generally not equivalent to prepending zeros. This notation is valid for our causal example.
A system that is both linear and time-invariant is called an LTI system: Linear Time-Invariant. Russian terminology also uses the name “linear stationary system.” Here, stationarity means that the system's rule is unchanged by a time shift.
Time invariance: checking a shift
In the previous section, we stated the property and illustrated its meaning. Now we will verify it using the processing rule of the averaging filter \(A\). We need to compare two results: processing the delayed input and delaying the previously computed output.
Two ways to check time invariance
Proof of time invariance for the averaging filter
Denote the original output by \(y\):
First path: introduce the delayed input \(x_d[n]=x[n-d]\). The previous sample of this new signal is \(x_d[n-1]=x[n-d-1]\). Substitute both values into the filter's rule:
Second path: first compute the original output \(y\), then shift it by \(d\). In the expression for \(y[n]\), replace every occurrence of the index \(n\) with \(n-d\):
The right-hand sides are identical. Thus, \(A\{x_d\}[n]=y[n-d]\) for arbitrary \(x\), \(n\), and integer \(d\). The averaging rule is independent of the chosen time origin.
Both properties are now proved for the averaging filter: it is linear and time-invariant. It is therefore an LTI system.
Counterexample: the coefficient depends on the sample index
Consider another system: \(B\{x\}[n]=n\,x[n]\). At time \(n\), the system multiplies the current input value by \(n\). This processing rule applies to any input sequence.
Delay the input by \(d\): \(x_d[n]=x[n-d]\). At time \(n\), the system receives the value \(x[n-d]\) and multiplies it by the current index \(n\): \(B\{x_d\}[n]=n\,x_d[n]=n\,x[n-d]\). For example, when \(n=5\) and \(d=2\), the input value is \(x[3]\), so the output is \(5x[3]\).
Compare processing the delayed input with shifting the previously computed output. In the second case, replace \(n\) with \(n-d\) throughout the expression \(B\{x\}[n]=n\,x[n]\):
Multiplication by \(n\) is the rule specifically chosen for this system. Its gain depends on the current time: at \(n=3\), the gain is 3; at \(n=5\), it is 5.
Take the sample \(x[3]=10\) and a delay of \(d=2\) samples. Follow the same input value through the two orders of operations:
Delay first, then process. The value 10 reaches the processing stage at time \(n=5\). The system multiplies it by the current index 5 and produces \(5\cdot10=50\).
Process first, then delay. The value 10 is processed at time \(n=3\), giving \(3\cdot10=30\). This result is then delayed by 2 samples and appears at the output at time \(n=5\).
At the same time \(n=5\), the outputs differ: 50 and 30. Processing the delayed input uses the current index \(n\), while delaying the computed output selects the result calculated at \(n-d\). The system is therefore not time-invariant.
Important: linearity and time invariance are separate requirements. The system \(B\{x\}[n]=n\,x[n]\) is linear: the factor \(n\) distributes over a sum and allows the constants \(a,b\) to be factored out. However, its processing depends on the absolute sample index, so it is not an LTI system.
Superposition
Return to the filter with impulse response \([0.5;\,0.3;\,0.2]\) and assume that it is an LTI system. Let the input consist of two impulses: the first has amplitude 1 and is located at \(n=0\); the second has amplitude 2 and is located at \(n=1\). All other input samples are zero.
Let us check why this expression describes the required input signal. The unit impulse \(\delta[n]\) equals 1 at \(n=0\) and 0 at all other integer indices. In \(\delta[n-1]\), the argument becomes zero at \(n=1\), so \(\delta[n-1]=\delta[0]=1\); multiplying by 2 sets the sample value at that index to 2.
- At \(n=0\): \(x[0]=1+2\cdot0=1\).
- At \(n=1\): \(x[1]=0+2\cdot1=2\).
- At every other integer index, both impulses are zero, so \(x[n]=0\).
Thus, starting at \(n=0\), we obtain the sequence \([1;\,2;\,0;\,0;\ldots]\). Values at negative indices are also zero. Both expressions specify the same value at every index.
This representation follows from the definition of the unit impulse and addition of signals at matching indices. We apply the LTI properties when calculating the responses to these impulses.
In a linear system, the superposition principle allows the individual components of an input signal to be processed separately and their responses to be added. For two impulses, we use all the properties discussed so far:
- The unit impulse \(\delta[n]\) produces the response \(h[n]\) by the definition of an impulse response.
- The shifted impulse \(\delta[n-1]\) produces \(h[n-1]\) by time invariance.
- The doubled, shifted impulse \(2\delta[n-1]\) produces \(2h[n-1]\) by homogeneity.
- The response to the sum of the input impulses equals the sum of the two outputs by additivity.
The result is:
Adding two impulse responses
The first four samples can be written in a table. Each column represents the same time for both responses and their sum:
| Index n | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| h[n] | 0.5 | 0.3 | 0.2 | 0 |
| 2h[n−1] | 0 | 1.0 | 0.6 | 0.4 |
| y[n] | 0.5 | 1.3 | 0.8 | 0.4 |
Calculating every output sample step by step
At \(n=0\), the second impulse has not yet arrived. Since \(h[-1]=0\), the contribution of the second response is zero:
At \(n=1\), the first response continues with its second sample, and the second response begins with twice the first coefficient:
At \(n=2\), add the last nonzero sample of the first response to the second sample of the second response:
At \(n=3\), the first response has ended, but the second response still contributes its last nonzero sample:
For \(n<0\) and \(n\ge4\), both terms are zero. The four samples we have found therefore make up the entire nonzero portion of the output.
Thus, from index zero onward, the output is \([0.5;\,1.3;\,0.8;\,0.4;\,0;\ldots]\). The effects of the two input impulses overlap, and their contributions are added at those positions. After the second impulse arrives, the response to the first continues for as long as its own values remain nonzero.
Key takeaways
- A discrete-time signal \(x[n]\) consists of individual samples at integer indices. Starting the indexing at zero is a chosen convention.
- The unit impulse \(\delta[n]\) equals 1 at \(n=0\) and 0 at every other index.
- The impulse response \(h[n]\) is the response to a unit impulse under zero initial conditions.
- Homogeneity allows a response to be scaled along with the input. Additivity allows individual responses to be added. Together, these properties define linearity.
- Time invariance means that shifting the entire input signal causes the same shift of the entire output.
- An LTI system satisfies both requirements: linearity and time invariance. Each must be established separately.
- For an LTI system, the response to several impulses can be obtained by scaling and shifting \(h[n]\), then adding the results at matching indices.
In the next article, we will extend the superposition of two impulses to an arbitrary finite input, decompose it into impulses, and derive the convolution formula.