Anda di halaman 1dari 36

# DIGITAL SIGNAL PROCESSING

(DSP)

SIGNAL PROCESSING
Topics
• Continuous time (CT) and Discrete time (DT) signals
• Periodic and pulse signals
• Energy and power in signals
• Standard CT and DT signals
• Impulse, step, pulse, ramp, sine and exponential
• Analysis of CT signals
• Fourier Series and Fourier Transforms
• Convolution and Correlation
• Analysis of DT signals
• Discrete Fourier Transform of DT signals
• Fast Fourier Transform
• Z Transform
• Digital filtering in time domain
• Linear Filters
• FIR Filters
• IIR Filters
SIGNAL
• A signal is defined as any physical quantity that varies with time, space or any other
independent variable or variables.
• Mathematically, a signal can be represented as a function of one or more independent
variables.
S1(t) = 7t
S2(t) = 18t2.
Here S1(t) and S2(t) represents two signals- one that varies linearly with time t and the
other varies quadratically with t.
• Complex signals are there which cannot be expressed by simple mathematical
equations. (eg: speech signal, ECG , EEG…)

SIGNAL

## Analog Discrete and

Digital
Analog signals
Analog Analog
Input Analog Output
Signal signal processor Signal

Analog System

• Analog signals are continuous function of an independent variable, such as time, space
etc.
• It is defined for every instant of independent variable, so the magnitude is continuous
in the specified range for analog signals.

## • Signals can be easily processed directly by appropriate analog systems.

DIGITAL SIGNAL PROCESSING (DSP)

## • The Digital Signal processing is the processing of signals by digital systems.

• The digital systems are either software, hardware or firmware.
• In digital processing of signal on a digital computer, the operation performed on
a signal consists of a number of mathematical operations as specified by a
software program.
• Program represents an implementation of system in software
• Digital hardware (logic circuits) also can be used as system in hardware to
perform the desired operations.

## A/D Digital Signal D/A

Converter Processor Converter
Analog Digital Digital Analog
Input Input Output Output
Signal Signal Signal Signal
Advantages of DSP:

## Flexibility : Digital programmable system allow flexibility in

reconfiguring the DSP operations by simply changing the program
Accuracy : DSP provides better control of accuracy requirements, while
tolerance limits has to be met in the analog counterpart
Easy Storage : Digital signals can be easily stored in magnetic media without
deterioration or loss of signal fidelity. They can also be easily
transported and processed off-time in remote laboratories.
Processing : DSP allows for the implementation of more sophisticated signal
processors than its analog counterparts.
Cost effective : With advancement in VLSI technology the digital
implementation of the signal processing system is cheaper.

Limitations of DSP:
1. The conversion speed of ADC and the processing speed of signal processors
should be very high to perform all real time processing
2. Signals of high bandwidth require fast sampling rate ADCs and fast processors.
Applications of DSP:

## Speech Processing : Speech compression & decompression for voice storage

system and for transmission & reception of voice signals.
Speech synthesis in message warning systems.
Communication : Elimination of noise by filtering and echo cancellation
by adaptive filtering in transmission channels.
Biomedical : Spectrum analysis of ECG signals to identify various
disorders in heart. Spectrum analysis of EEG signals to
study the malfunctions or disorders in the brain.
Consumer electronics : Music synthesis, Karoake systems, Surround sound
systems, Digital audio & video.
Seismology : Spectrum Analysis of seismic signals (I.e. signals
generated by movement of rocks) can be used to predict the
Earthquake, Volcanic eruptions, Nuclear explosions and
Earth movement.
Image processing : Two different filtering on images for image
enhancement, finger print matching, identifying hidden
images in the signals received by radars etc.
DISCRETE TIME SIGNALS
A discrete time signal x(n) is a function of an independent variable where the independent
variable is an integer.
Signal x(n) is not defined for non-integer values of n.
A discrete time signal is defined for every integer value of ‘n’ in the range -∞ < n < ∞

## Methods of representing Discrete Time signal

1. Functional representation 2. Graphical representation
x(n) = -1 ; n = -2 x(n)
2 ; n = -1 2
1.6
1.5 ; n = 0 1.5 1.4
-0.9 ; n = 1
1.4 ; n = 2 -2 -1 0 1 2 3
1.6 ; n= 3
-1 0.9
0 ; other n
3. Tabular representation

n -2 -1 0 1 2 3
x(n) -1 2 1.5 -0.9 1.4 1.6

4. Sequence representation

## An infinite duration signal or sequence with the time origin (n = 0) indicated by

the symbol is represented as
x(n) = {… -1, 2, 1.5, -0.9, 1.4, 1.6 …}

## Some Elementary Discrete Time signals

1. Digital impulse signal or unit sample sequence δ(n)
1;n≥0 1
Impulse signal, δ(n) =
0;n≠0

0 n
δ1(n)
1;n≥0
Delayed impulse δ1(n) = δ(n – n0) = 1
0;n≠0

n0 n

## 2. Unit Step signal

u(n)
1;n≥0
Unit step signal, u(n) = 1
0;n<0

0 n
The unit step signal is related to digital impulse by the
summation relation Unit step signal

## u(n) = Ʃ δ( n – k ) summation limit is k = 0 to infinity

ur(n)
3. Ramp signal

n;n≥0
Ramp signal, ur(n) =
0;n<0
n

Ramp signal

4. Exponential signal
g(n)
a ;n≥0
n
0<a<1
Exponential signal, g(n) =
0;n<0

Exponential signal
Mathematical operations on Discrete Time signals

1. Shifting in time

A signal x(n) may be shifted in time by replacing the independent variable ‘n’ by
‘n-k’, where ‘k’ is an integer. If k is positive integer, the time shift results in a
delay by k units of time. If k is negative integer, the time shift results in an
advance of the signal by mod(k) units in time. The delay results in shifting each
sample of x(n) to right. The advance results in shifting each sample of x(n) to left.

x(n) 3
Eg:-
Let x(n) = 1 ; n = 2 2
1
2; n = 3
3; n = 4 0 1 2 3 4 5 6
Let x1(n) = x(n-2), where x1 is delayed signal
of x(n) x1(n) 3
2
when n = 4; x1(4) = x(4-2) = x(2) = 1 1
when n = 5; x1(5) = x(5-2) = x(3) = 2
when n = 6; x1(6) = x(6-2) = x(4) = 3 0 1 2 3 4 5 6
n

## Let x2(n) = x(n+2), where x2 is advanced signal

x2(n) 3
of x(n)
2
when n = 0; x2(0) = x(0+2) = x(2) = 1 1

## when n = 1; x2(1) = x(1+2) = x(3) = 2

0 1 2 3 4 5 6
when n = 2; x2(2) = x(2+2) = x(4) = 3 n
2. Folding or reflection or Transpose

The folding of a signal x(n) is performed by changing the sign of the time base n
in the signal x(n). The folding operation produces a signal x(-n) which is mirror
of x(n) with respect to time origin n = 0.
Eg:- Let x(n) = n; -3 ≤ n ≤ 3. Now folded signal x1(n) = x(-n) = -n; -3 ≤ k ≤ 3

x 1(n)
x (n)

-3 -2 -1 1 2 3

0 1 2 3 n 0 n
-3 -2 -1

## 3. Amplitude scaling or scalar multiplication

Amplitude scaling of a signal by a constant A is accomplished by multiplying the
value of every signal sample by A.
Let y(n) be amplitude scaled signal of x(n), then y(n) = Ax(n)
Let x(n) = 20 ; n = 0 and A = 0.1, then y(n) = 2.0 ; n=0
36 ; n = 1 3.6 ; n=1
40 ; n = 2 4.0 ; n=2
-15 ; n = 3 -1.5 ; n=3

## In a signal, x(n), if n is replaced by λn, where λ is an integer, then it is called the

scaling or down sampling.
Eg:- If x(n) = an; n ≥ 0; then x1(n) = x(2n) = an for even values of n

x(n) x1(n)

n n
0 1 2 3 4 5 0 1 2 3 4 5
5. Signal (vector) addition

The sum of two signals x1(n) and x2(n) is a signal y(n), whose value at any instant
is equal to the sum of the samples of these two signals at that instant.
i.e. , y(n) = x1(n) + x2(n) ; -∞ < n < ∞

## Eg:- Let x1(n) = {1, 2, -1, 2} and x2(n) = {-2, 1, 3, 1}

When n = 0; y(0) = x1(0) + x2(0) = 1 + (-2) = -1
When n = 1; y(1) = x1(1) + x2(1) = 2 + 1 = 3
When n = 2; y(2) = x1(2) + x2(2) = -1 + 3 = 2
When n = 3; y(3) = x1(3) + x2(3) = 2 + 1 = 3
y(n) = x1(n) + x2(n) = {-1, 3, 2, 3}
6. Product or vector multiplication

## Signal multiplication results in the product of two signals on a sample – by –

sample basis. The product of two signals x1(n) and x2(n) is a signal y(n), whose
value at instant is equal to the product of the samples of these two signals at that
instant. The product is also called modulation.
Eg:- Let x1(n) = {1, 2, -1, 2} and x2(n) = {-2, 1, 3, 1}
When n = 0; y(0) = x1(0) x x2(0) = 1 x (-2) = -2
When n = 1; y(1) = x1(1) x x2(1) = 2 x 1 = 2
When n = 2; y(2) = x1(2) x x2(2) = -1 x 3 = -3
When n = 3; y(3) = x1(3) x x2(3) = 2 x 1 = 2
y(n) = x1(n) x x2(n) = {-2, 2, -3, 2}

## Classification of Discrete Time signals

The discrete time signals are classified depending on their characteristics. Some
ways of classifying discrete time signals are :
2.Energy signals and power signals
3.Periodic and aperiodic signals
4.Symmetric and antisymmetric signals
1. Energy signals and power signals ………… 1

## The energy E of a signal x(n) is defined as

E = Ʃ |x(n)|2 , summation over n= -∞ to ∞

The energy of a signal may be finite or infinite, and can be applied to complex
valued and real-valued signals. If E is finite (0 < E < ∞), then x(n) is called an
energy signal.

## The average power of a discrete time signal x(n) is defined as

P = lim (1/ (2N+1)) Ʃ |x(n)|2 limit is as n tends to infinity; ……….. 1
the summation is over n = -N to N

## If we define the signal of x(n) over the finite interval –N ≤ n ≤ N as

EN = Ʃ |x(n)|2 ; Where summation is over n = -N to N…………. 2
Then we can express the signal energy E as,
E = lim EN ; as N tends to ∞ ………… 3
Then average power of the signal is
P = lim (1 / 2N+1) EN ……………. 4

## If E is finite, then P = 0. If E is infinite, then P may be finite or infinite. If P is finite and

non-zero, then the signal is called power signal.
Fourier transform
In mathematics, the continuous Fourier transform is one of the specific forms of Fourier
analysis. As such, it transforms one function into another, which is called the frequency
domain representation of the original function (where the original function is often a
function in the time-domain). In this specific case, both domains are continuous and
unbounded. The term Fourier transform can refer to either the frequency domain
representation of a function or to the process/formula that "transforms" one function into
the other.

There are several common conventions for defining the Fourier transform of a complex-
valued Lebesgue integrable function, x In communications and signal processing, for
instance, it is often the function:

## for every real number f

When the independent variable f represents time (with SI unit of seconds), the
transform variable represents ordinary frequency (in hertz). If is Hölder continuous,
then it can be reconstructed from X by the inverse transform:

## for every real number t

FOURIER TRANSFORM OF DISCRETE TIME SIGNALS
The Fourier transform (FT) of discrete time signals is called discrete time fourier
transform (DTFT).

## Let x(n) = Discrete-time signal

X(ɷ) or X(eiɷ) = Fourier transform of x(n)

The fourier transform of a finite energy discrete time signal, x(n) is defined as

## X(ɷ) = Ʃ e-jɷn , summation is over n = -infinity to +infinity

The Fourier transform is one of the several mathematical tools that is useful in the
analysis and design of LTI (Linear Time Invariant) system. Another one is the Fourier
Series. These signal representations basically involve the decomposition of the signals in
terms of sinusoidal components. In such a decomposition, the signal is said to be represent
in the frequency domain.
To obtain the Fourier Transform representation, we shall start by finding the Fourier
transformation of sampled Analog signal.

## Let the sampled analog signal = xa*(t)

Its Fourier transform is given by ,
F{xa*(t)} = - ʃ xa*(t) e-jωt dt (limit is from –infinity to +infinity)

## Again this can be written as ,

= ʃ Σ xa (nT) δ(t-nT) e-jω(nT) dt (limit is from –infinity to +infinity)

## We define the Fourier transform to be,

F{xa*(t)} when T = 1
i.e., X(ejω) = F{x(n)} = Σ x(n) e-jωn at T = 1
From the above equation, we find that X(ejω) is a complex no., and it consists of real part
and imaginary part.

## Fourier Transform Theorems and Properties

1. Linearity
If x1(n) is Fourier transformed to X1(ejω)

## and x2(n) ----------------- X2(ejω)

Then ,
ax1(n) + bx2(n) ----------------- aX1(ejω) + bX2(ejω)

Proof:
F{ax1(n) + bx2(n)} = Σ(ax1(n) + bx2(n)) e-jωn
= Σ ax1(n) e-jωn + Σ bx2(n) e-jωn

## = a Σ x1(n) e-jωn + b Σ x2(n) e-jωn

= a X1(ejω) + b X2(ejω)
2. Time Shifting Property

## If x(n) ----------------- X(ejω)

Then ,
x(n-k) ----------------- e-jωk X(ejω)

Proof:

Let n-k = p

## F{x(p)} = e-jωk Σ x(p) e-jωp = e-jωk X(ejω)

(limit is from p=-infinity to + infinity). Hence proved.
3. Time Reversal

## If x(n) ----------------- X(ejω)

Then ,
x(-n) ----------------- X(e-jω)

Proof:

Let -n = p

## F{x(p)} = Σ x(p) ejωp

F{x(p)} = X (e-jω)
(limit is from p=-infinity to + infinity). Hence proved.

4. Convolution Theorem

## x2(n) ----------------- X2(ejω)

Then ,
x1(n) * x2(n) ----------------- X1(ejω) * X2(ejω)

Proof:

## x1(n) * x2(n) ----------------- Σ x1(k) * x2(n-k)

(summation is from k=-infinity to + infinity)
Fourier transform,

## x1(n) * x2(n) ----------------- Σ x1(n) * x2(n) e-jωn

(summation is from n=-infinity to + infinity)

## = Σ Σ x1(k) * x2(n-k) e-jωn

(first summation is from k=-infinity to + infinity, second is over the same limit for n.)

Put n-k = p

## = Σ x1(k) Σ x2(p) e-jω(p+k)

(limit is for p = -infinity to + infinity)

## = Σ x1(k) e-jωk Σ x2(p) e-jωp

5. Differentiation in frequency domain

Then,

Proof:

Results:

## Inverse Fourier Transform, x (n) = 1 / 2π ʃ X (ejω) ejωn dω

Linear Time Invariant Systems
linear time-invariant system are, of course, linearity and time invariance
•Linearity means that the relationship between the input and the output of the system
satisfies the superposition property. If the input to the system is the sum of two
component signals:

## where a & b = any constant number

where yn(t) is the output resulting from the sole input xn(t).
•Time invariance means that whether we apply an input to the system now or T seconds
from now, the output will be identical, except for a time delay of the T seconds. If the
output due to input x(t) is y(t), then the output due to input x(t − T) is y(t − T). More
specifically, an input affected by a time delay should effect a corresponding time delay in
the output, hence time-invariant.

The fundamental result in LTI system theory is that any LTI system can be characterized
entirely by a single function called the system's impulse response. The output of the
system is simply the convolution of the input to the system with the system's impulse
response. This method of analysis is often called the time domain point-of-view. The same
result is true of discrete-time linear shift-invariant systems, in which signals are discrete-
time samples, and convolution is defined on sequences.

## Relationship between the time domain and the frequency domain

Impulse Response
The impulse response of a system is its output when presented with a very brief input
signal, an impulse. An impulse represents the limiting case of a pulse made very short
in time while maintaining its area or integral (thus giving an infinitely high peak).
While this is impossible in any real system, it is a useful concept as an idealization.
A system in the class known as LTI systems (linear, time-invariant systems) is
completely characterized by its impulse response.

The Impulse response from a simple audio system. Showing the original impulse, with high
frequencies boosted, then with low frequencies boosted.
Practical applications of Impulse response
• Loudspeakers
A very useful real application that demonstrates this idea was the development of
impulse response loudspeaker testing in the 1980s which led to big improvements in
loudspeaker design. Loudspeakers suffer from phase inaccuracy, a defect unlike
normal measured properties like frequency response.

• Digital Filtering
Impulse response is a very important concept in the design of digital filters for
audio processing, because these differ from 'real' filters in often having a pre-echo,
which the ear is not accustomed to.

• Electronic processing
Impulse response analysis is a major facet of radar, ultrasound imaging, and many
areas of digital signal processing. An interesting example would be broadband
internet connections. Where once it was only possible to get 4 kHz speech signal
over a local telephone wire, or data at 300 bit/s using a modem, it is now
commonplace to pass 2 Mb/s over these same wires, largely because of 'adaptive
equalisation' which processes out the time smearing and echoes on the line.
FIR Systems
In FIR (Finite duration Impulse response) systems, the impulse response consists of
finite number of samples. The convolution formula for FIR system is given by,

## y(n) = Σ h(k) x(n-k) ……….……… 1

Where h(n) = 0; n < 0 and n ≥ N

From eqn 1 , it can be concluded that the impulse response selects only N samples of the
input signal.

Thus, the system acts as a window that views only the most recent N input
signal samples in forming the output. It neglects all prior input samples. So a FIR
system has a finite memory of length N samples.

## y(n) = Σ bk x(n-k) ……….……… 2

Where summation is over k = 0 to N-1

## Z{x(n-k)} = z-k X(z)

On taking Z transform of eqn 2, we get,

## Eqn 3 is the general form of transfer function of FIR system.

IIR Systems
In IIR (Infinite duration Impulse Response) systems, the impulse response has infinite
number of samples. The convolution formula for IIR systems is given by,

## y(n) = Σ h(k) x(n-k)

Since, this sum involves the present and all the past input sample, we can say that the
system has an infinite memory.

## y(n) = - Σ ak y(n-k) + Σ bk y(n-k) ….……… 4

Where the first summation is from k=1 to N and the second summation is over k=0 to M
Let Z{y(n)} = Y(z) ; Z{y(n-k)} = z-k Y(z)
Let Z{x(n)} = X(z) ; Z{x(n-k)} = z-k X(z)

## Y(z) = - Σ ak z-k Y(z) + Σ bk z-k X(z)

Y(z) + Σ ak z-k Y(z) = Σ bk z-k X(z)
(1 + Σ ak z-k) Y(z) = Σ bk z-k X(z)

## H(z) = Y(z) / X(z) = Σ bk z-k / (1+Σ ak z-k)

….……… 5
= (b0 + b1 z + b2 z + .. + bM z ) / (1 + a1 z + a2 z + .. + aN z )
-1 -2 -M -1 -2 -N

## The eqn 5 is the general form of transfer function of IIR System.

Infinite Impulse Response (IIR)
Infinite impulse response (IIR) is a property of signal processing systems. Systems
with that property are known as IIR systems or when dealing with electronic filter
systems as IIR filters. They have an impulse response function which is non-zero over an
infinite length of time. This is in contrast to finite impulse response filters (FIR) which
have fixed-duration impulse responses.

The simplest analog IIR filter is an RC filter made up of a single resistor (R)
feeding into a node shared with a single capacitor (C). This filter has an exponential
impulse response characterized by an RC time constant.

## Finite Impulse Response (FIR)

A finite impulse response (FIR) filter is a type of a digital filter. The impulse response,
the filter's response to a Kronecker delta input, is 'finite' because it settles to zero in a
finite number of sample intervals. This is in contrast to infinite impulse response filters
which have internal feedback and may continue to respond indefinitely. An Nth order
FIR filter has a response to an impulse that is N+1 samples in duration.
Z - transform
In mathematics and signal processing, the Z-transform converts a discrete time-domain
signal, which is a sequence of real or complex numbers, into a complex frequency-
domain representation.

## The Z-transform and advanced Z-transform were introduced (under the Z-

transform name) by E. I. Jury in 1958 in Sampled-Data Control Systems (John Wiley &
Sons). The idea contained within the Z-transform was previously known as the
"generating function method".

The Z-transform, like many other integral transforms, can be defined as either a one-
sided or two-sided transform.

Bilateral Z-transform

The bilateral or two-sided Z-transform of a discrete-time signal x[n] is the function X(z)
defined as

## where n is an integer and z is, in general, a complex number:

z = Aejφ
where A is the magnitude of z, and φ is the complex argument (also referred to as angle
or phase) in radians.