You are on page 1of 77

DSP-1 (ntro) 1 of 77 Dr.

Ravi Billa
Digital Signal Processing - 1 December 15, 2009

I. Introduction

!""# %&''()*+. Introduction to Digital Signal Processing. Discrete time signals & sequences,
Linear shift invariant svstems, Stabilitv, and Causalitv, Linear constant coefficient difference
equations, Frequencv domain representation of discrete time signals and svstems.

Contents:

1.1 Sampling theory
1.2 Discrete-time signals
1.3 TransIormation oI the independent variable
1.4 Discrete-time systems
1.5 Linear constant coeIIicient diIIerence equations
1.6 Fourier analysis oI discrete-time signals and systems
1.7 Frequency response oI discrete-time system
1.8 Properties oI the discrete-time Fourier transIorm (DTFT)


www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 2 of 77 Dr. Ravi Billa
1.1 Sampling theory

Illustrative example A continuous-time random signal is shown. Based on this several
important concepts are shown below. The signal is a continuous-time signal with continuous
amplitude. Such a signal is also called an analog signal.














x(t)
4 8
3 7
2 6
1 5
0 4 Time
1 3
2 2
3 1
4 0
nT 0 1T 2T 3T 4T 5T 6T 7T 8T Time
n 0 1 2 3 4 5 6 7 8
x(n) 5.5 2.8 3.8 5.3 1.5 4.6 8.4 6.9 7.3
Sampled signal. Discrete-time
signal time is discrete,
amplitude is continuous.
5 2 3 5 1 4
7
6 7
Quantized. Quantization noise
(error). Digital signal both time
and amplitude are discrete.
101 010 011 101 001 100 111 110 111
Encoded to 3 bits/sample.

Note this particular point exhibits saturation (out oI
range). Rounded down to 7, not 8.

II we were to represent every sample value with inIinite precision (Ior example, x(1) 2.8--,
instead oI being approximated as 2 or 3) then we would need registers and memory words oI
arbitrarily large size. However, owing to a Iinite word length we round oII the sample values (in
this case x(1) 2.8-- will be rounded to 2). This introduces quantization noise or error.
x(t)
t


0
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 3 of 77 Dr. Ravi Billa
The procedure oI generating a discrete-time signal Irom an analog signal is shown in the
Iollowing block diagram. In the digital signal processing course we are mostly dealing with
discretetime rather than digital signals and systems, the latter being a subset oI the Iormer.









The three boxes shown above can be represented by an analog to digital converter
(ADC). A complete digital signal processing (DSP) system consists oI an ADC, a DSP algorithm
(e.g., a diIIerence equation) and a digital to analog converter (DAC) shown below.







As the name implies discrete-time signals are deIined only at discrete instants oI time.
Discrete-time signals can arise by sampling analog signals such as a voice signal or a
temperature signal in telemetry. Discrete-time signals may also arise naturally, e.g., the number
oI cars sold on a speciIic day in a year, or the closing DJIA Iigure Ior a speciIic day oI the year.

AT&T`s ,- Stream The voice signal is band limited to 3.3 kHz, sampled at 8000 Hz (8000
samples per second), quantized and encoded into 8 bits per sample. Twenty Iour such voice
channels are combined to Iorm the T1 stream or signal.
Sampling interval
H: 8000
1
0.125 msec.
Bit rate Ior each channel 8000
sec
samples
x 8
sample
bits
64000 bits/sec.
Bit rate Ior T1 64000 bits/sec per channel x 24 channels 1 544 000 bits/sec.

Commercial examples CD, Super Audio CD (SACD), DVD Audio (DVD-A), Digital audio
broadcasting - 32 kHz, and Digital audio tape (DAT) - 48 kHz.

Commercial Audio Examples
CD Super Audio CD
(SACD)
DVD-Audio
(DVD-A)
Sampling
Rate
44.1 kHz 2.8224 MHz 44.1, 88.2 or
48, 96, 192
kHz
Coding 16-bit PCM per sample
With 2 channels the bit rate is 1.4112
Mbits/sec, but additional error control
bits etc., raise it to 4.3218 Mbits/sec.
1-bit DSD
(Direct Stream
Digital - like Delta
modulation)
12-, 20-, 24-
bit

Discrete-time,
continuous
amplitude
Discrete-time,
discrete amplitude
(Digital signal)
Encoded
digital
signal
Continuous-time,
continuous amplitude
(Analog signal)
Sample
(& Hold)

Quantizer

Encoder
x(n) x(t) v(n) v(t)
ADC
Algorithm
(DiII. Eq. or
equivalent)

DAC
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 4 of 77 Dr. Ravi Billa

Pulse-train sampling For pulse-train sampling oI the signal x(t) by the rectangular pulse-train
p(t) resulting in the sampled signal x
s
(t), we have

x
s
(t) x(t) p(t)
The Fourier series oI p(t) is given by p(t)

= n
t F n f
n
s
e C
t 2
,
where F
s
1/T and the Fourier coeIIicients, are
C
n

T
1
}

2 /
2 /
2
) (
T
T
t F n f
dt e t p
s
t

Thus
x
s
(t)

= n
t F n f
n
s
e t x C
t 2
) (
The Fourier spectrum oI x
s
(t) is given by
X
s
(F)
}

dt e t x
t F f
s
t 2
) (
}


dt e e t x C
t F f t F n f
n
s
t t 2 2
) (
Interchanging the order oI integration and summation yields the ('.(+./0 1234*'(
X
s
(F)


n
t nF F f
n
dt e t x C
s
) ( 2
) (
t

=

n
s n
nF F X C ) (
. ) 2 (
2 s
F F X C +

) 1 (
1 s
F F X C +

) (
0
F X C ) 1 (
1 s
F F X C
) 2 (
2 s
F F X C .




















The sampled signal spectrum X
s
(F) is sketched below. For convenience oI illustration we
have assumed the base band spectrum, X(F), to be real valued; the maximum value oI ,X(F), is
taken to be 1. X
s
(F) consists oI replicas oI X(F), scaled by the Fourier coeIIicients C
n
and
repeated at intervals oI F
s
. SpeciIically, the replica at the origin is simply X(F) scaled by C
0
.
Note that the magnitudes, ,C
n
,, have even symmetry. In this case, since F
M
_ F
s
F
M
, there is no
overlap among the replicas in the graph oI X
s
(F). As a result the original signal x(t) can be
x(t)
t
0 T 2T 3T
p(t)
t
0 T 2T 3T
t
1
x(t)
p(t)
x
s
(t)
X
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 5 of 77 Dr. Ravi Billa
recovered by passing x
s
(t) through a low pass Iilter with a bandwidth B that satisIies the
condition F
M
_ B _ F
s
F
M
, and a gain oI 1/C
0
.





















Impulse-train sampling II p(t) is an impulse-train then the Fourier coeIIicients are given by
C
n

T
1
}

2 /
2 /
2
) (
T
T
t F n f
dt e t
s
t
o
T
1
. 1 F
s
Ior all n
so that the aliasing formula becomes
X
s
(F) F
s

=

n
s
nF F X ) (

Alternative derivation It can be shown that
X
s
(fO)
t 2
s
O

=
O O
n
s
n f X )) ( (
s
F

=
O O
n
s
n f X )) ( (
Note that some use the notation X(O) instead oI X(fO), so that the above equation is written as
X
s
(O)
t 2
s
O

=
O O
n
s
n X ) (
s
F

=
O O
n
s
n X ) (

About terminology The highest Irequency in the signal is called the Nvquist frequencv. The
minimum sampling rate that, in theory, allows perIect signal recovery is called the Nvquist rate.
Thus Nyquist rate is twice the Nyquist Irequency.
A signal, however, is generally sampled at more than twice the Nyquist Irequency. One
halI the sampling rate is called the folding frequencv. As an example, iI a voice signal is band
limited to 3.3 kHz and sampled at 8 kHz then the Nyquist Irequency 3.3 kHz, the Nyquist rate
6.6 kHz, and the Iolding Irequency 4 kHz.
To add to the ambiguity, some reIerences use the phrase Nyquist Irequency to reIer to
one halI the sampling rate.

X(F)
F
F
M
0 F
M

1
F
F
M
0 F
M
F
s
F
s
F
s
F
M
F
s
F
M

X
s
(F)
C
0

C
1

C
1

Gain 1/C
0

Bandwidth B
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 6 of 77 Dr. Ravi Billa
Aliasing Illustration using a signal spectrum band-limited to 4 kHz and a sampling rate oI 8 kHz.
The signal is perIectly band-limited to 4 kHz so that there is no overlapping in the spectrum oI
the sampled signal.



































The signal has a genuine, desirable, 1 kHz component. Since it is not perIectly band-limited to 4
kHz it has another genuine but undesirable 7 kHz component. Due to the Iirst pair oI replicas
(centered at 8 kHz and 8 kHz) this 7kHz component appears as iI it were a 1kHz component
in other words the 7 kHz component is an alias oI 1kHz. Thus the Iirst (lowest) alias oI the 1 kHz
Irequency is given by 8 kHz 1 kHz 7 kHz.
Due to the second pair oI replicas at 16 kHz and 16 kHz the 15k component in the
original signal also appears as iI it were a 1k component it is another alias oI the 1k. This
second alias oI the 1 kHz Irequency is given by 16 kHz 1 kHz 15 kHz. The next alias is (3 x
8 1) kHz 23 kHz.
In general, Ior any Irequency F
1
within the base band (in this case any Irequency Irom 0
to 4000 Hz) its aliases are given by

Alias kF
s
F
1
, k is an integer ~ 0
X(F), Base-band signal
F, Hz
0 4k 8k 12k 8k 4k
X
s
(F)
F, Hz
0 4k 8k 12k 8k 4k
X(F)
F, Hz
0 4k 8k 12k 8k 4k
1k signal
7k signal
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 7 of 77 Dr. Ravi Billa

Aliasing example As an example, let a certain base band signal be band-limited to 8 Hz and let
the sampling Irequency be F
s
16 Hz. We do not expect Irequencies higher than 8 Hz. Then Ior
the base band Irequency oI, say, F
1
4 Hz, the aliases, F
2
, are given by

F
2
kF
s
F
1
, k 1, 2, .

Setting k 1 gives the lowest alias oI F
1
, that is, F
2
1 x 16 4 12 Hz. The next alias is 2 x 16
4 28 Hz. Consider two waveIorms with Irequencies oI 4 Hz and 12 Hz given by

x
1
(t) 1 cos 2a4t and x
2
(t) 1 cos 2a12t

The sampled versions are

x
1
(n) cos 2a4nT cos 2a4n(1/16) cos (na/2) and
x
2
(n) cos 2a12nT cos 2a12n(1/16) cos (n3a/2)

whose Iirst Iew samples are tabulated below:

n 0 1 2 3 4 5 6 7
x
1
(n) 1 0 1 0 1 0 1 0
x
2
(n) 1 0 1 0 1 0 1 0

These two sequences are seen to have the same digital Irequency and cannot be distinguished
Irom each other as far as the frequencv is concerned. When passed through a smoothing Iilter,
they will both appear as 4 Hz signals. This is true even iI the amplitudes oI the underlying analog
waveIorms are diIIerent.
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 8 of 77 Dr. Ravi Billa
In MATLAB
































Plot x
1
(t) cos 2a4t as t goes Irom 0 to 0.5 sec (2 cycles) in steps oI T 1/160 sec.
t 0: 1/160: 0.5; x1 cos (2*pi*4*t); plot(t, x1)

x1 cos (2*pi*4*t) 4Hz Cosine plotted at T 1/160 sec.
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1


Plot x
1
(t) cos 2a4t as t goes Irom 0 to 0.5 sec (2 cycles) in steps oI T 1/160 sec.
t 0: 1/160: 0.5; x1 cos (2*pi*4*t); plot(t, x1)

Repeat with step size oI 1/16 sec.
t 0: 1/16: 0.5; x1 cos (2*pi*4*t); plot(t, x1)

Produce samples oI x
1
(t) as t goes Irom 0 to 0.5 in steps oI 1/16 sec.
t 0: 1/16: 0.5; x1 cos (2*pi*4*t)

Produce samples oI x
1
(n) cos na/2 as n goes Irom 0 to 8 (2 cycles) in steps oI 1
(T 1/16 sec.)
n 0: 1: 8; x1 cos (n*pi/2)

Plot x
1
(n) cos na/20 as n goes Irom 0 to 80 (2 cycles) in steps oI 1 (T 1/160 sec.)
n 0: 1: 80; x1 cos (n*pi/20); plot(n, x1, 'bo'); grid Blue circles and grid

Stem plot x
1
(n) cos na/2 as n goes Irom 0 to 8 (2 cycles) in steps oI 1 (T 1/16 sec.)
n 0: 1: 8; x1 cos (n*pi/2); stem(n, x1)

Stem plot x
1
(n) cos na/20 as n goes Irom 0 to 80 (2 cycles) in steps oI 1
(T 1/160 sec.)
n 0: 1: 80; x1 cos (n*pi/20); stem(n, x1)

Titles, labels and grid. Stem plot x
1
(n) cos na/20 as n goes Irom 0 to 80 (2 cycles)
MATLAB won`t accept the kind oI single quote in title Sampled Cosine`
n 0: 1: 80; x1 cos (n*pi/20);
stem(n, x1); title(Sampled Cosine`); xlabel(n`), ylabel(x1`); grid
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 9 of 77 Dr. Ravi Billa

Plot x
1
(n) cos na/20 as n goes Irom 0 to 80 (2 cycles) in steps oI 1 (T 1/160 sec.)
n 0: 1: 80; x1 cos (n*pi/20); plot(n, x1, 'bo'); grid Blue circles and grid

x1 cos (n*pi/20) 4 Hz Cosine sampled at 160 samples per second
0 10 20 30 40 50 60 70 80
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1



Stem plot x
1
(n) cos na/20 as n goes Irom 0 to 80 (2 cycles) in steps oI 1
(T 1/160 sec.)
n 0: 1: 80; x1 cos (n*pi/20); stem(n, x1)

Stem plot oI x1 cos (n*pi/20) 4 Hz Cosine sampled at 160 samples per second
0 10 20 30 40 50 60 70 80
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1



www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 10 of 77 Dr. Ravi Billa
Aliasing and digital frequency With F
s
16 Hz the base band signal must be band-limited to 8
Hz. And we do not expect Irequencies higher than 8 Hz. Consider the 3 signals x
1
(t), x
2
(t), and
x
3
(t) oI Irequencies 4Hz, 12Hz and 28Hz, respectively, where x
2
and x
3
`s Irequencies are the
aliases oI x
1
`s. The continuous and discrete-time signals are given in table below with a sampling
rate oI 16 samples/sec.

Aliasing and Digital Frequency
Analog frequency
Cycles/sec
Analog signal Discrete-time signal Digital frequency
Cycles/sample
4 5
-
678 cos 247 5
-
6/8 cos 2(1/4)/ 0.25
12 5
!
678 cos 2127 5
!
6/8 cos 2(3/4)/ 0.75
28 5
9
678 cos 2287 5
9
6/8 cos 2(7/4)/ 1.75
8 5
:
678 cos 287 5
:
6/8 cos 2(1/2)/ 0.5
16/3 5
;
678 cos 2(16/3)7 5
;
6/8 cos 2(1/3)/ 1/3

II the Nyquist criterion is to be satisIied (Ior perIect signal reconstruction) we never
expect any digital Irequencies higher than 0.5 cycle/sample (or a rad./sample) in the base band
signal. This corresponds to taking 2 samples Ior every cycle (or a digital Irequency oI halI a
cycle per sample) the Nyquist criterion. Digital Irequencies higher than 0.5 cycle/sample (x
2
(n)
and x
3
(n) in this example) are actually disallowed.
When plotted x
1
(n), x
2
(n), and x
3
(n) cannot be distinguished Irom one another as Iar as
the digital Irequency is concerned. They all have a period 4 (samples) and a Irequency oI 0.25
cycle per sample, though we know that x
2
(n) has a Irequency oI 0.75 cycle/sample and x
3
(n) has
a Irequency oI 1.75 cycle/sample.
In general any digital Irequency above 0.5 cycle/sample (a rad./sample) is an alias (or
shows up as an alias oI some base band Irequency). It actually has more cycles per sample than
is apparent in a plot oI the sampled data.
We demonstrate below the phenomenon oI aliasing using the three waveIorms x
1
(t), x
2
(t),
and x
3
(t) and the corresponding sequences x
1
(n), x
2
(n), and x
3
(n).

www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 11 of 77 Dr. Ravi Billa
















































In MATLAB:
Aliasing demo

First---------------------------------------------
Plot the continuous-time waveIorms x
1
(t), x
2
(t), and x
3
(t) over a 1-second interval
t 0: 1/500: 1;
x1 cos (2*pi*4*t); 4 Hz
subplot(3, 1, 1), plot(t, x1, 'b'); subplot(3, 1, 1) 3 rows, 1 column, #1
xlabel ('Time, t, seconds'), ylabel('x1(t)');
title ('4 Hz')
grid;

x2 cos (2*pi*12*t); 12 Hz
subplot(3, 1, 2), plot(t, x2, 'k'); subplot(3, 1, 2) 3 rows, 1 column, #2
xlabel ('Time, t, seconds'), ylabel('x2(t)');
title ('12 Hz')

x3 cos (2*pi*28*t); 28 Hz
subplot(3, 1, 3), plot(t, x3, 'r'); subplot(3, 1, 3) 3 rows, 1 column, #3
xlabel ('Time, t, seconds'), ylabel('x3(t)');
title ('28 Hz')

Second---------------------------------------------
Plot the sequences x
1
(n), x
2
(n), and x
3
(n)
n 0: 1: 16;
4 Hz sampled at 16 Hz
x1 cos (n*pi/2);
subplot(3, 1, 1), stem(n, x1, 'bo'); subplot(3, 1, 1) 3 rows, 1 column, #1
xlabel ('Sample number, n'), ylabel('x1(n)');
title ('4 Hz at 16 samples/sec')
grid;
12 Hz sampled at 16 Hz
x2 cos (3*n*pi/2);
subplot(3, 1, 2), stem(n, x2, 'ko'); subplot(3, 1, 2) 3 rows, 1 column, #2
xlabel ('Sample number, n'), ylabel('x2(n)');
title ('12 Hz at 16 samples/sec')
28 Hz sampled at 16 Hz
x3 cos (7*n*pi/2);
subplot(3, 1, 3), stem(n, x3, 'ro'); subplot(3, 1, 3) 3 rows, 1 column, #3
xlabel ('Sample number, n'), ylabel('x3(n)');
title ('28 Hz at 16 samples/sec')
---------------------------------------------
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 12 of 77 Dr. Ravi Billa

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-1
0
1
Time, t, seconds
x
1
(
t
)
4 Hz
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-1
0
1
Time, t, seconds
x
2
(
t
)
12 Hz
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-1
0
1
Time, t, seconds
x
3
(
t
)
28 Hz



0 2 4 6 8 10 12 14 16
-1
0
1
Sample number, n
x
1
(
n
)
4 Hz at 16 samples/sec
0 2 4 6 8 10 12 14 16
-1
0
1
Sample number, n
x
2
(
n
)
12 Hz at 16 samples/sec
0 2 4 6 8 10 12 14 16
-1
0
1
Sample number, n
x
3
(
n
)
28 Hz at 16 samples/sec



www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 13 of 77 Dr. Ravi Billa
1.2 Discrete-time signals

Definition A discrete-time signal is a sequence, that is, a Iunction deIined on the positive and
negative integers.

The sequence x(n) x
R
(n) f x
I
(n) is a complex (valued) sequence iI x
I
(n) is not zero Ior
all n. Otherwise, it is a real (valued) sequence.
Examples oI discrete-time signals represented in Iunctional Iorm are given below.
(Exercise: Plot these signals Ior several values oI n.)

x
1
(n) 2 cos 3n
x
2
(n) 3 sin (0.2an)

Alternatively, iI a signal is non-zero over a Iinite (small enough) interval, we can list the
values oI the signal as the elements oI a sequence. For example


x
3
(n) 5, 2, 1, 1, 1/2, 4}

|

The arrow indicates the value at n 0. We omit the arrow when the Iirst entry represents the
value Ior n 0. The above sequence is a finite length sequence. It is assumed that all values oI
the signal not listed are zero. In the above example x(0) 1, x(1) 1/2, x(4) x(3) 0, etc.

Definition A discrete-time signal whose values are Irom a Iinite set is called a digital signal.

Classification of discrete-time signals (Along lines similar to continuous-time signals)

6<4.78 =.+>3?7?@7.4? A/?30& (/B C2D?3 +.0/('+ The energv E oI a discrete-time signal x(n) is
given by
E
N
lim

=
N
N n
n x n x ) ( ) (
*

where x
*
is the complex conjugate oI x. II x(n) is a real sequence then x(n) x
*
(n) x
2
(n). The
above deIinition can also be written as
E
N
lim

=
N
N n
n x
2
) ( (there are 2N1 terms here)
The average power P oI the signal is
P
N
lim
1 N 2
1
+

=
N
N n
n x
2
) (
II E is Iinite but non zero (i.e., 0 E ) the signal is an energv signal. It is a power
signal iI E is inIinite but P is Iinite and nonzero (i.e., 0 P ). Clearly, when E is Iinite, P 0.
II E is inIinite P may or may not be Iinite.
II neither E nor P is Iinite, then the signal is neither an energy nor a power signal.
The terms 'power and 'energy are used independently oI whether the
quantity

=
N
N n
n x
2
) ( (or,
}
2
1
2
) (
t
t
dt t x , in the continuous time case) actually is related to physical
energy. Even iI such a relationship exists, these quantities, E (.) and } (.), may have the wrong
dimensions and scaling. Still it is convenient to use these terms in a general Iashion. It is helpIul
to imagine that x(t) or x(n) is the voltage across, or, current through, a 1-ohm resistor.
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 14 of 77 Dr. Ravi Billa

Example 1.2.1 For the signal x(n) 1 Ior all n,
E
N
lim

=
N
N n
n x
2
) (

= n
2
1 which is inIinite energy
P
N
lim
1 N 2
1
+

=
N
N n
n x
2
) (
N
lim
1 N 2
1
+

=
N
N n
2
1
N
lim
1 N 2
1 N 2
+
+
1 which is Iinite
Thus x(n) is a power signal.

Example 1.2.2 For the signal x(n) n both E and P are inIinite. This is neither an energy nor a
power signal.
6A/B 21 <4.78

www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 15 of 77 Dr. Ravi Billa
Examples of discrete-time signals In these examples w(n) and :(n) take on only a Iinite number
oI diIIerent values hence digital. But x(n) and v(n) take on a countable inIinite number oI
values they are not digital. (Figure)


w(n)
Periodic
n
x(n)
Positive n
n
v(n)
Discrete-time
n
:(n)
Non-periodic digital
n
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 16 of 77 Dr. Ravi Billa
Important discrete-time signals II a continuous-time signal x(t) is sampled at T-second
intervals, the result is the sequence x(nT)}. For convenience we shall drop the T and the braces
and use just x(n) to represent the sequence.

1) The unit sample sequence (discrete-time impulse, aka Kronecker delta)

o(n) 1, n 0
0, n = 0
Whereas o(n) is somewhat similar to the continuous-time impulse Iunction o(t) the
Dirac delta we note that the magnitude oI the discrete impulse is Iinite. Thus there are no
analytical diIIiculties in deIining o(n). It is convenient to interpret the delta Iunction as Iollows:

o(argument) 1 when argument 0
0 when argument = 0


2) The unit step sequence

u(n) 1, n > 0
0, n 0

u(argument) 1, iI argument > 0
0, iI argument 0

a) The discrete delta Iunction can be expressed as the Iirst diIIerence oI the unit step Iunction:

o(n) u(n) u(n1)

b) The sum Irom to n oI the o Iunction gives the unit-step:
o(n)
n
0 1 1
1
1
o(nk)
n
0 1 1 k
u(n)
n
0 1 1
1
u(nk)
n
0 k 1
1
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 17 of 77 Dr. Ravi Billa

=
n
k
k) ( o

>
<
0 n iI 1
0 n iI 0
u(n)

Results (a) and (b) are like the continuous-time derivative and integral respectively.

c) By inspection oI the graph oI u(n), shown below, we can write:
u(n) o(n) o(n1) o(n2) .

=

0
) (

o n










d) For any arbitrary sequence x(n), we have

x(n) o(nk) x(k) o(nk)

that is, the multiplication will pick out just the one value x(k).
n
Sum up to here is zero
k
0
k
0 n
Sum up to here is 1
0
o(n)
u(n)
n
o(n1)
1
o(n2)
2
o(n3)
3
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 18 of 77 Dr. Ravi Billa
II we Iind the inIinite sum oI the above we get the siIting property:

=

n
k n n x ) ( ) ( o x(k)


e) We can write x(n) as Iollows:

x(n) . x(1) o(n1) x(0) o(n) x(1) o(n1) x(2) o(n2) .

This can be veriIied to be true Ior all n by setting in turn

., n 2, n 1, n 0, n 1, n 2, etc. ...

The above can be written compactly as
x(n)

=

k
k n k x ) ( ) ( o
This is a weighted-sum oI delayed unit sample Iunctions.

3) The real exponential sequence Consider the Iamiliar continuous time signal
x(n)
n
0 k
x(k)
o(nk)
n
0 k
1
x(k) o(nk)
n
0 k
x(k) o(nk)
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 19 of 77 Dr. Ravi Billa
x(t)
t
e
o

t / t
e

, t > 0
The sampled version is given by setting t nT
x(nT)
nT
e
o
( )
n
T
e
o
, nT > 0
Dropping the T Irom x(nT) and setting
T
e
o
a we can write
x(n)
n
a , n > 0
The sequence can also be deIined Ior both positive and negative n, by simply writing x(n) a
n

Ior all n.

4) The sinusoidal sequence Consider the continuous-time sinusoid x(t)

x(t) A sin 2aF
0
t A sin O
0
t

F
0
and O
0
are the analog Irequency in Hertz (or cycles per second) and radians per second,
respectively. The sampled version is given by

x(nT) A sin 2aF
0
nT A sin O
0
nT

We may drop the T Irom x(nT) and write

x(n) A sin 2aF
0
nT A sin O
0
nT, Ior all n

We may write O
0
T c
0
which is the digital Irequency in radians (per sample), so that

x(n) A sin c
0
n A sin 2af
0
n, Ior all n
0 1 2 3 4 5 6
x(t)
t
e
o
, t > 0
t
1
0 1 2 3 4 5 6
x(n) a
n
u(n)
n
1
a
2

a
3

a
4

a
a
T
e
o

www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 20 of 77 Dr. Ravi Billa

Setting c
0
2af
0
gives f
0
c
0
/2a which is the digital Irequency in cycles per sample. In the
analog domain the horizontal axis is calibrated in seconds; 'second is one unit oI the
independent variable, so O
0
and F
0
are in 'per second. In the digital domain the horizontal axis
is calibrated in samples; 'sample is one unit oI the independent variable, so c
0
and f
0
are in 'per
sample.

Classification of discrete-time signals (cont`d)

Periodic signal The discrete-time signal x(n) is periodic iI, Ior some integer N ~ 0

x(nN) x(n) Ior all n

The smallest value oI N that satisIies this relation is the (fundamental) period oI the signal. II
there is no such integer N, then x(n) is an aperiodic signal.
Given that the continuous-time signal x
a
(t) is periodic, that is, x
a
(t) x
a
(tT
0
) Ior all t,
and that x(n) is obtained by sampling x
a
(t) at T second intervals, x(n) will be periodic iI T
0
/T is a
rational number but not otherwise. II T
0
/T N/L Ior integers N _ 1 and L _ 1 then x(n) has
exactly N samples in L periods oI x
a
(t) and x(n) is periodic with period N.

Periodicity of sinusoidal sequences The sinusoidal sequence sin (2af
0
n) has several major
diIIerences Irom the continuous-time sinusoid as Iollows:

a) The sinusoid x(n) sin (2af
0
n) or sin (c
0
n) is periodic iI f
0
, that is, c
0
/2a, is rational. II f
0
is
not rational the sequence is not periodic. Replacing n with (nN) we get

x(nN) sin (2af
0
(nN)) sin 2af
0
n. cos 2af
0
N cos 2af
0
n. sin 2af
0
N

Clearly x(nN) will be equal to x(n) iI f
0
N m, an integer or f
0
m/N. The Iundamental period is
obtained by choosing m as the smallest integer that yields an integer value Ior N. For example, iI
f
0
15/25, which in reduced Iraction Iorm is 3/5, then we can choose m 3 and get N 5 as the
period. II f
0
is rational then f
0
p/q where p and q are integers. II p/q is in reduced Iraction Iorm
then q is the period as in the above example.
On the other hand iI f
0
is irrational, say f
0
2 , then N will not be an integer, and thus
x(n) is aperiodic.

Note: In expressions like n e sin , fn t 2 sin ,
n f
e
e
and
n f f
e
t 2
we shall reIer to c or f as the
Irequency even when the signal concerned is not periodic by the deIinition above.

b) The sinusoidal sequences sin c
0
n and sin ((c
0
2 tk)n) Ior 0 s c
0
s 2a are identical. This can
be shown using the identity

sin ((c
0
2ak)n) sin (c
0
n2akn)
sin c
0
n cos 2akn cos c
0
n sin 2akn QED

Similarly, cos c
0
n and cos ((c
0
2ak)n) are the same. ThereIore in considering sinusoidal
sequences Ior analysis purposes, c
0
can be restricted to the range 0 s c
0
s a without any loss oI
generality.

c) For a c
0
2a, based on the same trigonometric identities,
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 21 of 77 Dr. Ravi Billa

sin c
0
n is the negative oI sin ((2ac
0
)n), and
cos c
0
n is the same as cos ((2ac
0
)n)

The sum of two discrete-time periodic sequences is also periodic. Let x(n) be the sum oI two
periodic sequences, x
1
(n) and x
2
(n), with periods N
1
and N
2
respectively. Let p and q be two
integers such that

pN
1
qN
2
N (p and q can always be Iound)

Then x(n) is periodic with period N since, Ior all n,

x(nN) x
1
(nN) x
2
(nN)
x
1
(npN
1
) x
2
(nqN
2
)
x
1
(n) x
2
(n)
x(n) Ior all n

Odd and even sequences The signal x(n) is an even sequence iI x(n) x(n) Ior all n, and is an
odd sequence iI x(n) x(n) Ior all n.















The even part oI x(n) is determined as x
e
(n)
2
) ( ) ( n x n x +
and the odd part oI x(n) is given by
x
o
(n)
2
) ( ) ( n x n x
. The signal x(n) then is given by x(n) x
e
(n)x
o
(n).

x(n) (Even)
n
0
2
2
1
x(n) (Odd)
n
0
2
2 1
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 22 of 77 Dr. Ravi Billa
Example 1.2.3 Plot the sequences x
1
(n) 2 cos n and x
2
(n) 2 cos (0.2an). What are their
'Irequencies? Which oI them is truly periodic and what is its periodicity?
Solution The MATLAB program segment Iollows:

N 21; n 0: N-1;

Nonperiodic
x1 2*cos(1*n);
subplot(2, 1, 1), stem(n, x1);
xlabel('n'), ylabel('x1'); title('x1 2 cos 1n');

Periodic
x2 2*cos(0.2*pi*n);
subplot(2, 1, 2), stem(n, x2);
xlabel('n'), ylabel('x2'); title('x2 2 cos 0.2\pi n');


0 2 4 6 8 10 12 14 16 18 20
-2
-1
0
1
2
n
x
1
x1 = 2 cos 1n
0 2 4 6 8 10 12 14 16 18 20
-2
-1
0
1
2
n
x
2
x2 = 2 cos 0.2t n



www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 23 of 77 Dr. Ravi Billa
Example 1.2.4 Plot the sequence x
3
(n) n
n
t 2 . 0 cos ) 9 . 0 ( 2 .
Solution The MATLAB program segment Iollows:

n |0: 30|;

'.` stands Ior element-by-element exponentiation
'.* stands Ior element-by-element multiplication
x3 2* ((0.9) .`n) .*cos(0.2*pi*n);
stem(n, x3);
xlabel('n'), ylabel('x3'); title('Sequence x3(n)');


0 5 10 15 20 25 30
-1.5
-1
-0.5
0
0.5
1
1.5
2
n
x
3
Sequence x3(n)



1.3 Transformation of the independent variable

Shifting and folding (reflecting about the vertical axis) Given the sequence x(n), where n is
the independent variable, we have the Iollowing two transIormation operations:

- Shifting in time by k units, where k is an integer, is denoted by x(nk). The
sequence x(nk) represents the sequence x(n) shiIted by k samples, to the right iI k
is positive, or to the leIt iI k is negative. Parenthesize n and replace it by (nk) Ior
k units oI delay, or by (nk) Ior k units oI time advancement.
- Folding (a.k.a. time reversal or reflecting about the vertical axis) is denoted by
x(n). The signal x(n) corresponds to reIlecting x(n) about the time origin n 0.
Reverse the sign oI n (replace n with n).

www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 24 of 77 Dr. Ravi Billa
As in the case oI continuous-time signals the operations oI shiIting and Iolding are not
commutative. In other words, the result oI Iirst shiIting and then Iolding is not the same as that oI
Iirst Iolding and then shiIting.
A third operation is scaling, oI which more will be said in a later unit.

Example 1.3.1 Delta function] Given the delta Iunction o(n), Iirst reIlect then shiIt (delay) by 2
units. The other possibility is Iirst to shiIt (delay) by 2 units and then reIlect.
The result oI 'reIlect then shiIt is shown below leIt. Reflect means to change the sign oI
n; then shifting is done by replacing (n) by (n2). The result is: (1) o(n) o(n) and (2) o(n)
o((n)) o((n2)) o(n2).































To continue the example, the second possibility, the result oI 'shiIt then reIlect is shown above
right. Shift means replacing (n) by (n2); then reflect by changing the sign oI n. The result is o(
n2). The result is: (1) o(n) o((n)) o((n2)) and (2) o((n2)) o(n2) o(n2).
Note that the two end results are not the same. This serves to illustrate that the two
operations oI shiIting and reIlecting are not commutative:

Fold(ShiIt(o(n))) = ShiIt(Fold(o(n)))



2
o(n2)
|Delayed|
n
0
1
o(n2)
|Delayed & reIlected|
n
0 2
1
o(n)
n
0
1
o(n)
n
0
1
1
o(n)
|ReIlected|
n
0
o((n2)) o(n2)
|ReIlected & delayed|
n
0
1
2
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 25 of 77 Dr. Ravi Billa
1.4 Discrete-time systems

Definition A B.+>3?7?@7.4? +&+7?4 is a mapping Irom the set oI acceptable discrete-time signals,
called the input set, to a set oI discrete-time signals called the output set.

Definition A discrete-time system is B?7?34./.+7.> iI its output to a given input does not depend
upon some random phenomenon. II it does, the system is called a 3(/B24 6+72>E(+7.>8 +&+7?4.

Definition A B.0.7(' +&+7?4 is a mapping which assigns a digital output signal to every
acceptable digital input signal.

A discrete-time system can be thought oI as a transIormation or operator, T, that maps an
input sequence x(n) to an output sequence v(n) shown thus:





In what Iollows we Iocus on the presence or absence oI the Iollowing properties in
discrete-time systems: linearity, shiIt invariance, causality and stability.

Filter Some reIer to a linear time-invariant (LTI) system simply as a filter, that is, a Iilter is a
system T with a single input and a single output signal that is both linear and time-invariant.


1.4.1 Linearity

Definition A discrete-time system T|.| is linear iI the response to a weighted sum oI inputs x
1
(n)
and x
2
(n) is a weighted sum (with the same weights) oI the responses oI the inputs separately Ior
all weights and all acceptable inputs. Thus the system v(n) T|x(n)| is linear iI Ior all a
1
, a
2
,
x
1
(n) and x
2
(n) we have

T|a
1
x
1
(n)a
2
x
2
(n)| a
1
T|x
1
(n)| a
2
T|x
2
(n)|

Another way oI saying this is that iI the inputs x
1
(n) and x
2
(n) produce the outputs v
1
(n)
and v
2
(n), respectively, then the input a
1
x
1
(n) a
2
x
2
(n) produces the output a
1
v
1
(n) a
2
v
2
(n).
This is called the superposition principle. The a
1
, a
2
, x
1
(n) and x
2
(n) may be complex-valued.
The above deIinition combines two properties, viz.,

1. Additivity, that is, T|x
1
(n)x
2
(n)| T|x
1
(n)| T|x
2
(n)|, and
2. Scaling (or homogeneity), that is, T|c x(n)| c T|x(n)|

The procedure oI checking Ior linearity is:

1. Find outputs v
1
(n) and v
2
(n) corresponding to inputs x
1
(n) and x
2
(n)
2. Form the sum a
1
v
1
(n) a
2
v
2
(n)
3. Find output v
3
(n) corresponding to input a
1
x
1
(n) a
2
x
2
(n)
4. Compare the results oI steps 2 and 3

Examples oI linear systems:

v(n) T|x(n)| x(n)

T|.|
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 26 of 77 Dr. Ravi Billa
1. v(n) x(n) x(n1) x(n2)
2. v(n) v(n1) x(n)
3. v(n) 0
4. v(n) n x(n) (But time-varying)

Examples oI nonlinear systems:

1. v(n) x
2
(n)
2. v(n) 2 x(n)3. This is a './?(3 ?F*(7.2/ though! This system is made up oI a
linear part, 2 x(n), and a zero-input response, 3. This is called an ./>3?4?/7(''&
'./?(3 +&+7?4, Ior it responds linearly to changes in the input.

Example 1.4.1 Determine iI the system v(n) T|x(n)| x(n) is linear or nonlinear.





Answer Determine the outputs v
1
(.) and v
2
(.) corresponding to the two input sequences x
1
(n) and
x
2
(n) and Iorm the weighted sum oI outputs:

v
1
(n) T|x
1
(n)| x
1
(n)
v
2
(n) T|x
2
(n)| x
2
(n)

The weighted sum oI outputs a
1
x
1
(n) a
2
x
2
(n) (A).
Next determine the output v
3
due to a weighted sum oI inputs:

v
3
(n) T|a
1
x
1
(n) a
2
x
2
(n)| a
1
x
1
(n) a
2
x
2
(n) (B)

Check iI (A) and (B) are equal. In this case (A) and (B) are equal; hence the system is
linear.

Example 1.4.2 Examine v(n) T|x(n)| x(n) n x(n1) Ior linearity.





Answer The outputs due to x
1
(n) and x
2
(n) are:

v
1
(n) T|x
1
(n)| x
1
(n) n x
1
(n1)
v
2
(n) T|x
2
(n)| x
2
(n) n x
2
(n1)

The weighted sum oI outputs a
1
x
1
(n) a
1
n x
1
(n1) a
2
x
2
(n) a
2
n x
2
(n1) (A)
The output due to a weighted sum oI inputs is

v
3
(n) T|a
1
x
1
(n) a
2
x
2
(n)|
a
1
x
1
(n) a
2
x
2
(n) n (a
1
x
1
(n1) a
2
x
2
(n1))
a
1
x
1
(n) a
2
x
2
(n) n a
1
x
1
(n1) n a
2
x
2
(n1) (B)

Since (A) and (B) are equal the system is linear.
v(n) T|x(n)| x(n)
x(n)

T|.|
v(n) T|x(n)| x(n) n x(n1)
x(n)

T|.|
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 27 of 77 Dr. Ravi Billa

Example 1.4.3 Check the system v(n) T|x(n)| n
) (n x
e Ior linearity.




Answer The outputs due x
1
(n) and x
2
(n) are:
v
1
(n) T|x
1
(n)| n
) (
1
n x
e
v
2
(n) T|x
2
(n)| n
) (
2
n x
e
The weighted sum oI the outputs a
1
n
) (
1
n x
e a
2
n
) (
2
n x
e (A)
The output due to a weighted sum oI inputs is
v
3
(n) T|a
1
x
1
(n) a
2
x
2
(n)| n
) ( ) (
2 2 1 1
n x a n x a
e
+
(B)

We can speciIy a
1
, a
2
, x
1
(n), x
2
(n) such that (A) and (B) are not equal. Hence nonlinear.

Example 1.4.4 Check the system v(n) T|x(n)| a
n
cos(2an/N) Ior linearity.




Answer Note that the input is x(n). Clearly v(n) is independent oI x(n). The outputs due to x
1
(n)
and x
2
(n) are:

v
1
(n) T|x
1
(n)| a
n
cos (2an/N)
v
2
(n) T|x
2
(n)| a
n
cos (2an/N)

The weighted sum oI the outputs b
1
a
n
cos (2an/N) b
2
a
n
cos (2an/N) (A)
The output due to a weighted sum oI inputs is
v
3
(n) T|b
1
x
1
(n) b
2
x
2
(n)| a
n
cos (2an/N) (B)
(A) and (B) are not equal, so the system is not linear. (But (A) (b
1
b
2
) a
n
cos (2an/N) and this is
equal to (B) within a constant scaling Iactor.)

Example 1.4.5 Check the system v(n) T|x(n)| n x(n) Ior linearity.




Answer For the two arbitrary inputs x
1
(n) and x
2
(n) the outputs are
y
1
(n) T|x
1
(n)| n x
1
(n)
y
2
(n) T|x
2
(n)| n x
2
(n)
For the weighted sum oI inputs a
1
x
1
(n) a
2
x
2
(n) the output is
y
3
(n) T|a
1
x
1
(n) a
2
x
2
(n)| n (a
1
x
1
(n) a
2
x
2
(n))
a
1
n x
1
(n) a
2
n x
2
(n)
a
1
y
1
(n) a
2
y
2
(n). Hence the system is linear.

Example 1.4.6 Check y(n) T|x(n)| x
2
(n) Ior linearity.
Answer For x
1
(n), the output is y
1
(n) ) (
2
1
n x and Ior x
2
(n), y
2
(n ) ) (
2
2
n x .
The weighted sum oI outputs a
1
) (
2
1
n x a
2

) (
2
2
n x (A)
The output due to a weighted sum oI inputs is
x(n) v(n) a
n
cos (2an/N)
T|.|
v(n) T|x(n)| n
) (n x
e
x(n)

T|.|
x(n) v(n) n x(n)
T|.|
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 28 of 77 Dr. Ravi Billa
y
3
(n) T|a
1
x
1
(n) a
2
x
2
(n)|
2
1
a ) (
2
1
n x
2
2
a a
2
2
) (
2
2
n x 2 a
1
a
2
x
1
(n) x
2
(n) (B)
It is possible to speciIy a
1
, a
2
, x
1
(n), and x
2
(n) so that (A) and (B) are not equal. Hence the system
is nonlinear.

Example 1.4.7 Determine iI y(n) T|x(n)| 2 x(n) 3 is linear.
Answer For x
1
(n), the output is y
1
(n) 2 x
1
(n) 3 and Ior x
2
(n), it is y
2
(n) 2 x
2
(n) 3.
Weighted sum oI outputs a
1
(2 x
1
(n) 3) a
2
(2 x
2
(n) 3)
2 a
1
x
1
(n) 3 a
1
2 a
2
x
2
(n) 3 a
2
(A)
The output due to a weighted sum oI inputs is
y
3
(n) T|a
1
x
1
(n) a
2
x
2
(n)| 2 (a
1
x
1
(n) a
2
x
2
(n)) 3
2 a
1
x
1
(n) 2 a
2
x
2
(n) 3 (B)
It is possible to speciIy a
1
, a
2
, x
1
(n), and x
2
(n) such that (A) and (B) are unequal. Hence the
system is nonlinear.
(Since the output y(n) 3 iI x(n) 0 we see that the system violates the ~zero-in / zero-
out property oI linear systems. Hence nonlinear.)

Example 1.4.8 Determine iI y(n) T|x(n)| Rex(n)} is linear.
Answer Note that the input signals as well as the scaling constants a
1
and a
2
are allowed to be
complex. Let x
1
(n) r(n) j s(n). Then y
1
(n) Rex
1
(n)} r(n).
The scaling / homogeneity property says that, iI the response to x
1
(n) is y
1
(n), then the
response to x
2
(n) a.x
1
(n) is a.y
1
(n) where a is anv constant. Let a j, and choose x
2
(n) a.x
1
(n)
j.x
1
(n) j.(r(n) j s(n)) s(n) j r(n). The corresponding output is y
2
(n) Rex
2
(n)} s(n).
Thus iI y
1
(n) T|.| T|x
1
(n)| r(n), then
y
2
(n) T|.| T|x
2
(n)| T|j x
1
(n)| s(n).
This is not equal to f r(n) as would be expected Irom the homogeneity property. Hence the
system is nonlinear.


1.4.2 Shift-invariance (time-invariance)

Definition A discrete time system v(n) T|x(n)| is shiIt-invariant iI, Ior all x(n) and all n
0
, we
have: T|x(nn
0
)| v(nn
0
).

This means that applying a time delay (or advance) to the input oI a system is equivalent
to applying it to the output.




The procedure Ior determining shiIt-
invariance is:

Step 1. Determine output v(n) corresponding to input x(n).
Step 2. Delay the output v(n) by n
0
units, resulting in v(nn
0
).
Step 3. Determine output v(n, n
0
) corresponding to input x(nn
0
).
Step 4. Determine iI v(n, n
0
) v(nn
0
). II equal, then the system is shiIt-invariant;
otherwise it is time-varying.

When we suspect that the system is time-varying a very useIul alternative approach is to
Iind a counter-example to disprove time-invariance, i.e., use intuition to Iind an input signal Ior
y(n) T[x(n)] x(n)

T|.|
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 29 of 77 Dr. Ravi Billa
which the condition oI shiIt-invariance is violated and that suIIices to show that a system is not
shiIt-invariant.

Example 1.4.9 Test iI v(n) T|x(n)| x(n) is shiIt-invariant.






Answer Find output Ior x(n), delay it by n
0
, and compare with the output Ior x(n-n
0
). The output
Ior x(n) is

y(n) T|x(n)| x(n)

Delaying y(n) by n
0
gives

y(nn
0
) x((nn
0
)) x(nn
0
) (A)

As an aside this amounts to reIlecting Iirst and then shiIting.
The output Ior x(nn
0
) is denoted y(n, n
0
) and is given by

y(n, n
0
) T|x(nn
0
)| x(nn
0
) (B)

As an aside this amounts to shiIting Iirst and then reIlecting.
(A) and (B) are not equal. That is, y(n, n
0
) = y(nn
0
), so the system is time-varying.

Example 1.4.10 Examine y(n) T|x(n)| x(n) n x(n1) Ior time invariance.
Answer Notice that the diIIerence equation has a time-varying coefficient, n. The output y(n)
corresponding to x(n) is already given above. Delaying y(n) by n
0
gives

y(nn
0
) x(nn
0
) (nn
0
) x(nn
0
1) (A)

Compare with y(n, n
0
) T|x(nn
0
)| x(nn
0
) n x(nn
0
1) (B)

(A) = (B), so the system is time varying.

Example 1.4.11 Check Ior time invariance oI the system y(n) T|x(n)| n x(n).
Answer We shall do this by counterexample(s) as well as by the Iormal procedure. The Iormal
procedure is:

y(n) T|x(n)| n x(n)

Delay this by n
0
to get y(nn
0
) (nn
0
) x(nn
0
) (A)

Compare with y(n, n
0
) T|x(nn
0
)| n x(nn
0
) (B)

Since (A) = (B), the system is time-varying.

y(n) x(n)
x(n)

T|.|
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 30 of 77 Dr. Ravi Billa
Alternative We expect that it is time varying since the equation has a time varying coeIIicient.
Find a counter example to show that the system is time varying. For input x(n) o (n), the output
is
y(n) n o(n) 0 Ior all n

For input x(n1) o(n1), the output is

y(n, 1) n o(n1) 1 o(n1)

Thus while x(n1) is a shiIted version oI x(n), y(n, 1) is not a shiIted version oI y(n). So the
system is time-varying.

Another counter-example II x(n) u(n), then

y(n) n u(n)

But iI the input is x(n2) u(n2), then

y(n, 2) n u(n2) (n22) u(n2) (n2) u(n2) 2 u(n2)

Delayed version Extra term
The extra term shows that y(n, 2) = y(n2). So the system is time-varying.

Example 1.4.12 Check Ior time invariance the system y(n) T|x(n)| cos (x(n)).
Answer The output y(n) corresponding to input x(n) is

y(n) T|x(n)| cos (x(n))

Delay this output by n
0
to get y(nn
0
) cos (x(nn
0
)) (A)

For the input x(nn
0
) the output is
y(n, n
0
) T|x(nn
0
)| cos (x(nn
0
)) (B)

Since (A) and (B) are equal we have y(n, n
0
) y(nn
0
). ThereIore the system is time-invariant.

Example 1.4.13 The system y(n) T|x(n)| g(n) x(n) needs to be tested Ior time-invariance.
Answer Note that the coeIIicient g(n) is time-varying. Hence, the system is time-varying. The
output y(n) due to input x(n) is

y(n) T|x(n)| g(n) x(n)

Delay this by n
0
to get y(nn
0
) g(nn
0
) x(nn
0
) (A)
The output y(n, n
0
) corresponding to x(n-n
0
) is given by

y(n, n
0
) T|x(nn
0
)| g(n) x(nn
0
) (B)

(A) = (B), i.e., y(n, n
0
) = y(nn
0
). Hence, the system is time-varying.

Example 1.4.14 Check Ior timeinvariance the system y(n) a
n
cos (2an/N).
Answer The output consists simply oI a time-varying coeIIicient and is independent oI the input
x(n). The output y(n) due to input x(n) is
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 31 of 77 Dr. Ravi Billa

y(n) T|x(n)|
n
a cos (2an/N)

Delay this by n
0
to get y(nn
0
)
0
n n
a

cos (2a(nn
0
)/N) (A)
The output v(n, n
0
) due to input x(nn
0
) is given by

y(n, n
0
) T|x(nn
0
)|
n
a cos (2an/N) (B)

(A) = (B), that is, y(n, n
0
) = y(nn
0
). Hence, the system is time-varying.

Example 1.4.15 Check the system y(n) n
) (n x
e Ior time-invariance.
Answer Note time-varying coeIIicient, n. The output v(n) due to input x(n) is
v(n) T|x(n)| n
) (n x
e
Delay this by n
0
to get y(nn
0
) (nn
0
)
) (
0
n n x
e

(A)
The output y(n, n
0
) due to input x(nn
0
) is given by
y(n, n
0
) T|x(nn
0
)| n
) (
0
n n x
e

(B)

(A) and (B) are not equal. Hence, the system is time-varying.

Example 1.4.16 Test the system v(n) x(2n) Ior time-invariance.






Answer This system represents 7.4? +>('./0. That is, v(n) is a time-compressed version oI x(n),
compressed by a Iactor oI 2. For example, the value oI x that occurred at 2n is occurring at n in
the case oI v. Intuitively, then, any time shiIt in the input will also be compressed by a Iactor oI
2, and it is Ior this reason that the system is not timeinvariant.
This is demonstrated by counter-example (Oppenheim & Willsky, p. 52). It can also be
shown by Iollowing the Iormal procedure, which we shall do Iirst below. For the input x(n) the
output is
v(n) T|x(n)| x(2n)

Delay this output by n
0
to get

v(nn
0
) x(2(nn
0
)) x(2n2n
0
) (A)

Next, Ior the input x(n) x(nn
0
) the output is

v(n, n
0
) x(2n) x(2nn
0
) (B)

(A) and (B) are not equal. So the system is not time-variant.

By counter example To show that the system v(n) x(2n) is not timeinvariant by way oI a
counter example consider the x(n) below:

x(n) 1, 2 _ n _ 2
v(n) T|x(n)| x(2n) x(n)
T|.|
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 32 of 77 Dr. Ravi Billa
0, otherwise
We shall show that v(n, 2) = v(n2). We express x(n) in terms oI unit step Iunctions as

x(n) u(n2) u(n3)

We determine v(n2) by Iirst obtaining v(n) and then delaying it by 2 units:
v(n) v(n) x(2n) u(2n2) u(2n3)
Delay v(n2) x(2(n2)) u(2(n2)2) u(2(n2)3) u(2n2) u(2n7)

Next we determine v(n, 2) by Iirst obtaining x(n2) and then the corresponding output v(n, 2):
x(n2) x(n2) u((n2)2) u((n2)3) u(n) u(n5) x
2
(n), say
y(n, 2) v(n, 2) x
2
(2n) u(2n) u(2n5)

We can easily sketch v(n, 2) and v(n2) and see that v(n, 2) = v(n2), and thereIore the system
v(n) x(2n) is not timeinvariant.
Alternatively, this can be done entirely graphically.


1.4.3 Application of linearity - Convolution

An arbitrary sequence, x(n), can be written as the weighted sum oI delayed unit sample
Iunctions:
x(n) . x(2) o(n2) x(1) o(n1) x(0) o(n) x(1) o(n1) .

=

k
k n k x ) ( ) ( o
So the response oI a linear system to input x(n) can be written down using the linearity
principle, i.e., linear superposition. For a linear shiIt-invariant system whose impulse response is
T|o(n)| h(n) the reasoning goes like this

- For an input o(n) the output is h(n). For an input x(0) o(n) the output is x(0) h(n)
by virtue oI scaling.
- For an input o(n1) the output is h(n1) by virtue oI shiIt-invariance. For an input
x(1) o(n1) the output is x(1) h(n1) by virtue oI scaling.
- ThereIore Ior an input oI x(0) o(n) x(1) o(n1) the output is x(0) h(n) x(1) h(n
1) by virtue oI additivity.

This reasoning can be extended to cover all the terms that make up x(n). In general the
response to x(k) o(nk) is given by x(k) h(nk).

Given that
LSI System
T|.|
T|o(n)| h(n) o(n)
LSI System
T|.|
T|x(n)| v(n) x(n)
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 33 of 77 Dr. Ravi Billa
h(n) T|o(n)|, and x(n)

=

k
k n k x ) ( ) ( o
we have
v(n) T|x(n)| T
(

= k
k n k x ) ( ) ( o
Since T|.| is linear we can apply linearity a countable inIinite number oI times to write
v(n) | |

=

k
k n k x T ) ( ) ( o

=

k
k n T k x )| ( | ) ( o
In above equation since the system is shiIt-invariant we write T|o(nk)| h(nk). Else write
h
k
(n) or h(n, k) in place oI h(nk). Thus Ior a linear shiIt-invariant system
v(n)

=

k
k n h k x ) ( ) (
Note that iI the system is not speciIied to be shiIt-invariant we would leave the above
result in the Iorm
v(n)

= k
k n h k x ) , ( ) ( or v(n)

= k
k
n h k x ) ( ) (
Then iI shiIt-invariance is invoked we replace h(n, k) with h(nk).
As in the case oI continuous-time systems, the impulse response, h(n), is determined
assuming that the system has no initial energy; otherwise the linearity property does not hold, so
that v(n), as determined using the above equation, corresponds to only the Iorced response oI the
system.
The sum

= k
k n h k x ) , ( ) ( is called the convolution sum, and is denoted x(n) * h(n).
A discrete-time linear shift-invariant svstem is completelv characteri:ed by its unit
sample response h(n).

Theorem II a discrete-time system linear shiIt-invariant, T|.|, has the unit sample response
T|o(n)| h(n) then the output v(n) corresponding to any input x(n) is given by
v(n)

=

k
k n h k x ) ( ) (

=

k
k h k n x ) ( ) (


The second summation is obtained by setting m nk; then Ior k we have m , and Ior
k we have m . Thus

=

k
k n h k x ) ( ) (


=

m
m h m n x ) ( ) (

=

k
k h k n x ) ( ) (






m is a dummy variable. The order oI summation
(Iorward or backward) makes no diIIerence.
Hence change m to k and switch limits
x(n) * h(n) h(n) * x(n)
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 34 of 77 Dr. Ravi Billa
Example 1.4.17 |Linear Convolution] Given the input x(n)} 1, 2, 3, 1} and the unit sample
response h(n)} 4, 3, 2, 1} Iind the response v(n) x(n) * h(n).
Answer Since x(k) 0 Ior k 0 and h(n k) 0 Ior k ~ n, the convolution sum becomes
v(n)

=

k
k n h k x ) ( ) (

=

n
k
k n h k x
0
) ( ) (
Now v(n) can be evaluated Ior various values oI n; Ior example, setting n 0 gives v(0). See
table below. The product terms shown in )2'B .7('.>+ need not be calculated; they are zero
because the signal values involved are zero.

Linear Convolution of x(n)] 1, 2, 3, 1] and h(n)] 4, 3, 2, 1]
y(n)

=

n
k
k n h k x
0
) ( ) (
n 0
y(0)

=

0
0
) 0 ( ) (
k
k h k x
x(0) h(0)
1 . 4 4
n 1
y(1)

=

1
0
) 1 ( ) (
k
k h k x
x(0) h(1) x(1) h(0)
1 . 3 2 . 4 11
n 2
y(2)

=

2
0
) 2 ( ) (
k
k h k x
x(0) h(2) x(1) h(1) x(2) h(0)
1 . 2 2 . 3 3 . 4 20
n 3
y(3)

=

3
0
) 3 ( ) (
k
k h k x
x(0) h(3) x(1) h(2) x(2) h(1) x(3) h(0)
1 . 1 2 . 2 3 . 3 1 . 4 18
n 4
y(4)

=

4
0
) 4 ( ) (
k
k h k x
x(0) E6:8 x(1) h(3) x(2) h(2) x(3) h(1) 56:8 h(0)
1 . 0 2 . 1 3 . 2 1 . 3 0 . 4 11
n 5
y(5)

=

5
0
) 5 ( ) (
k
k h k x
56"8 E6;8 G 56-8 E6:8 x(2) h(3) x(3) h(2) 56:8 E6-8
G 56;8 E6"8
3 . 1 1 . 2 5
n 6
y(6)

=

6
0
) 6 ( ) (
k
k h k x
56"8 E6H8 G 56-8 E6;8 G 56!8 E6:8 x(3) h(3) 56:8 E6!8
G 56;8 E6-8 G 56H8 E6"8
1 . 1 1
n 7
y(7)

=

7
0
) 7 ( ) (
k
k h k x
56"8 E6#8 G 56-8 E6H8 G 56!8 E6;8 G 5698 E6:8 G 56:8 E698
G 56;8 E6!8 G 56H8 E6-8 G 56#8 E6"8
0
y(n) 0 Ior n 0 and n ~ 6

Product terms in )2'B .7('.>+ are zero.


www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 35 of 77 Dr. Ravi Billa


Sketches oI the two sequences x(n) and h(n) are shown below.





















To do the convolution we need the sequences x(k) and h(nk), k being the independent
variable. OI these x(k) is simply x(n) with k replacing n, shown below.





















The sequence h(k) is the reIlected version oI h(k). II h(k) is delayed by n samples we get h(
(kn)) that is h(nk), shown above.
For each value oI n the sequences x(k) and h(nk) are multiplied point by point and the
products are added, yielding the value oI v (.) Ior the corresponding n.
x(n) 0, n 0 & ~ 3
1
1
2
3
x(n)
1 0 2 3
n
h(n)
h(n) 0, n 0 & ~ 3
1 0 2 3
n
2
3
4
1
3
4
h(nk) h((kn))
h(nk) 0, k ~ n
n1 n
k
----
1 1
2
3
x(k)
x(k) 0, k 0
1 0 2 3
k
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 36 of 77 Dr. Ravi Billa

Tabular method The Iollowing tabular method uses the second oI the two Iorms, viz., y(n)

) ( ) ( k n x k h , Ior the convolution sum.



Tabular method of linear convolution
k 3 2 1 0 1 2 3 4 5 6 7
h(k) 4 3 2 1
n x(k) 1 2 3 1 n y(n)
0 x(0k) 1 3 2 1 0 4
1 x(1k) 1 3 2 1 1 11
2 x(2k) 1 3 2 1 2 20
3 x(3k) 1 3 2 1 3 18
4 x(4k) 1 3 2 1 4 11
5 x(5k) 1 3 2 1 5 5
6 x(6k) 1 3 2 1 6 1
7 x(7k) 1 3 2 1 7 0
. . . .

The sequence v(n) is shown plotted below. Note that L
v
, the length oI v(n), equals the sum oI the
lengths oI x(n) and h(n) minus 1: L
v
L
x
L
h
1.


















4
11
18
11
22
v(n)
n
1 0 1 2 3 4 5 6 7 8
v(n)

) ( ) ( k n x k h
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 37 of 77 Dr. Ravi Billa
MATLAB (Linear Convolution)

xn |1, 2, 3, 1|; hn |4, 3, 2, 1|;
yn conv(xn, hn)
M length(xn) length(hn) - 1;
m 0: M-1;
stem(m, yn)

The result is: yn 4 11 20 18 11 5 1


0 1 2 3 4 5 6
0
2
4
6
8
10
12
14
16
18
20



www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 38 of 77 Dr. Ravi Billa
Matrix-vector multiplication Proakis, Study Guide, p. 12] When the sequences x(n) and h(n)
are oI Iinite duration (as in this case) their linear convolution can also be implemented by using
matrix-vector multiplication. We show below the Iormulation using the Iorm
v(n)

) ( ) ( k n x k h
as in the tabular method above. We arrange h(.) and v(.) as vectors (the latter with a length L
v

L
x
L
h
1) and the (Toeplitz) matrix X (oI size L
v
rows and L
h
columns) Iormed Irom the
various shiIted versions, x(nk):

h(.)
(
(
(
(

1
2
3
4
, y(.)
(
(
(
(
(
(
(
(
(

) 6 (
) 5 (
) 4 (
) 3 (
) 2 (
) 1 (
) 0 (
v
v
v
v
v
v
v
and X(.,.)
(
(
(
(
(
(
(
(
(

1 0 0 0
3 1 0 0
2 3 1 0
1 2 3 1
0 1 2 3
0 0 1 2
0 0 0 1


Note that the Toeplitz matrix may be seen (except Ior the zeros) in the center part oI the table
given under 'Tabular method. We then evaluate v as the product X . h:



(
(
(
(
(
(
(
(
(

) 6 (
) 5 (
) 4 (
) 3 (
) 2 (
) 1 (
) 0 (
v
v
v
v
v
v
v

(
(
(
(
(
(
(
(
(

1 0 0 0
3 1 0 0
2 3 1 0
1 2 3 1
0 1 2 3
0 0 1 2
0 0 0 1
.
(
(
(
(

1
2
3
4


MATLAB has a Iunction called toeplit: that generates the Toeplitz matrix. We could, oI course,
use the alternative Iorm

) ( ) ( k n h k x in which case we evaluate v H . x.



www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 39 of 77 Dr. Ravi Billa
Example 1.4.18 |Linear Convolution] Given the Iinite length sequences below Iind v(n)
x
1
(n)*x
2
(n).

x
1
(n) 1, 0 _ n _ 3,
0, otherwise

x
2
(n) 1, 0 _ n _ 3
0, otherwise

Solution The MATLAB segment Iollows:

DeIine sequences
n 0:3; x1 ones(size(n)), x2 ones(size(n)),
Length oI output
M length(x1) length(x2) - 1; m 0: M-1;
yn conv(x1,x2); stem(m,yn)
xlabel('n'), ylabel('y(n)'), title('Convolution y(n) x1(n) * x2(n)');


0 1 2 3 4 5 6
0
0.5
1
1.5
2
2.5
3
3.5
4
n
y
(
n
)
Convolution y(n) = x1(n) * x2(n)


www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 40 of 77 Dr. Ravi Billa
Example 1.4.19 Given x
1
(n) n {u(n10) u(n 20)} and x
2
(n) cos (0.1tn) {u(n) u(n
30)}, Iind v(n) x
1
(n) * x
2
(n).
Solution The intervals over which the sequences are non-zero are deIined below:

x
1
(n) n, N
0
_ n _ N
1
, N
0
10, N
1
20
0, otherwise

x
2
(n) cos (0.1t n), N
2
_ n _ N
3
, N
2
0, N
3
30
0, otherwise

v(n) Non-zero, N
4
_ n _ N
5
, N
4
N
0
N
2
, N
5
N
1
N
3

0, otherwise

For (the summation limits) N
4
and N
5
see DSP-HW. The MATLAB segment and plot are given
below:

First sequence over the range N0 to N1
N0 -10; N1 20; n1 N0:N1; x1 n1;
Second sequence over the range N2 to N3
N2 0; N3 30; n2 N2:N3; x2 cos(0.1 * pi * n2);
Convolution limits
N4 N0N2; N5 N1N3; n N4:N5;
yn conv(x1,x2); stem(n, yn);
xlabel('n'), ylabel('y(n)'), title('Convolution y(n) x1(n) * x2(n)');


-10 0 10 20 30 40 50
-80
-60
-40
-20
0
20
40
60
80
n
y
(
n
)
convolution y(n) = x1(n) * x2(n)



www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 41 of 77 Dr. Ravi Billa
1.4.4 Causality

The constraints oI linearity and time-invariance deIine a class oI systems that is represented by
the convolution sum. The additional constraints oI stability and causality deIine a more restricted
class oI linear time-invariant systems oI practical importance.

Definition A discrete-time system is causal iI the output at n n
0
depends only on the input Ior
n _ n
0
.

The word 'causal has to do with cause and eIIect; in other words, Ior the system to act
up there must be an actual cause. A causal system does not anticipate Iuture values oI the input
but only responds to actual, present, input. As a result, iI two inputs to a causal system are
identical up to some point in time n
0
the corresponding outputs must also be equal up to this
same time. The synonyms oI 'causal are '(physically) realizable and 'non-anticipatory.
We digress below to introduce memory-less versus dynamic systems and then resume
with causality.

6I+.B?8 %&+7?4+ D.7E (/B D.7E2*7 4?423& A system is said to be memory-less or static iI its
output Ior each value oI n is dependent only on the input at that same time but not on past or
future inputs.
Examples oI static systems

1. v(n) x(n) the identity system
2. v(n) a x(n) x
2
(n)
3. A resistor R: v(t) R x(t) (v(t) is voltage and x(t) is current)

In many physical systems, memory is directly associated with storage oI energy. A
resistor has no storage oI energy. But a circuit with capacitors and/or inductors has storage oI
energy and is a dynamic system, i.e., has memory. However, while storage oI energy has to do
with past inputs only, a static system is independent not only oI past but also oI future inputs.
Examples oI systems with memory, i.e., dynamic systems:
1. v(n)

=
n
k
k x ) ( . This is an accumulator or summer. The output v(n) depends on
values oI x(.) prior to n such as x(n1) etc.
2. v(n) x(n1). This is a delay element.
3. A capacitor C: v(t)
C
1
}

t
d x t t ) ( , (v(.) is voltage and x(.) is current).
6A/B 21 I+.B?8

Getting back to causality, all memorv-less svstems are causal since the output responds
only to the current value oI the input. In addition, some dynamic systems (such as the three listed
above) are also causal.
An example oI a noncausal system is v(n) x(n) x(n1) since the output depends on a
Iuture value, x(n1).
Although causal systems are oI great importance, they are not the only systems that are oI
practical importance. For example, causality is not oIten an essential constraint in applications in
which the independent variable is not time, such as in image processing. Moreover, in processing
data that have been recorded previouslv (non real-time), as oIten happens with speech,
geophysical, or meteorological signals, to name a Iew, we are by no means constrained to causal
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 42 of 77 Dr. Ravi Billa
processing. As another example, in many applications, including historical stock market analysis
and demographic studies, we may be interested in determining a slowly varying trend in data that
also contain higher Irequency Iluctuations about that trend. In this case, a commonly used
approach is to average data over an interval in order to smooth out the Iluctuations and keep only
the trend. An example oI such a noncausal averaging system is
v(n)
1 2
1
+ M

=
M
M k
k x ) (

Definition A discrete-time sequence x(n) is called causal iI it has zero values Ior n 0, i.e., x(n)
0 Ior n 0.

Theorem A linear shift-invariant svstem with impulse response h(n) is causal iI and only iI h(n)
is zero Ior n 0.

Proof of the ~If part By convolution the output v(n) is given by
v(n)

=

k
k n h k x ) ( ) (
II h(n) 0 Ior n 0, then h(nk) 0 Ior nk 0 or k ~ n. So
v(n)

=

n
k
k n h k x ) ( ) (

+ =

1
) ( ) (
n k
k n h k x


=

n
k
k n h k x ) ( ) (
Thus v(n) at any time n is a weighted sum oI the values oI the input x(k) Ior k _ n, that is, only
the present and past inputs. ThereIore, the system is causal.

Proof of the ~Only If part This is proved by contradiction, that is, iI h(n) is non zero Ior n 0
then the system is noncausal. Let h(n) be nonzero Ior n 0:

h(n) is non zero Ior n 0 h(nk) is non zero Ior nk 0 or k ~ n
the 2
nd
sum above,

+ =

1
) ( ) (
n k
k n h k x , is non zero
v(n) then depends on x(n1) and other Iuture terms
Hence, the system is noncausal

Example 1.4.20 Check the causality oI the system v(n) x(n).
Answer II n is some positive value then v(n) depends only on past values oI the input x(.). But iI
n is negative, say n 2, then

v(2) x((2)) x(2), a Iuture value oI input

Hence the system is noncausal.

Example 1.4.21 Check the system v(n) x(n) cos (n1) Ior causality.
Answer Note that x(.) is the input, not the cos (.). In this system, the output at any time n equals
the input at that same time multiplied by a number that varies with time. We can write the
equation as v(n) g(n) x(n), where g(n) cos (n1) is a time-varying Iunction. Only the current
0
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 43 of 77 Dr. Ravi Billa
value oI the input x(.) determines the current output v(.). ThereIore the system is causal (and also
memoryless).

Example 1.4.22 Check the system v(n) T|x(n)| n
) (n x
e Ior causality. Answer Causal.

Example 1.4.23 Check the system v(n) T|x(n)|
n
a cos (2an/N) Ior causality. Answer Causal.

Example 1.4.24 Check the system v(n) T|x(n)| cos (x(n)) Ior causality. Answer Causal.

Example 1.4.25 Check the system v(n) T|x(n)| x(n2) Ior causality.
Answer For n _ 0 the argument oI x, viz., n2 will be _ 2. For example, iI n 0 we have

v(0) x(2), a Iuture value oI input

Hence the system is noncausal.
Example 1.4.26 Check the system v(n) T|x(n)|

=
n
n k
k x
0
) ( Ior causality. Answer Causal.
Example 1.4.27 Check the system v(n) T|x(n)|

+
=
0
0
) (
n n
n n k
k x Ior causality.
Answer v(n)

+
=
0
0
) (
n n
n n k
k x
)
`

=
n
n n k
k x
0
) ( x(n1) x(n2) . x(nn
0
)

The system is noncausal since v(n) depends on Iuture values oI the input.

6I+.B?8 A streamable system is one that is either causal or can be made causal by adding an
overall delay. The system v(n) x(n1) is not causal but can be made so and is thereIore
streamable. But v(n) x(n) is not streamable since it can`t be made causal.

1.4.5 Bounded input bounded output stability

Definition A sequence x(n) is bounded iI there exists a Iinite M such that ,x(n), M Ior all n.
(Note that, as expressed here, M is a bound Ior negative values oI x(.) as well. Another way oI
writing this is M x(n) M.)

As an example, the sequence x(n) |1cos 5an| u(n) is bounded with ,x(n), _ 2. The
sequence x(n) ) (
) 8 . 0 ( 1
10 sin ) 1 (
n u
n n
n (

+
+
is unbounded.

Definition A discrete-time system is bounded input-bounded output (BIBO) stable iI every
bounded input sequence x(n) produces a bounded output sequence. That is, iI ,x(n), s M , then
,v(n), s L .

BIBO stability theorem A linear shift invariant svstem with impulse response h(n) is bounded
input-bounded output stable iI and only iI S, deIined below, is Iinite.
Future terms
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 44 of 77 Dr. Ravi Billa
S

= k
k h ) (
i.e., the unit sample response is absolutelv summable.

Proof of the ~If part Given a system with impulse response h(n), let x(n) be such that ,x(n), s
M. Then the output v(n) is given by the convolution sum:
v(n)

=

k
k n x k h ) ( ) (
so that
,v(n),

=

k
k n x k h ) ( ) (
Using the triangular inequality that the sum oI the magnitudes > the magnitude oI the sum, we
get
,v(n), s

=

k
k n x k h ) ( ) (
Using the Iact that the magnitude oI a product is the product oI the magnitudes,
,v(n), s

=

k
k n x k h ) ( ) (
s M

= k
k h ) (
Thus, a suIIicient condition Ior the system to be stable is that the unit sample response must be
absolutely summable; that is,
<

= k
k h ) ( QED

Proof of the ~Only If part That it is also a necessary condition can be seen by considering as
input, the Iollowing bounded signal (this is the signum Iunction),

1 where h(nk) ~ 0
x(k) sgn |h(nk)| 0 where h(nk) 0
1 where h(nk) 0

Or, equivalently,
1 where h(k) ~ 0
x(nk) sgn |h(k)| 0 where h(k) 0
1 where h(k) 0

In the above we have implied that M 1 (since M is some arbitrary Iinite number), and that ,x(n),
s 1. II, however, ,x(n), s M where M is Iinite but not equal to 1 we then will multiply the signum
Iunction by M. In either case x(n) is a bounded input. Thus
v(n) ) ( ) ( k n x k h
k

=
)| ( sgn| ) ( k h k h
k

= k
k h ) (
Clearly, iI h(n) is not absolutely summable, v(n) will be unbounded. QED
For a causal system the BIBO stability condition becomes
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 45 of 77 Dr. Ravi Billa
<

= 0
) (
k
k h

Example 1.4.28 Evaluate the stability oI the linear shiIt-invariant system with the unit sample
response h(n) a
n
u(n).
Answer Evaluate
S

= k
k h ) (

= k
k
k u a ) (

= 0 k
k
a

= 0 k
k
a
Here we have used the Iact that the magnitude oI a product (,a
k
,) is the product oI the magnitudes
(,a,
k
). The summation on the right converges iI ,a, 1 so that S is Iinite,
S
a 1
1

and the system is BIBO stable.

Example 1.4.29 Evaluate the stability oI the system v(n) T|x(n)| n x(n).
Answer (Note that this is not a shiIt-invariant system, though it is linear as we determined
elsewhere. The BIBO stability theorem applies to LSI systems. Note that iI x(n) o(n) we get the
result v(n) h(n) 0, Ior all n!)
II a system is suspected to be unstable, a useIul strategy to veriIy this is to look Ior a
speciIic bounded input that leads to an unbounded output. One such bounded input is x(n)
u(n), the unit step sequence. The output then is v(n) n u(n), and as n, v(n) grows without
bound. Hence the system is BIBO unstable.

Example 1.4.30 Examine v(n) T|x(n)|
) (n x
e Ior stability.
Answer This system is nonlinear as determined elsewhere. Its unit sample response is given by
setting x(n) o(n) and is given below

h(n) e, n 0
1, n = 0

Here we are unable to Iind a bounded input that results in an unbounded output. So we
proceed to veriIy that all bounded inputs result in bounded outputs. Let x(n) be an arbitrary
signal bounded by B an arbitrary positive number,

,x(n), B or B x(n) B Ior all n

Then v(n)
) (n x
e must satisIy the condition e
B
v(n) e
B
. Or, the output is guaranteed to be
bounded by e
B
. Thus the system is BIBO stable.

Example 1.4.31 Check Ior stability the system v(n) a
n
cos (2an/N)
Answer The output is independent oI the input. The system is stable Ior ,a, s 1, otherwise it is
unstable.

Example 1.4.32 v(n) x
2
(n)
Answer For any ,x(n), B, we have v(n) x
2
(n) B
2
. Hence the system is stable.


1.4.6 Convolution - Properties

www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 46 of 77 Dr. Ravi Billa
Property 1 The convolution operation is commutative, that is, x(n) * h(n) h(n) * x(n).

A linear shiIt-invariant system with input x(n) and unit sample response h(n) will have
the same output as a linear shiIt-invariant system with input h(n) and unit sample response x(n).

Property 2 The convolution oI h(n) with o(n) is, by deIinition, equal to h(n).

That is, the convolution oI any Iunction with the o Iunction gives back the original
Iunction. Stated another way: The identity sequence Ior the convolution operator is the unit
sample, or

x(n) * o(n) o(n) * x(n) x(n)

Property 3 The convolution oI a delayed unit sample sequence with x(n)

x(n) * o(nk) x(nk)

Property 4 Associativity

x(n) * (v(n) * :(n)) (x(n) * v(n)) * :(n) x(n) * v(n) * :(n)

Property 5 Distributivity over sequence addition.

x(n) * (v(n) :(n)) x(n) * v(n) x(n) * :(n)

Block diagram manipulation The properties oI commutativity, associativity and distributivity
enable us to determine the impulse response oI series or parallel combinations oI systems in
terms oI their individual impulse responses, as below:

(1) The Iollowing three LSI systems have identical unit sample response:












(2) The Iollowing two LSI systems are equivalent:








v(n) x(n)
(a)
h
1
(n) h
2
(n)
v(n) x(n)
(b)
h
2
(n) h
1
(n)
x(n) v(n)
(c)
h
1
(n)*h
2
(n)
v(n) x(n)
h
1
(n)
h
2
(n)

x(n) v(n)
h
1
(n) h
2
(n)
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 47 of 77 Dr. Ravi Billa


(3) A combination oI the above two is the series parallel combination:















Convolution - Overlap-and-add See Unit II.


1.5 Linear constant coefficient difference equations

A subclass oI linear shiIt-invariant systems is that Ior which the input x(n) and output v(n) satisIy
an N
th
order linear constant coeIIicient diIIerence equation, given by

a
0
v(n) a
1
v(n1) . a
N
v(nN)
b
0
x(n) b
1
x(n1) . b
M
x(nM), a
0
= 0

This may be written in the more compact, though daunting, Iorm

=

N
k
k
k n v a
0
) (

=

M
r
r
r n x b
0
) ( , a
0
= 0
II the system is causal, then we can rearrange the above equation to compute v(n)
iteratively Irom the present input x(n) and the past inputs x(n1), x(n2), ., x(nM) and the past
outputs v(n1), v(n2), ., v(nN):
v(n) ) (
1 0
k n v
a
a
N
k
k

|
|
.
|

\
|

=

|
|
.
|

\
|
M
r
r
r n x
a
b
0 0
) (
II we think oI the input as beginning at n 0, then v(n) can be computed Ior all n > 0 once v(1),
v(2), ., v(N) are speciIied. This is an iterative solution.

6I+.B?8 Some write the diIIerence equation with the terms v(n1) through v(nN) on the right
hand side with positive (symbolic) coeIIicients and the coeIIicient oI v(n) 1, thus

v(n) b
0
x(n) b
1
x(n1) . b
M
x(nM) a
1
v(n1) . a
N
v(nN)

II we need to use this Iorm we shall use diIIerent symbols altogether as Iollows:

v(n)
0
x(n)
1
x(n1) .
M
x(nM) o
1
v(n1) . o
N
v(nN)
6A/B 21 I+.B?8
x(n) y(n)
h
2
(n)
h
3
(n)

h
1
(n)
x(n)
y(n)
h
1
(n)*h
2
(n) h
1
(n)*h
3
(n)
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 48 of 77 Dr. Ravi Billa

Example 1.5.1 First order system] For the Iirst order system v(n) a v(n1) x(n) Iind the
output sequence v(n) assuming v(n) 0 Ior all n 0 and x(n) o(n). This corresponds to
calculating the impulse response assuming zero initial conditions.


v(n) a v(n1) x(n) a v(n1) o(n)
n 0: v(0) a v(1) o(0) a. 0 1 1
n 1: v(1) a v(0) o(1) a . 1 0 a
n 2:
v(2) a v(1) o(2) a . a 0 a
2

n 3 .

Continuing the process we have v(n)
n
a , n > 0. This is also the unit sample response h(n)
n
a u(n). It is not always possible to express v(n) as an analytical expression (closed Iorm) as
above.

Note It is also possible to recast the above problem as a noncausal or negative-time system with
v(n) 0 Ior n > 0. In this case, solving Ior v(n1), we have
v(n1) ( ) ) ( ) (
1
n x n v
a

This can be recast (by letting (n1) m etc.) as
v(n) ( ) ) 1 ( ) 1 (
1
+ + n x n v
a
, n 0
The solution now is v(n)
n
a , Ior n 0, or the impulse response is h(n)
n
a u(n1).

Note Unless stated otherwise we shall generally assume that the diIIerence equation represents a
causal system.

Other techniques for solving difference equations Among other techniques is a method
paralleling the procedure Ior solving linear constant coeIIicient diIIerential equations, which
involves Iinding and combining the particular and homogeneous solutions. Another method
uses the J-transform (paralleling the Laplace transIorm). The state variable approach provides
another formulation oI the problem and solutions in the time as well as Irequency domains.

Example 1.5.2 (Moving average filter) The three-term average v(n)
3
) 2 ( ) 1 ( ) ( + + n x n x n x

as a lead-in to FIR and IIR, see below.

~FIR, ~IIR, ~Recursive and ~Nonrecursive In the Iirst example above the impulse
response h(n)
n
a , n > 0 lasts Ior all positive time and is oI inIinite duration. In the second
example (moving average) h(n) 1/3, 1/3, 1/3} which is oI Iinite duration.

Definition II the unit sample response oI a linear shiIt invariant system is oI inIinite duration, the
system is said to be an infinite impulse response (IIR) system.

Definition II the unit sample response oI a linear shiIt invariant system is oI Iinite duration, the
system is said to be a finite impulse response (FIR) system.

Theorem A causal linear shiIt invariant system characterized by
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 49 of 77 Dr. Ravi Billa
) (
0
k n v a
N
k
k

=

M
r
r
r n x b
0
) (
represents a Iinite impulse response (FIR) system iI a
0
= 0, and a
k
0 Ior k 1, 2, ., N.
|Otherwise it could represent either an IIR or FIR system.| This is equivalent to saying that Ior
an FIR system N 0. For an FIR system then we have
a
0
v(n)

=

M
r
r
r n x b
0
) ( , or
v(n)

=

|
|
.
|

\
|
M
r
r
r n x
a
b
0 0
) (
The above diIIerence equation is identical to the convolution sum, and the (b
r
/a
0
) terms can be
recognized as h(r), the value oI the unit sample response at time r, i.e., we can set (b
r
/a
0
) h
r

h(r). So the impulse response, h(n), is given by

h(n) (b
n
/a
0
), 0 s n s M
0, otherwise

which, obviously, is oI Iinite duration.

Note: II the above diIIerence equation were written so that a
0
1, we have v(n) ) (
0
r n x b
M
r
r
'

=
.
In this case the impulse response consists simply oI the coeIIicients
r
b' oI the x(nr) terms.

Iterative solution with initial conditions The LTI discrete-time system can be characterized by

=

N
k
k
k n v a
0
) (

=

M
r
r
r n x b
0
) ( , a
0
= 0, and n > 0 (A)
Here N is the order oI the diIIerence equation. When written out in Iull the equation is

a
0
v(n) a
1
v(n1) . a
N
v(nN)
b
0
x(n) b
1
x(n1) . b
M
x(nM), a
0
= 0, and n > 0

The equation can be divided through by a
0
so that the coeIIicient oI v(n) is 1 or, alternatively, we
could impose the equivalent condition that a
0
1.
An alternative form oI the above equation is sometimes given as

=
+
N
k
k
k n v a
0
) (

=
+
M
r
r
r n x b
0
) ( , n > 0 (A`)
In this Iorm, iI the system is causal, we must have M s N.
The solution to either one oI the above equations can be determined (by analogy with the
diIIerential equation) as the sum oI two components: (1) the homogeneous solution, which
depends on the initial conditions assumed to be known, and (2) the particular solution, which
depends on the input.
Computing v(n) Ior successive values oI n one aIter another is called an iterative solution.
To obtain v(n) Ior n > 0 Irom Eq. (A) we rearrange it as
v(n) ) (
1 0
k n v
a
a
N
k
k

|
|
.
|

\
|

=

|
|
.
|

\
|
M
r
r
r n x
a
b
0 0
) ( , (B)
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 50 of 77 Dr. Ravi Billa
and evaluate v(n) Ior n 1, 2, . in an iterative manner. We need the initial conditions v(1), v(
2), ., v(N). The initial conditions needed to solve Ior v(n) using Eq. (A`) in a similar Iashion
are v(0), v(1), ., v(N1).
We may assume that the system described by Eq. (A) is in a condition oI initial rest, that
is, iI x(n) 0 Ior n 0, then v(n) 0 Ior n 0 as well. With initial rest the system (A) is LTI and
causal.
An equation oI the Iorm (A) or (B) is called a recursive equation since it speciIies a
recursive procedure to determine the output v(n) in terms oI the input and previous output values.
In the special case where N 0, Eq. (B) reduces to
v(n)

=

|
|
.
|

\
|
M
r
r
r n x
a
b
0 0
) ( , (C)
Here v(n) is an explicit Iunction oI the present and previous values oI the input only. Eq. (C) is
called a non-recursive equation, since we do not recursively use previously computed values oI
the output in order to calculate the present value oI the output.

Example 1.5.3 Find the solution to
v(n)
2
3
v(n1)
2
1
v(n2)
n
|
.
|

\
|
4
1
, n > 0
with the initial conditions v(1) 4 and v(2) 10.
Answer Note that the input is x(n)
n
) 4 / 1 ( . This is the iterative solution in the time domain. We
can write v(n)
2
3
v(n1)
2
1
v(n2)
n
|
.
|

\
|
4
1
, and solve Ior v(n) starting with n 0:

y(n) - ) 2 / 3 ( y(n-1) + ) 2 / 1 ( y(n-2)
n
) 4 / 1 ( , n > 0
y(-1) 4, and y(-2) 10
n y(n) (3/2) y(n-1) - (1/2) y(n-2) + (1/4)
n
y(n)
0 y(n) (3/2) y(n-1) - (1/2) y(n-2) + (1/4)
n

y(0) (3/2) y(0-1) - (1/2) y(0-2) + (1/4)
0

(3/2) y(-1) - (1/2) y(-2) + (1/4)
0

(3/2) (4) - (1/2) (10) + (1)
2
1 y(n) (3/2) y(n1) (1/2) y(n2) (1/4)
n

y(1) (3/2) y(11) (1/2) y(12) (1/4)
1

(3/2) y(0) (1/2) y(1) (1/4)
1

(3/2) (2) (1/2) (4) (1/4)
5/4
2 y(n) (3/2) y(n-1) - (1/2) y(n-2) + (1/4)
n

y(2) (3/2) y(2-1) - (1/2) y(2-2) + (1/4)
2

(3/2) y(1) - (1/2) y(0) + (1/4)
2

(3/2) (5/4) - (1/2) (2) + (1/16)
15/16
3 y(n) (3/2) y(n1) (1/2) y(n2) (1/4)
n

y(3) (3/2) y(31) (1/2) y(32) (1/4)
3

(3/2) y(2) (1/2) y(1) (1/4)
3

(3/2) (15/16) (1/2) (5/4) (1/64)
51/64
4 y(n) (3/2) y(n-1) - (1/2) y(n-2) + (1/4)
n

y(4) (3/2) y(4-1) - (1/2) y(4-2) + (1/4)
4

(3/2) y(3) - (1/2) y(2) + (1/4)
4

(3/2) (51/64) - (1/2) (15/16) + (1/256)
?
. Etc. .

www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 51 of 77 Dr. Ravi Billa
The solution is
v(n)
)
`

... ,
64
51
,
16
15
,
4
5
, 2
This procedure does not, in general, yield an analytical expression Ior v(n), that is, a
closed-Iorm solution. But it is easily implemented on a digital computer.

Example 1.5.4 MATLAB] Zero initial conditions] In the context oI MATLAB, we may use
filter(b, a, x) to generate the sequence v(n). In MATLAB the coeIIicients oI v(.) and x(.) are
numbered slightly diIIerently as below:

a
1
v(n) a
2
v(n1) a
3
v(n2) . b
1
x(n) b
2
x(n1) b
3
x(n2) .

From the diIIerence equation

v(n) ) 2 / 3 ( v(n1) ) 2 / 1 ( v(n2) ( )
n
4 / 1 , n > 0

we note that the input is x(n) ( )
n
4 / 1 and the coeIIicients oI v(.) and x(.) give us the a and b
vectors, respectively: a |1, -1.5, 0.5| and b |1|. The Iollowing segment generates the output
with initial conditions taken as zero.

Zero initial conditions
b |1|; a |1, -1.5, 0.5|;
n 0:25; xn (1/4) .`n; '.` means element-by-element exponentiation
yn Iilter(b, a, xn), Or, yn Iilter(1, a, xn)
subplot(2, 1, 1), stem(n, xn);
xlabel('n'), ylabel('x(n)'); title('Input Sequence');
subplot(2, 1, 2), stem(n, yn);
xlabel('n'), ylabel('y(n)'); title('Output Sequence');

The solution is:
yn |1 1.75 2.1875 2.4219 2.5430 2.6045 2.6355 . 2.6667 2.6667 2.6667|

www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 52 of 77 Dr. Ravi Billa
0 5 10 15 20 25
0
0.5
1
n
x
(
n
)
nput Sequence
0 5 10 15 20 25
0
1
2
3
n
y
(
n
)
Output Sequence



Example 1.5.5 MATLAB] Non-zero initial conditions] Find the solution to the diIIerence
equation
v(n) ) 2 / 3 ( v(n1) ) 2 / 1 ( v(n2) ( )
n
4 / 1 , n > 0
with the initial conditions v(1) 4 and v(2) 10.
II the problem speciIies non-zero initial conditions, they must Iirst be converted to
'equivalent initial conditions Ior the filter Iunction to work. In this problem v(1) 4 and v(2)
10. These are speciIied as a vector vic |4, 10| and used to generate the equivalent initial
conditions eic by the Iunction filtic(b, a, vic). The equivalent initial conditions are then used to
generate the Iilter output through filter(b, a, xn, eic). The MATLAB segment Iollows:

Non-zero initial conditions
b |1|; a |1, -1.5, 0.5|; yic |4, 10|;
n 0:25; xn (1/4) .`n; '.` means element-by-element exponentiation

Equivalent initial conditions
eic Iiltic(b, a, yic);
yn Iilter(b, a, xn, eic)
subplot(2, 1, 1), stem(n, xn);
xlabel('n'), ylabel('x(n)'); title('Input Sequence');
subplot(2, 1, 2), stem(n, yn);
xlabel('n'), ylabel('y(n)'); title('Output Sequence');

The output is:
yn |2 1.25 0.9375 0.7969 0.7305 0.6982 0.6824.0.6667 0.6667 0.6667|


www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 53 of 77 Dr. Ravi Billa
0 5 10 15 20 25
0
0.5
1
n
x
(
n
)
nput Sequence
0 5 10 15 20 25
0
0.5
1
1.5
2
n
y
(
n
)
Output Sequence



6<4.78 K?>*3+.L? 3?('.J(7.2/ 21 MNK +&+7?4 ( +.4O'? ?5(4O'? The moving average oI the
signal x(n) is given by
v(n)
1
) ( ... ) 2 ( ) 1 ( ) (
+
+ + + +
M
M n x n x n x n x

Since past values oI v(.) are not used in computing v(n) this is a nonrecursive implementation oI
the FIR Iilter. The impulse response is

n 0 M
h(n)

+1
1
M
,
1
1
+ M
,
1
1
+ M
,
.,
)
`

+1
1
M

A total oI
M1 terms

which consists oI (M1) samples or coeIIicients. We recognize, by replacing n by (n1) in the
above equation, that
v(n1)
1
) 1 ( ) ( ... ) 2 ( ) 1 (
+
+ + + +
M
M n x M n x n x n x
(1)
By adding and subtracting
1
) 1 (
+

M
M n x
on the right hand side oI the equation Ior v(n) we can
arrive at a recursive implementation oI the moving average:
v(n)
1
) 1 ( ) 1 ( ) ( ... ) 2 ( ) 1 ( ) (
+
+ + + + +
M
M n x M n x M n x n x n x n x

Using eq. (1) we can write v(n) as
v(n) v(n1)
1
) 1 ( ) (
+

M
M n x n x

which clearly is a recursive implementation since it involves v(n1), a past value oI v.
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 54 of 77 Dr. Ravi Billa
6A/B 21 <4.78

Further nomenclature II we take a
0
1 our standard diIIerence equation becomes
v(n) a
1
v(n1) . a
N
v(nN)
b
0
x(n) b
1
x(n1) . b
M
x(nM)
This is an N
th
order diIIerence equation.
A moving average (MA) Iilter is one with its output dependent on the present and
previous inputs. The average here is a weighted average, the weights being the b coeIIicients. In
terms oI the above diIIerence equation this corresponds to N 0 and the diIIerence equation
becomes

v(n) b
0
x(n) b
1
x(n1) . b
M
x(nM)

There is some variation on the Iorm oI this equation. As given here it has (M1) coeIIicients and
M delay elements. Sometimes it is more convenient to use this with M coeIIicients rather than
(M1). Either way its order is N 0. Note that we have tied the order to the oldest term in v(.)
and not to the oldest term in x(.). See I+.B? below.
An autoregressive (AR) Iilter is one with its output dependent on the present input (but
not previous inputs) and previous outputs this is a purelv recursive system. In terms oI the
above diIIerence equation this corresponds to M 0 and is oI the Iorm

v(n) b
0
x(n) a
1
v(n1) . a
N
v(nN)

More generally, an autoregressive moving average (ARMA) Iilter has its output depend
on the present input, M previous inputs, and N previous outputs. In terms oI the linear constant
coeIIicient diIIerence equation this has the Iorm

v(n) b
0
x(n) b
1
x(n1) . b
M
x(nM) a
1
v(n1) . a
N
v(nN)

6I+.B?8 With a
0
1 we have
H(:)

+
N
i
i
i
M
i
i
i
: a
: b
1
0
1

This represents an IIR Iilter iI at least one oI a
1
through a
N
is nonzero, and all the roots oI the
denominator are not canceled exactly by the roots oI the numerator. For example, in the system,
H(:) ) 1 ( ) 1 (
1 8
: : , the single pole at : 1 is canceled exactly by the zero at : 1, making
H(:) a Iinite polynomial in
1
: , that is, an FIR Iilter.
In general, there are M Iinite zeros and N Iinite poles. There is no restriction that M
should be less than or greater than or equal to N. In most cases, especially digital Iilters derived
Irom analog designs, M will be less than or equal to N. Systems oI this type are called N
th
order
systems.
When M ~ N, the order oI the system is no longer unambiguous. In this case, H(:) may be
taken to be an N
th
order system in cascade with an FIR Iilter oI order (M N).
When N 0, as in the case oI an FIR Iilter, according to our convention the order is 0; it
is more useIul in this case to Iocus on M and call it an FIR Iilter oI M stages or (M1)
coeIIicients.
6A/B 21 I+.B?8

www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 55 of 77 Dr. Ravi Billa

1.6 Fourier analysis of discrete-time signals and systems

Note For the discrete-time Fourier transIorm some authors (Oppenheim & SchaIer, Ior instance)
use the symbol X(e
fc
) while others (Proakis, Ior instance) use the symbol X(c). The symbol c is
used Ior digital Irequency (radians per sample or just radians) and the symbol O Ior the analog
Irequency (radians/sec). Some authors, on the other hand, use just the opposite oI our
convention, that is, c Ior the analog Irequency (radians/sec) and O Ior the digital Irequency
(radians).

Discrete-time Fourier transform (DTFT) For the continuous-time signal x(t), the Fourier
transIorm is
!x(t)} X(O)
}


O
dt e t x
t f
) (
The impulse-train sampled version, x
s
(t), is given by
x
s
(t) x(t)

=

n
nT t ) ( o
So the Fourier transIorm oI x
s
(t) is given by
X
s
(O)
}


O
dt e t x
t f
s
) (
}

=
|
|
.
|

\
|
dt e nT t t x
t f
n
) ( ) ( o

=
O
n
T n f
e nT x ) (
where the last step Iollows Irom the siIting property oI the o Iunction. Replace OT by c the
discrete-time Irequency variable, that is, the digital frequency. Note that O has units oI
radians/second, and c has units oI radians (/sample). This change oI notation gives the discrete-
time Fourier transform, X(c), oI the discrete-time signal x(n), obtained by sampling x(t), as
X(c) !x(n)}

n
n f
e n x
e
) (
Note that this deIines the discrete-time Fourier transIorms oI anv discrete-time signal x(n). The
transIorm exists iI x(n) satisIies a relation oI the type

= n
n x ) ( or

= n
n x
2
) (
These conditions are suIIicient to guarantee that the sequence has a discrete-time Fourier
transIorm. As in the case oI continuous-time signals there are signals that neither are absolutely
summable nor have Iinite energy, but still have a discrete-time Fourier transIorm. (See also p. 22,
O & S.)

Discrete-time Fourier transform of (non-periodic) sequences The Fourier transIorm oI a
general discrete-time sequence tells us what the Irequency content oI that signal is.

Definition The Fourier transIorm X(e
fc
) oI the sequence x(n) is given by
!x(n)} X(c)

n
n f
e n x
e
) ( (A)
The inverse Fourier transIorm is given by
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 56 of 77 Dr. Ravi Billa
!
"#
X(c)} x(n)
t 2
1
}

t
t
e e
e d e e X
n f f
) ( (B)
Equations (A) and (B) are called the Fourier transIorm pair Ior a sequence x(n) with X(c)
thought oI as the frequencv content oI the sequence x(n). Equation (A) is the analysis equation
and equation (B) is the synthesis equation. Since X(c) is a periodic Iunction oI c, we can think
oI x(n) as the Fourier coeIIicients in the Fourier series representation oI X(c). That is, equation
(A), in Iact, expresses X(c) in the Iorm oI a Fourier series.
The sketch below sums up the relationship between the time and Irequency domains. The
periodicity is 2a. From the relation c OT we can deduce that at the point c 2a on the
horizontal axis O c/T 2a/T 2aF
s
O
s
. In other words, in terms oI the analog Irequency
variable the point c 2a corresponds to O O
s
or F F
s
.




















6<4.78 K?'(7.2/+E.O 72 7E? J@73(/+1234 The :-transIorm X(:) and the Fourier transIorm X(c) are
given by
X(:)

n
n
: n x ) ( and X(c)

n
n f
e n x
e
) (
Comparing the two we deduce the relationship as

= f
e :
: X
=
) ( X(c)

n
n f
e n x
e
) (
The :-transIorm evaluation on the unit circle gives the Fourier transIorm oI the sequence
x(n). The :-transIorm oI x(n) can be viewed as the Fourier transIorm oI the sequence x(n) r
n
},
that is, x(n) multiplied by an exponential sequence r
n
. This can be seen by setting : r e
fc
in the
deIining equation oI X(:):
X(:) ( )

n
n
f
e r n x
e
) (

=

n
n f n
e r n x
e
) (


x(n) multiplied by the
exponential sequence r
n


x(n)
n
Non-periodic
0
X(c)
e
Periodic, complex-valued
2t t 2t t
:
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 57 of 77 Dr. Ravi Billa
Z-transform of a periodic sequence Consider a sequence x(n) that is periodic with period N so
that x(n) x(nkN) Ior any integer value oI k. Such a sequence cannot be represented by its z-
transIorm, since there is no value oI : Ior which the z-transIorm will converge.
6A/B 21 <4.78

Example 1.6.1 |CI. Example 4.2.3, Proakis, 4
th
Ed.| For the exponential sequence x(n)
n
a u(n),
,a, 1, the DTFT is
) (
e f
e X

0 n
n f n
e a
e
( )

0 n
n
f
ae
e

e f
e a

1
1

) sin (cos 1
1
e e f a

We shall put this in the Iorm X(c) } X Magnitude
} X Phase f
e ) (e X
) (e X f
e
Z
Irom which the
magnitude and phase will be extracted. The denominator (Dr.) is
Dr. e e sin cos 1 fa a + e e
2 2 2
sin ) cos 1 ( a a +
|
|
.
|

\
|

e
e
cos 1
sin
tan
1
a
a
f
e
Thus
X(c) [X(c)[
) (e X f
e
Z

) cos 2 1 (
1
2
e a a +

|
|
.
|

\
|


e
e
cos 1
sin
tan
1
a
a
f
e
The magnitude and phase are:
[X(c)[
) cos 2 1 (
1
2
e a a +
and ) (e X Z
|
.
|

\
|


e
e
cos 1
sin
tan
1
a
a

Plots oI [X, and X Z are shown. Note that X(c) is periodic and that the magnitude is an even
Iunction oI c and the phase is an odd Iunction. (See below on the notation [X, and X Z ).
The value oI ) (
e f
e X at c 0 is

0
) (
= e
e X
) 0 cos 2 1 (
1
2
a a +

a 1
1


0
) (
=
Z
e
e X
|
.
|

\
|


0 cos 1
0 sin
tan
1
a
a
0
Similarly, at c t we have
t e
e
=
) ( X ) 1 /( 1 a + and
t e
e
=
Z ) ( X 0.

Phase angle of a complex number In calculating the phase angle oI a complex number, :
Re(:) f Im(:), a hand held calculator, typically uses the Iormula { } ) Re( / ) Im( tan
1
: :

, and returns an
answer in the range t/2 angle _ t/2. Thus Ior both (1f) and (1f) the phase angle so
calculated is t/4. However, (1f) is in the 4
th
quadrant with ) 1 ( f Z t/4 whereas (1f) is in
the 2
nd
quadrant with ) 1 ( f + Z 3t/4. MATLAB has a Iunction angle which takes into account
the real and imaginary parts separately (instead oI their ratio) and calculates the 'Iour-quadrant
inverse tangent.

Example 1.6.2 MATLAB 1O'27] To illustrate the magnitude and phase plots oI the DTFT we
take a 0.8 in the exponential sequence x(n)
n
a u(n), ,a, 1, treated above. Thus x(n)
n
) 8 . 0 ( u(n). We need only plot over the interval a _ c _ a or 0 _ c _ 2a. To show, visually, the
periodicity we have plotted over 3a _ c _ 3a. We have
) (
e f
e X

0 n
n f n
e a
e
( )

0 n
n
f
ae
e

e f
e a

1
1

e f
e

8 . 0 1
1

www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 58 of 77 Dr. Ravi Billa
In the MATLAB program segment that Iollows we write an algebraic expression Ior
) (
e f
e X
e f
e

8 . 0 1
1
as (1) / (1-0.8*exp(-j*w)). Note that we have used w` Ior c and the plot
ranges Irom 2t to 2t. Both c and the phase, ) (e X Z , are in radians. The parameter 'k' means that
the plot/display is in black 'color.

subplot(2,1,1);Iplot('abs((1)/(1-0.8*exp(-j*w)))', |-3*pi,3*pi|, 'k');
xlabel('\omega');ylabel('Magnitude');
subplot(2,1,2);Iplot('angle((1)/(1-0.8*exp(-j*w)))', |-3*pi,3*pi|, 'k');
xlabel('\omega');ylabel('Phase');


0
) (
= e
e X
a 1
1

8 . 0 1
1

5
t e
e
=
) ( X ) 1 /( 1 a + 1/1.8 0.555

-8 -6 -4 -2 0 2 4 6 8
0
2
4
6
e
M
a
g
n
i
t
u
d
e
-8 -6 -4 -2 0 2 4 6 8
-1
-0.5
0
0.5
1
e
P
h
a
s
e


www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 59 of 77 Dr. Ravi Billa
Example 1.6.3 MATLAB 13?FJ] We repeat the Irequency response plots using the freq:
Iunction. Taking a 0.8 as beIore, we have x(n)
n
) 8 . 0 ( u(n) and
) (
e f
e X

0 n
n f n
e a
e
( )

0 n
n
f
ae
e

e f
e a

1
1

e f
e

8 . 0 1
1

Instead oI writing an algebraic expression Ior ) (
e f
e X
e f
e

8 . 0 1
1
as in the previous example, we
shall now speciIy the numerator and denominator in terms oI their coeIIicients. We shall use the
Iollowing convention to speciIy the parameters oI the Iunction
) (
e f
e X
... ) 3 ( ) 2 ( ) 1 (
... ) 3 ( ) 2 ( ) 1 (
2
2
+ + +
+ + +


e e
e e
f f
f f
e a e a a
e b e b b

e f
e

8 . 0 1
1

Here the vectors b and a speciIy, respectively, the numerator and denominator coeIIicients. In
our example b(1) 1, a(1) 1, and a(2) 0.8. The MATLAB segment and the corresponding
plots Iollow. Note that the plot goes Irom t to t, not 3t to 3t.

b |1|; Numerator coeIIicient
a |1, -0.8|; Denominator coeIIicients
w -pi: pi/256: pi; A total oI 512 points
|Xw| Ireqz(b, a, w);
subplot(2, 1, 1), plot(w, abs(Xw));
xlabel('Frequency \omega'), ylabel('Magnitude oI X(\omega)'); grid
subplot(2, 1, 2), plot(w, angle(Xw));
xlabel('Frequency \omega'), ylabel('Phase oI X(\omega)'); grid

-4 -3 -2 -1 0 1 2 3 4
0
2
4
6
Frequency e
M
a
g
n
i
t
u
d
e

o
f

X
(e
)
-4 -3 -2 -1 0 1 2 3 4
-1
-0.5
0
0.5
1
Frequency e
P
h
a
s
e

o
f

X
(e
)




www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 60 of 77 Dr. Ravi Billa
Example 1.6.4 Find the DTFT, X(c), Ior x(n) 1, 2, 3, 4, 3, 2, 1}.
Solution The DTFT is
) (
e f
e X

6
0
) (
n
n f
e n x
e
1
1
2
e f
e

2
3
e f
e

3
4
e f
e

4
3
e f
e

5
2
e f
e

6
1
e f
e


(2 e 3 cos 4 e 2 cos 6 e cos 4)
e 3 f
e


The numerator vector is b |1, 2, 3, 4, 3, 2, 1| and the denominator vector is a 1}. The
MATLAB segment plots the sequence and the Irequency response.

Sketch oI sequence
n 0:1:6; xn |1, 2, 3, 4, 3, 2, 1|;
subplot (3, 1, 1), stem(n, xn)
xlabel('n'), ylabel('x(n)'); grid
Frequency response
b |1, 2, 3, 4, 3, 2, 1|; Numerator coeIIicients
a |1|; Denominator coeIIicients
w -pi: pi/256: pi; A total oI 512 points
|Xw| Ireqz(b, a, w);
subplot(3, 1, 2), plot(w, abs(Xw));
xlabel('Frequency \omega'), ylabel('Magnitude oI X(\omega)'); grid
subplot(3, 1, 3), plot(w, angle(Xw));
xlabel('Frequency \omega'), ylabel('Phase oI X(\omega)'); grid

0 1 2 3 4 5 6
0
2
4
n
x
(
n
)
-4 -3 -2 -1 0 1 2 3 4
0
10
20
Frequency e
M
a
g
n
i
t
u
d
e

o
f

X
(e
)
-4 -3 -2 -1 0 1 2 3 4
-5
0
5
Frequency e
P
h
a
s
e

o
f

X
(e
)


Example 1.6.5 Find the DTFT, X(c), Ior
(a) x(n) 1, 2, 3, 4, 3, 2, 1, 0}
(b) x(n) 1, 2, 3, 4, 3, 2, 1, 0, ., 0}
Solution !?!
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 61 of 77 Dr. Ravi Billa
The Iollowing examples are repeated in Unit II DFS &DFT.

Example 1.6.6 Obtain the 7-point DFT oI the sequence x(n) 1, 2, 3, 4, 3, 2, 1} by taking 7
samples oI its DTFT uniIormly spaced over the interval 0 _ c _ 2a.
Solution The sampling interval in the Irequency domain is 2a/7. From Example 4 we have
) (
e f
e X or X(c) 1
1
2
e f
e

2
3
e f
e

3
4
e f
e

4
3
e f
e

5
2
e f
e

6
1
e f
e


(2 e 3 cos 4 e 2 cos 6 e cos 4)
e 3 f
e


The DFT, ) (k X , is given by replacing c with k(2a/7) where k is an index ranging Irom 0 to 6:
DFT
7 / 2
) (
k
X
t e
e
=
) 7 / 2 ( k X t , k 0 to 6
This is denoted XkIromDTFT in the MATLAB segment below.

MATLAB:
w 0: 2*pi/7: 2*pi-0.001
XkIromDTFT (46*cos(w)4*cos(2*w)2*cos(3*w)) .* exp(-j*3*w)

MATLAB solution:

XkIromDTFT |16, (-4.5489 - 2.1906i), (0.1920 0.2408i), (-0.1431 - 0.6270i),
(-0.1431 0.6270i), (0.1920 - 0.2408i), (-4.5489 2.1906i)|

This is the 7-point DFT obtained by sampling the DTFT at 7 points uniIormly spaced in (0, 2a).
It should be the same as the DFT directly obtained, Ior instance, by using the fft Iunction in
MATLAB:

MATLAB:
xn |1 2 3 4 3 2 1|
XkusingIIt IIt(xn)

MATLAB solution:

XkusingIIt |16, (-4.5489 - 2.1906i), (0.1920 0.2408i), (-0.1431 - 0.6270i),
(-0.1431 0.6270i), (0.1920 - 0.2408i), (-4.5489 2.1906i)|

It can be seen that 'XkIromDTFT 'XkusingIIt.

Example 1.6.7 Obtain the 7-point inverse DTFT x(n) by Iinding the 7-point inverse DFT oI X(k):

) 7 / 2 ( k X t |16, (-4.5489 - 2.1906i), (0.1920 0.2408i), (-0.1431 - 0.6270i),
(-0.1431 0.6270i), (0.1920 - 0.2408i), (-4.5489 2.1906i)|

MATLAB:

Xk |16, (-4.5489 - 2.1906i), (0.1920 0.2408i), (-0.1431 - 0.6270i),(-0.1431
0.6270i), (0.1920 - 0.2408i), (-4.5489 2.1906i)|
xn iIIt(Xk)

MATLAB solution:

xn |1.0000 2.0000 3.0000 4.0000 3.0000 2.0000 1.0000|
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 62 of 77 Dr. Ravi Billa

This is the original sequence we started with in Example 4.

Example 1.6.8 What will be the resulting time sequence iI the DTFT oI the 7-point sequence is
sampled at 6 (or Iewer) uniIormly spaced points in (0, 2a) and its inverse DFT is obtained?
Solution The sampling interval in the Irequency domain now is 2a/6. From Example 4 we have

) (
e f
e X or X(c) 1
1
2
e f
e

2
3
e f
e

3
4
e f
e

4
3
e f
e

5
2
e f
e

6
1
e f
e


(2 e 3 cos 4 e 2 cos 6 e cos 4)
e 3 f
e



The DFT then is given by

DFT
6 / 2
) (
k
X
t e
e
=
) 6 / 2 ( k X t , k 0 to 5

This is denoted Xk6point in the MATLAB segment below.

MATLAB:
w 0: 2*pi/6: 2*pi-0.001
Xk6point (46*cos(w)4*cos(2*w)2*cos(3*w)) .* exp(-j*3*w)

MATLAB solution:
Xk6point |16, (-3.0000 - 0.0000i), (1.0000 0.0000i), 0, (1.0000 0.0000i),
(-3.0000 - 0.0000i)|

This is the 6-point DFT obtained by sampling the DTFT at 6 points uniIormly spaced in (0, 2a).

Example 1.6.9 Obtain the 6-point inverse DTFT x(n) by Iinding the 6-point inverse DFT oI
Xk6point:

) 6 / 2 ( k X t |16, (-3.0000 - 0.0000i), (1.0000 0.0000i), 0, (1.0000 0.0000i),
(-3.0000 - 0.0000i)|

MATLAB:

Xk6point |16, (-3.0000 - 0.0000i), (1.0000 0.0000i), 0, (1.0000 0.0000i), (-
3.0000 - 0.0000i)|
xn iIIt(Xk6point)

MATLAB solution:

xn |2 2 3 4 3 2|

Comparing with the original 7-point sequence, xn |1 2 3 4 3 2 1|, we see the
consequence oI under-sampling the continuous-c Iunction X(c): the corresponding time domain
sequence x(n) is said to suIIer time-domain aliasing. This is similar to the situation that occurs
when a continuous-time Iunction x(t) is under-sampled: the corresponding Irequency domain
Iunction ) (e
s
X contains frequencv-domain aliasing.

www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 63 of 77 Dr. Ravi Billa
Example 1.6.10 What will be the resulting time sequence iI the DTFT oI the 7-point sequence is
sampled at 8 (or more) uniIormly spaced points in (0, 2a) and its inverse DFT is obtained?
Solution The sampling interval in the Irequency domain now is 2a/8. From Example 4 we have

) (
e f
e X or X(c) 1
1
2
e f
e

2
3
e f
e

3
4
e f
e

4
3
e f
e

5
2
e f
e

6
1
e f
e


(2 e 3 cos 4 e 2 cos 6 e cos 4)
e 3 f
e



The DFT then is given by

DFT
8 / 2
) (
k
X
t e
e
=
) 8 / 2 ( k X t , k 0 to 7

This is denoted Xk8point in the MATLAB segment below.

MATLAB:
w 0: 2*pi/8: 2*pi-0.001
Xk8point (46*cos(w)4*cos(2*w)2*cos(3*w)) .* exp(-j*3*w)

MATLAB solution:

Xk8point |16, (-4.8284 - 4.8284i), (0.0000 - 0.0000i), (0.8284 - 0.8284i), 0,
(0.8284 0.8284i), (0.0000 - 0.0000i), (-4.8284 4.8284i)|

This is the 8-point DFT obtained by sampling the DTFT at 8 points uniIormly spaced in (0, 2a).

Example 1.6.11 Obtain the 8-point inverse DTFT x(n) by Iinding the 8-point inverse DFT oI
Xk8point:

) 8 / 2 ( k X t |16, (-4.8284 - 4.8284i), (0.0000 - 0.0000i), (0.8284 - 0.8284i), 0,
(0.8284 0.8284i), (0.0000 - 0.0000i), (-4.8284 4.8284i)|

MATLAB:

Xk8point |16, (-4.8284 - 4.8284i), (0.0000 - 0.0000i), (0.8284 - 0.8284i), 0,
(0.8284 0.8284i), (0.0000 - 0.0000i), (-4.8284 4.8284i)|
xn iIIt(Xk8point)

MATLAB solution:

xn |1 2 3 4 3 2 1 0|

We see that the original 7-point sequence has been preserved with an appended :ero. The
original sequence and the :ero-padded sequence (with any number oI zeros) have the same
DTFT. This is a case oI over-sampling the continuous-c Iunction X(c): there is no time-domain
aliasing. This is similar to the situation that occurs when a continuous-time Iunction x(t) is over-
sampled: the corresponding Irequency domain Iunction ) (e
s
X is Iree Irom frequencv-domain
aliasing.

Sketch oI sequences
n 0:1:6; xn |1, 2, 3, 4, 3, 2, 1|;
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 64 of 77 Dr. Ravi Billa
subplot (3, 1, 1), stem(n, xn)
xlabel('n'), ylabel('x(n)-7point'); grid

n 0:1:5; xn |2 2 3 4 3 2|;
subplot (3, 1, 2), stem(n, xn)
xlabel('n'), ylabel('x(n)-6point'); grid

n 0:1:7; xn |1, 2, 3, 4, 3, 2, 1, 0|;
subplot (3, 1, 3), stem(n, xn)
xlabel('n'), ylabel('x(n)-8point'); grid

0 1 2 3 4 5 6
0
2
4
n
x
(
n
)
-
7
p
o
i
n
t
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0
2
4
n
x
(
n
)
-
6
p
o
i
n
t
0 1 2 3 4 5 6 7
0
2
4
n
x
(
n
)
-
8
p
o
i
n
t



1.7 Frequency response of discrete-time system

For a linear shiIt-invariant system with impulse response h(n), the Fourier transIorm H(c) gives
the frequencv response. Consider the input sequence x(n)
n f
e
e
Ior n , i.e., a complex
exponential oI radian Irequency c and magnitude 1, applied to a linear shiIt-invariant system
whose unit sample response is h(n). Using convolution we obtain the output v(n) as
v(n) h(n) * x(n)

=

k
k n x k h ) ( ) (

k
k n f
e k h
) (
) (
e

n f
e
e

k
k f
e k h
e
) (


H(c)
n f
e
e


Thus we see that H(c) describes the change in complex amplitude oI a complex exponential as a
Iunction oI Irequency. The quantity H(c) is called the frequency response oI the system. In
H(c)
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 65 of 77 Dr. Ravi Billa
general, H(c) is complex valued and may be expressed either in the Cartesian Iorm or the polar
Irom as
H(c) H
R
(c) f H
I
(c) or H(c) ) (
`
e H
) (e H f
e
Z

where H
R
and H
I
are the real part and imaginary part respectively. ) (
`
e H is loosely called the
magnitude and ) (e H Z is loosely called the phase. Strictly speaking, ) (
`
e H is called the zero-
phase frequency response; note that ) (
`
e H is real valued but may be positive or negative. We
may use the symbol [H(c)[ Ior the magnitude which is strictly non-negative. II ) (
`
e H is positive
then
Magnitude ) (e H ) (
`
e H & Phase ) (e H Z
II ) (
`
e H is negative then
Magnitude ) (e H ) (
`
e H ) (
`
e H & Phase ) (e H Z + a
We shall oIten loosely use the symbol ) (e H to reIer to ) (
`
e H as well with the understanding
that when the latter is negative we shall take its absolute value (the magnitude) and accordingly
adjust ) (e H Z by + a.

Example 1.7.1 Moving average filter] The impulse response oI the LTI system
v(n)
3
) 2 ( ) 1 ( ) ( + + n x n x n x

is
h(n) 1/3, n 0, 1, 2
0, otherwise











The Irequency response is obtained below.
H(c)

k
k f
e k h
e
) (

2
0
) 3 / 1 (
k
k f
e
e

3
1
( )
2 1 0 e e e f f f
e e e

+ +

3
e f
e

( )
e e f f
e e

+ +1
3
e f
e


( )
|
|
.
|

\
| +
+

2
2
1
e e f f
e e

3
) cos 2 1 ( e +
e f
e


which is already in the polar Iorm ) (e H + ) (e H
) (e H f
e
Z
, so that
) (e H 3 / ) cos 2 1 ( e + and ) (e H Z c
The zero crossings oI the magnitude plot occur where ) (e H 3 / ) cos 2 1 ( e + 0, or c
) 2 / 1 ( cos
1

2a/3 120
0
. A Irequency oI c 2a/3 rad./sample (f 1/3 cycle/sample) is
totally stopped (Iiltered out) by the Iilter. The corresponding digital signal is x
5
(n) cos
2a(1/3)n. The underlying continuous-time signal, x
5
(t), depends on the sampling Irequency. II,
h(n) (1/3)|u(n) u(n3)|
1/3
0 1 2 3
n
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 66 of 77 Dr. Ravi Billa
Ior example, the sampling Irequency is 16Hz, then x
5
(t) cos 2a(16/3)t, and a Irequency oI 16/3
Hz will be totally Iiltered out. II the sampling Irequency is 150Hz, then x
5
(t) cos 2a(150/3)t,
and a Irequency oI 50 Hz will be eliminated.
In calibrating the horizontal axis in terms oI the cyclic Irequency, F, we use the relation
c OT 2aFT 2aF/F
s
Irom which the point c 2a corresponds to F F
s
.



























6I+.B?8 The system v(n)
3
) (n x

3
) 1 ( n x

3
) 2 ( n x
is a crude low pass Iilter, but the
attenuation does not increase monotonically with Irequency. In Iact, the highest possible
Irequency, F
s
/2 Hz, (or a rad/sample) is not well attenuated at all. The Iollowing is a slight
variation oI the three-term moving average:
v(n)
4
) (n x

2
) 1 ( n x

4
) 2 ( n x

Its magnitude response is a 'raised cosine (with no zero crossing, monotonically decreasing but
wider than the 3-term).
6A/B 21 I+.B?8
[H[ (12 cose)/3
e
0 a 2a a 2a
H Z (c) c
c
0 a 2a a 2a
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 67 of 77 Dr. Ravi Billa
Example 1.7.2 MATLAB 1O'27] Moving average filter]
H(c)
3
1
( )
2 1
1
e e f f
e e

+ + .
The program Iollows. Note that in MATLAB we use w` Ior c and the plot ranges over
(2t, 2t). Both c and the phase, ) (e X Z , are in radians.

subplot(2,1,1);Iplot('abs((1/3)*(1exp(-j*w)exp(-j*2*w)))', |-2*pi,2*pi|, 'k');
xlabel('\omega');ylabel('Magnitude');
subplot(2,1,2);Iplot('angle((1/3)*(1exp(-j*w)exp(-j*2*w)))', |-2*pi,2*pi|, 'k');
xlabel('\omega');ylabel('Phase');


-6 -4 -2 0 2 4 6
0
0.5
1
e
M
a
g
n
i
t
u
d
e
-6 -4 -2 0 2 4 6
-4
-2
0
2
4
e
P
h
a
s
e



|Homework] Plot the output signal v(n)
3
) 2 ( ) 1 ( ) ( + + n x n x n x
Ior several values oI n > 0
where the input is x(n) cos 2a(1/3)n. Take x(1) x(2) 0.

Example 1.7.3 MATLAB 1.'7?3, 13?FJ] Moving average filter] Consider a signal x(t) cos
(2t50t) sampled at 150 Hz. The corresponding x(n) cos (2tn/3) is the input to the moving
average Iilter. The Iollowing MATLAB segment plots x(n) vs. n and v(n) vs. n.

n0:1:50;
xcos(2*pi*n/3);
b|1/3, 1/3, 1/3|; a|1|; Filter coeIIicients
yIilter(b, a, x);
subplot(3, 1, 1), stem(n, x, 'ko');title('Input x(n)Cosine(2\pin/3)');
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 68 of 77 Dr. Ravi Billa
xlabel('n'), ylabel('x(n)')
subplot(3, 1, 2), stem(n, y, 'ko');title('Output y(n)|x(n)x(n-1)x(n-2)|/3');
xlabel('n'), ylabel('y(n)');
w0: pi/256: 2*pi; hIreqz(b, a, w);
subplot(3, 1, 3), plot(w*75/pi, abs(h));title('Magnitude Response');
xlabel('Frequency'), ylabel('Magnitude');


0 5 10 15 20 25 30 35 40 45 50
-1
0
1
nput x(n)=Cosine(2tn/3)
n
x
(
n
)
0 5 10 15 20 25 30 35 40 45 50
-0.5
0
0.5
Output y(n)=[x(n)+x(n-1)+x(n-2)]/3
n
y
(
n
)
0 50 100 150
0
0.5
1
Magnitude Response
Frequency
M
a
g
n
i
t
u
d
e


Example 1.7.4 MATLAB 1.'7?3] Moving average filter] As an extension oI above example,
consider the signal consisting oI a 2 Hz desirable component plus a noise component oI 50 Hz
(with a smaller amplitude), sampled at 150 Hz.
x(t) 5 cos (2t2t) 2 cos (2t50t)
x(n) 5 cos (2tn/75) 2 cos (2tn/3)
In the Iollowing MATLAB segment we show both sequences, x(n) and v(n), on the same
(multi)plot so that they have the same scale. The smoothing action oI the Iilter is easily
discernible in the multiplot.

n 0: 1: 50;
x 5*cos(2*pi*n/75) 2*cos(2*pi*n/3);
b |1/3, 1/3, 1/3|; a |1|; Filter coeIIicients
y Iilter(b, a, x);
plot(n, x, 'b*', n, y, 'ko');
legend ('Input x(n)', 'Output y(n)');
title ('Moving average Iilter');
xlabel ('n'), ylabel('x(n), y(n)');


www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 69 of 77 Dr. Ravi Billa
0 5 10 15 20 25 30 35 40 45 50
-6
-4
-2
0
2
4
6
8
n
x
(
n
)
,

y
(
n
)
Moving average filter
nput x(n)
Output y(n)


The same plot is shown below over a longer period.

0 50 100 150
-6
-4
-2
0
2
4
6
8
n
x
(
n
)
,

y
(
n
)
Moving average filter
nput x(n)
Output y(n)



www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 70 of 77 Dr. Ravi Billa
|Homework] Examples 5.1.1, 5.1.2, 5.1.3 and 5.1.4, Proakis, 4
th
Ed.

%P?7>E?+ 21 .B?(' B.0.7(' '2D O(++ (/B E.0E O(++ 1.'7?3+ Ref. p. 23, O&S for LP filter.

Example 1.7.5 2003] O & S, p. 20, and L.C. Ludeman, p. 51] A linear time-invariant system
has unit sample response h(n) u(n) u(nN). Find the amplitude and phase spectra.
Note that this would be an N-term moving average Iilter iI h(n) (1/N)[ u(n) u(nN)].


h(n) 1, 0 s n s N1
0, elsewhere
H(c)

k
k f
e k h
e
) (

1
0
1
N
k
k f
e
e

e
e
f
N f
e
e

1
1


) (
) (
2 / 2 / 2 /
2 / 2 / 2 /
e e e
e e e
f f f
N f N f N f
e e e
e e e


) 2 / sin(
) 2 / sin(
e
eN
2 / ) 1 ( N f
e
e

[H(c)[
) 2 / sin(
) 2 / sin(
e
eN
and ) (
e f
e H Z c(N1)/2
See the plots in Oppenheim and SchaIer.

Example 1.7.6 MATLAB 1O'27] 5-term moving average filter] The program Ior the case
where N 5 Iollows.
H(c) ( )
4 3 2 1
1
e e e e f f f f
e e e e

+ + + +
e
e
f
f
e
e

1
1
5

Note that in MATLAB we use w` Ior c and the plot ranges Irom 2t to 2t. Both c and the
phase, ) (e X Z , are in radians.

subplot(2,1,1);Iplot('abs((1-exp(-j*w*5))/(1-exp(-j*w)))', |-2*pi,2*pi|, 'k');
xlabel('\omega (Rad)');ylabel('Magnitude');
subplot(2,1,2);Iplot('angle((1-exp(-j*w*5))/(1-exp(-j*w)))', |-2*pi,2*pi|, 'k');
xlabel('\omega (Rad)');ylabel('Phase (Rad)');

h(n) u(n) u(nN)
1
0 1 2 N1
N
n
N terms
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 71 of 77 Dr. Ravi Billa
-6 -4 -2 0 2 4 6
0
2
4
6
e (Rad)
M
a
g
n
i
t
u
d
e
-6 -4 -2 0 2 4 6
-4
-2
0
2
4
e (Rad)
P
h
a
s
e

(
R
a
d
)



1.8 Properties of the discrete-time Fourier transform (DTFT)

For the DTFT Oppenheim & SchaIer use the symbol ) (
e f
e X while Proakis uses X(c).

(1) Periodicity X(c) is periodic with period 2a, that is, X(c2a) X(c) Ior all c. Since
n f
e
e
is
periodic in c with period 2a, it Iollows that X(c) is also periodic with the same period.
Replacing c with (c2a) gives
X(c2a)

=
+
n
n f
e n x
) 2 (
) (
t e

=

n
n f n f
e e n x
t e 2
) (

n
n f
e n x 1 ) (
e

X(c) Ior all c
As a result, while in the continuous time case O ranges Irom to , in the discrete-time case
we need only consider values oI c over the range 0 to 2a (or, a to a, or any 2a-long interval).

(2) Linearity The discrete Fourier-transIorm is a linear operation. II !x
1
(n)} X
1
(c) and
!x
2
(n)} X
2
(c), then !a
1
x
1
(n) a
2
x
2
(n)} a
1
X
1
(c) a
2
X
2
(c) Ior any constants a
1
and a
2
.

(3) Time shifting Time shiIt results in phase shiIt. II !x(n)} X(c), then !x(nk)}
k f
e
e
X(c).
Proof We have
!x(nk)}

n
n f
e k n x
e
) (
On the right hand side set nk m, so that n mk and the limits n to change to m
to . Then
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 72 of 77 Dr. Ravi Billa
!x(nk)}

=
+
m
k m f
e m x
) (
) (
e
e
fck

m
m f
e m x
e
) ( e
fck
X(c) QED

(4) Frequency shifting Multiplication in the time domain by a complex exponential results in
Irequency shiIting. Given !x(n)} X(c), then !{ } ) (
0
n x e
n f e
X(cc
0
).

Proof We have
!{ } ) (
0
n x e
n f e

n
n f n f
e n x e
e e
) (
0

=

n
n f
e n x
) (
0
) (
e e
X(cc
0
) QED
Alternatively, using the synthesis equation,
!
"#
X(cc
0
)}
t 2
1
}

t
e
e e e
2
0
) ( d e X
n f

Set cc
0
so that c c
0
and the limits c 0 to 2a change to c
0
to (c
0
2a), which
amounts to any interval oI length 2a. Also dc d. Then
!
"#
X(cc
0
)}
t 2
1
}
+
t
e

2
) (
0
) ( d e X
n f


n f
e
0
e

t 2
1
}
t


2
) ( d e X
n f

n f
e
0
e
x(n) QED

(5) Time reversal corresponds to Irequency reversal. Given !x(n)} X(c), then !x(n)}
X(c).
Proof We have
!x(n)}

n
n f
e n x
e
) (
On the right hand side set m n so that the limits n to change to m to , and
!x(n)}


= m
m f
e m x
e
) (
Since this is a summation the limits can be written in reverse order, and we have
!x(n)}

=

m
m f
e m x
) (
) (
e
X(c) ) (
e f
e X

QED

(6) Differentiation in frequency !n x(n)}
e
e
d
e dX
f
f
) (
. Since
) (
e f
e X

n
n f
e n x
e
) (
we diIIerentiate both sides with respect to c to get
e
e
d
e dX
f
) (

n
n f
d
de
n x
e
e
) (

n
n f
e fn n x
e
) ( ) (
or
e
e
d
e dX
f
f
) (

n
n f
e n x n
e
) ( !n x(n)} QED

(7) Convolution II v(n) represents the convolution oI two discrete-time signals x(n) and h(n),
that is, v(n) x(n)*h(n), then
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 73 of 77 Dr. Ravi Billa

) (
e f
e Y !x(n)*h(n)} ) (
e f
e X . ) (
e f
e H

From the deIinition oI the Fourier transIorm
) (
e f
e Y

n
n f
e n v
e
) (

n
n f
e n h n x
e
)} ( * ) (

=
)
`

n
n f
k
e k n x k h
e
) ( ) (
Interchanging the order oI summation
) (
e f
e Y

)
`

k n
n f
e k n x k h
e
) ( ) (
The inner sum (I.S.) is handled thus: Let (nk) . Then as n goes Irom to , goes Irom
to as well. Further n k. Thus the inner sum becomes
I.S.

n
n f
e k n x
e
) (

=
+

) (
) (
k f
e x
k f f
e e x
e

|
|
.
|

\
|

) ( e
fck
) (
e f
e X
Thus we have
) (
e f
e Y ( ) { }

k
f k f
e X e k h
e e
) ( X(e
fc
)

k
k f
e k h
e
) ( ) (
e f
e X . ) (
e f
e H
The Iunction ) (
e f
e H is reIerred to as the frequency response oI the system.

(8) Multiplication of two sequences Let v(n) be the product oI two sequences x
1
(n) and x
2
(n)
with transIorms ) (
1
e f
e X and ) (
2
e f
e X , respectively. Then

) (
e f
e Y !x
1
(n). x
2
(n)} ) (
1
e f
e X * ) (
2
e f
e X

t 2
1
( ) ( )
}

t
u e u
u
2
) (
2 1
d e X e X
f f

This is called periodic convolution since both ) (
1
e f
e X and ) (
2
e f
e X are periodic Iunctions.

(9) Parseval`s Theorem II x(n) and ) (
e f
e X are a Fourier transIorm pair, then

= n
n x
2
) (
t 2
1
( )
}
t
e
e
2
2
d e X
f

Proof The energy E oI the discrete-time sequence is deIined as
E

= n
n x
2
) (

= n
n x n x ) ( ) (
*

Making the substitution x
*
(n)
t 2
1
( )
}

t
t
e e
e d e e X
n f f *
, we get
E ( )

)
`

n
n f f
d e e X n x
t
t
e e
e
t
*
2
1
) (
Interchanging the order oI integration and summation,
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 74 of 77 Dr. Ravi Billa
E
t 2
1
( )
}

|
|
.
|

\
|
t
t
e e
e d e n x e X
n
n f f
) (
*

t 2
1
( ) ( )
}

t
t
e e
e d e X e X
f f *


t 2
1
( )
}

t
t
e
e d e X
f
2
QED

(10) Scaling - expansion in time For continuous-time Fourier transIorms we have the property
that iI x(t) X(O), then x(at)
a
1
|
.
|

\
| O
a
X . This amounts to time-compression iI a ~ 1 and to
time-expansion iI a 1.
The relation between time- and Irequency-scaling in discrete time takes on a somewhat
diIIerent Iorm though. However, there is a result that does closely parallel x(at)
a
1
|
.
|

\
| O
a
X .
DeIine v(n) x(n/k), where k is a positive integer, as

v(n) x(n/k), iI n is a multiple oI k
0, iI n is not a multiple oI k

This is time expansion. For example, iI k 3, then v(n) is obtained Irom x(n) by placing k1 2
zeros between successive values oI x(n). That is,

v(0) x(0), v(1) v(2) 0, v(3) x(1), v(4) v(5) 0, . Etc.

Since v(n) equals zero unless n is a multiple oI k, i.e., unless n rk, where r all integers Irom
to , we have the Fourier transIorm oI v(n) as:
( )
e f
e Y

n
n f
e n v
e
) (

r
k r f
e rk v
e
) (
Since v(rk) x(rk/k) x(r), we have
( )
e f
e Y

r
k r f
e r x
e
) (

r
r k f
e r x
) (
) (
e
( )
e k f
e X
Thus we have the relation: Given x(n) ( )
e f
e X , then x(n/k) ( )
e fk
e X .

Example 1.8.1 2003] (Frequency response) A discrete-time system is given by

v(n) 5 v(n1) x(n) 4 x(n1)

where x(n) is the input and v(n) is the output. Determine its magnitude and phase response as a
Iunction oI Irequency.
Solution The Irequency response is obtained by taking the discrete-time Fourier transIorm oI
both sides oI the diIIerence equation:

!v(n) 5 v(n1)} !x(n) 4 x(n1)}

With !v(n)} ) (
e f
e Y and !v(nk)} e
fck
) (
e f
e Y the above equation becomes

) (
e f
e X
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 75 of 77 Dr. Ravi Billa
) (
e f
e Y 5 e
fc
) (
e f
e Y ) (
e f
e X 4 e
fc
) (
e f
e X
) (
e f
e Y (1 5 e
fc
) ) (
e f
e X (1 4 e
fc
)
) (
) (
e
e
f
f
e X
e Y
) (
e f
e H
e
e
f
f
e
e

+
5 1
4 1

|
.
|

\
|

|
.
|

\
|
+

+
+ +
e
e
e
e
e e
e e
cos 5 1
sin 5
tan
2 2
cos 4 1
sin 4
tan
2 2
1
1
) sin 5 ( ) cos 5 1 (
) sin 4 ( ) cos 4 1 (
f
f
e
e


2 2
2 2
) sin 5 ( ) cos 5 1 (
) sin 4 ( ) cos 4 1 (
e e
e e
+
+ +
|
|
.
|

\
|
|
.
|

\
|

|
.
|

\
|
+


e
e
e
e
cos 5 1
sin 5
tan
cos 4 1
sin 4
tan
1 1
f
e
With the notation ) (e H
) (
) (
e
e
H f
e H
Z
we can identiIy the magnitude and phase, respectively,
as Iollows:
[H(c)[
2 2
2 2
) sin 5 ( ) cos 5 1 (
) sin 4 ( ) cos 4 1 (
e e
e e
+
+ +

e
e
cos 10 26
cos 8 17

+

) (
e f
e H Z
)
`

|
.
|

\
|

+
|
.
|

\
|
+


e
e
e
e
cos 5 1
sin 5
tan
cos 4 1
sin 4
tan
1 1


The MATLAB program Iollows Ior H(c)
e
e
f
f
e
e

+
5 1
4 1
. Note that in MATLAB we use w`
Ior c and the plot ranges Irom 2t to 2t. Both c and the phase, ) (e X Z , are in radians.

subplot(2,1,1);Iplot('abs((14*exp(-j*w))/(1-5*exp(-j*w)))', |-2*pi,2*pi|, 'k');
xlabel('Omega');ylabel('Magnitude');
subplot(2,1,2);Iplot('angle((14*-exp(-j*w))/(1-5*exp(-j*w)))', |-2*pi,2*pi|, 'k');
xlabel('Omega');ylabel('Phase');

-6 -4 -2 0 2 4 6
0.5
1
1.5
Omega
M
a
g
n
i
t
u
d
e
-6 -4 -2 0 2 4 6
-0.1
-0.05
0
0.05
0.1
Omega
P
h
a
s
e

www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 76 of 77 Dr. Ravi Billa

Example 1.8.2 Convolution] II ) (
e f
e X DTFTx(n)} and v(n) x(n)*x(n) then Irom
Properties 5 and 7 ) (
e f
e Y DTFTv(n)} DTFTx(n)*x(n)} ) (
e f
e X ) (
e f
e X

. This result
may also be obtained Irom the deIining equation
) (
e f
e Y

n
n f
e n x n x
e
)} ( * ) (
The convolution within the braces is x(n)*x(n)

=

k
k n x k x )) ( ( ) ( , so that
) (
e f
e Y

=
)
`

n
n f
k
e n k x k x
e
) ( ) (

k n
n f
e n k x k x
e
) ( ) (
Set kn m etc.

Example 1.8.3 2009] Convolution] II ) (
e f
e X DTFTx(n)} and v(n) ) ( ) ( n x n x -
-
Iind
) (
e f
e Y DTFTv(n)}.

Example 1.8.4 2008] Find a diIIerence equation to implement a Iilter with unit sample response
h(n) ( ) ) ( ) 3 / cos( 4 / 1 n u n
n
t
Solution In the math manipulation it would help to write ) 3 / cos( t n in its exponential Iorm. You
should also memorize the two standard :-transIorm pairs: % ) ( ) cos(
0
n u n e } and
% ) ( ) cos(
0
n u n a
n
e }.
Hint Either use DTFT: Find the DTFT !h(n)} H(e
fc
)
) (
) (
e
e
Dr
Nr
.
1) Based on the relation
) (
) (
e
e
f
f
e X
e Y
H(e
fc
) set
) (
) (
e
e
f
f
e X
e Y

) (
) (
e
e
Dr
Nr
,
2) Cross-multiply to get Y(e
fc
) Dr(e) X(e
fc
) Nr(e),
3) Take inverse DTFT using time-shiIting property (see below), and
4) Rearrange terms.
Or, use :-transIorms: Find the z-transIorm %h(n)} H(:)
) (
) (
: Dr
: Nr
.
1) Based on the relation
) (
) (
: X
: Y
H(:) set
) (
) (
: X
: Y

) (
) (
: Dr
: Nr
,
2) Cross-multiply to get Y(:) Dr(:) X(:) Nr(:),
3) Take inverse :-transIorm using time-shiIting property, and
4) Rearrange terms.

Example 1.8.5 2008] Find the inverse DTFT oI ) (
e f
e X
e 10
) 3 / 1 ( 1
1
f
e

.
Hint Use the result, derived in an earlier example, that Ior the exponential sequence x(n)
n
a u(n), ,a, 1, the DTFT is
) (
e f
e X

0 n
n f n
e a
e
( )

0 n
n
f
ae
e

e f
e a

1
1
with a 1/3
www.jntuworld.com
www.jntuworld.com
DSP-1 (ntro) 77 of 77 Dr. Ravi Billa
Then use the scaling property that iI x(n) ( )
e f
e X , then x(n/k) ( )
e fk
e X with k 10.
Alternatively, use the deIining equation
!
"#
X(c)} x(n)
t 2
1
}

t
t
e e
e d e e X
n f f
) (

Example 1.8.6 Scaling - compression in time] Given x(n) ( )
e f
e X and v(n) x(2n), Iind
( )
e f
e Y .
Solution This is a specific result, not a general property. We have
( )
e f
e Y

n
n f
e n v
e
) (

n
n f
e n x
e
) 2 (

even n
n f
e n x
2 /
) (
e

{ }

+
n
n f n
e n x n x
2 /
) ( ) 1 ( ) (
2
1
e

n
n f
e n x
2 /
) (
2
1
e
( )

n
n
f
e n x
2 /
) 1 ( ) (
2
1
e

| |

n
n
f
e n x
) 2 / (
) (
2
1
e
| |

n
n
f
e n x
) 2 / (
) (
2
1
e

Notationally, we may write this as
( )
e f
e Y
2
1
( )
2 / e f
e X
2
1
( )
2 / e f
e X


www.jntuworld.com
www.jntuworld.com

You might also like