Connexions

You are here: Home » Content » Discrete-Time Systems in the Time-Domain
Content Actions
Lenses

What is a lens?

Lenses

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

What is in a lens?

Lens makers point to Connexions 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 Connexions member, a community, or a respected organization.

This content is ...
Affiliated with (?)
This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • This module is included inLens: Rice University Disability Support Services's Lens
    By: Rice University Disability Support ServicesAs a part of collection:"Fundamentals of Electrical Engineering I"

    Comments:

    "Electrical Engineering Digital Processing Systems in Braille."

    Click the "Rice DSS - Braille" link to see all content affiliated with them.

    Rice DSS - Braille
Also in these lenses
  • This module is included inLens: Connexions Books Available for Print on Demand
    By: ConnexionsAs a part of collection:"Fundamentals of Electrical Engineering I"

    Comments:

    "This book was assembled for print in July 07. A braille version of this book is being produced also."

    Click the "Printable Books" link to see all content selected in this lens.

    Printable Books
  • This module is included inLens: richb's DSP resources
    By: Richard BaraniukAs a part of collection:"Signals and Systems"

    Comments:

    "My introduction to signal processing course at Rice University."

    Click the "richb's DSP" link to see all content selected in this lens.

    richb's DSP
Tags

(?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

Discrete-Time Systems in the Time-Domain

Module by: Don Johnson

Summary: Discrete-time systems allow for mathematically specified processes like the difference equation.

A discrete-time signal sn sn is delayed by n0 n0 samples when we write sn-n0 s n n0 , with n0>0 n0 0 . Choosing n0 n0 to be negative advances the signal along the integers. As opposed to analog delays, discrete-time delays can only be integer valued. In the frequency domain, delaying a signal corresponds to a linear phase shift of the signal's discrete-time Fourier transform: sn-n0-2πfn0S2πf s n n0 2f n0 S 2f .
Linear discrete-time systems have the superposition property.
Sa1 x 1 n+ a 2 x 2 n=a1S x 1 n+a2S x 2 n S a1 x 1 n a 2 x 2 n a1 S x 1 n a2 S x 2 n (1)
A discrete-time system is called shift-invariant (analogous to time-invariant analog systems) if delaying the input delays the corresponding output. If Sxn=yn S x n y n , then a shift-invariant system has the property
Sxn-n0=yn-n0 S x n n0 y n n0 (2)
We use the term shift-invariant to emphasize that delays can only have integer values in discrete-time, while in analog signals, delays can be arbitrarily valued.
We want to concentrate on systems that are both linear and shift-invariant. It will be these that allow us the full power of frequency-domain analysis and implementations. Because we have no physical constraints in "constructing" such systems, we need only a mathematical specification. In analog systems, the differential equation specifies the input-output relationship in the time-domain. The corresponding discrete-time specification is the difference equation.
yn=a1yn-1++apyn-p+b0xn+b1xn-1++bqxn-q yn a1 y n1 ap y np b0 xn b1 x n 1 bq x nq (3)
Here, the output signal yn yn is related to its past values yn-l y nl , l=1p l 1 p , and to the current and past values of the input signal xn xn . The system's characteristics are determined by the choices for the number of coefficients pp and qq and the coefficients' values a1ap a1 ap and b0b1bq b0 b1 bq .
aside: There is an asymmetry in the coefficients: where is a0 a0? This coefficient would multiply the yn yn term in Equation 3. We have essentially divided the equation by it, which does not change the input-output relationship. We have thus created the convention that a0 a0 is always one.
As opposed to differential equations, which only provide an implicit description of a system (we must somehow solve the differential equation), difference equations provide an explicit way of computing the output for any input. We simply express the difference equation by a program that calculates each output from the previous output values, and the current and previous inputs.
Difference equations are usually expressed in software with for loops. A MATLAB program that would compute the first 1000 values of the output has the form
      for n=1:1000
          y(n) = sum(a.*y(n-1:-1:n-p)) + sum(b.*x(n:-1:n-q));
      end
    
An important detail emerges when we consider making this program work; in fact, as written it has (at least) two bugs. What input and output values enter into the computation of y1 y1 ? We need values for y0 y0 , y-1 y-1 , ..., values we have not yet computed. To compute them, we would need more previous values of the output, which we have not yet computed. To compute these values, we would need even earlier values, ad infinitum. The way out of this predicament is to specify the system's initial conditions: we must provide the pp output values that occurred before the input started. These values can be arbitrary, but the choice does impact how the system responds to a given input. One choice gives rise to a linear system: Make the initial conditions zero. The reason lies in the definition of a linear system: The only way that the output to a sum of signals can be the sum of the individual outputs occurs when the initial conditions in each case are zero.
Problem 1
The initial condition issue resolves making sense of the difference equation for inputs that start at some index. However, the program will not work because of a programming, not conceptual, error. What is it? How can it be "fixed?"
[ Click for Solution 1 ]
Solution 1
The indices can be negative, and this condition is not allowed in MATLAB. To fix it, we must start the signals later in the array.
[ Hide Solution 1 ]
Example 1 
Let's consider the simple system having p=1 p1 and q=0 q0.
yn=ayn-1+bxn yn a y n1 b xn (4)
To compute the output at some index, this difference equation says we need to know what the previous output yn-1 y n1 and what the input signal is at that moment of time. In more detail, let's compute this system's output to a unit-sample input: xn=δn xn δn . Because the input is zero for negative indices, we start by trying to compute the output at n=0 n 0 .
y0=ay-1+b y0 a y -1 b (5)
What is the value of y-1 y 1 ? Because we have used an input that is zero for all negative indices, it is reasonable to assume that the output is also zero. Certainly, the difference equation would not describe a linear system if the input that is zero for all time did not produce a zero output. With this assumption, y-1=0 y -1 0 , leaving y0=b y0 b . For n>0 n 0 , the input unit-sample is zero, which leaves us with the difference equation n,n>0:yn=ayn-1 n n0 yn a y n1 . We can envision how the filter responds to this input by making a table.
yn=ayn-1+bδn yn a y n1 b δ n (6)
nn xn x n yn y n
-11 00 00
00 11 bb
11 00 ba ba
22 00 ba2 b a2
: 00 :
nn 00 ban b an
Figure 1
Coefficient values determine how the output behaves. The parameter bb can be any value, and serves as a gain. The effect of the parameter aa is more complicated (Figure 1). If it equals zero, the output simply equals the input times the gain bb. For all non-zero values of aa, the output lasts forever; such systems are said to be IIR (Infinite Impulse Response). The reason for this terminology is that the unit sample also known as the impulse (especially in analog situations), and the system's response to the "impulse" lasts forever. If aa is positive and less than one, the output is a decaying exponential. When a=1 a 1 , the output is a unit step. If aa is negative and greater than -11, the output oscillates while decaying exponentially. When a=-1 a 1 , the output changes sign forever, alternating between bb and -bb. More dramatic effects when |a|>1 a 1 ; whether positive or negative, the output signal becomes larger and larger, growing exponentially.
sig21.png
Figure 2: The input to the simple example system, a unit sample, is shown at the top, with the outputs for several system parameter values shown below.
Positive values of aa are used in population models to describe how population size increases over time. Here, nn might correspond to generation. The difference equation says that the number in the next generation is some multiple of the previous one. If this multiple is less than one, the population becomes extinct; if greater than one, the population flourishes. The same difference equation also describes the effect of compound interest on deposits. Here, nn indexes the times at which compounding occurs (daily, monthly, etc.), aa equals the compound interest rate plusone, and b=1 b1 (the bank provides no gain). In signal processing applications, we typically require that the output remain bounded for any input. For our example, that means that we restrict |a|=1 a 1 and chose values for it and the gain according to the application.
Problem 2
Note that the difference equation, yn=a1yn-1++apyn-p+b0xn+b1xn-1++bqxn-q yn a1 y n1 ap y np b0 xn b1 x n1 bq x nq does not involve terms like yn+1 y n1 or xn+1 x n1 on the equation's right side. Can such terms also be included? Why or why not?
[ Click for Solution 2 ]
Solution 2
Such terms would require the system to know what future input or output values would be before the current value was computed. Thus, such terms can cause difficulties.
[ Hide Solution 2 ]
sig22.png
Figure 3: The plot shows the unit-sample response of a length-5 boxcar filter.
Example 2 
A somewhat different system has no "aa" coefficients. Consider the difference equation
yn=1qxn++xn-q+1 y n 1 q x n x n q 1 (7)
Because this system's output depends only on current and previous input values, we need not be concerned with initial conditions. When the input is a unit-sample, the output equals 1q 1q for n=0q-1 n 0 q 1 , then equals zero thereafter. Such systems are said to be FIR (Finite Impulse Response) because their unit sample responses have finite duration. Plotting this response (Figure 3) shows that the unit-sample response is a pulse of width qq and height 1q 1 q . This waveform is also known as a boxcar, hence the name boxcar filter given to this system. We'll derive its frequency response and develop its filtering interpretation in the next section. For now, note that the difference equation says that each output value equals the average of the input's current and previous values. Thus, the output equals the running average of input's previous qq values. Such a system could be used to produce the average weekly temperature ( q=7 q 7 ) that could be updated daily.

Comments, questions, feedback, criticisms?

Discussion forum

Send feedback