You are on page 1of 36

# Basics on Digital Signal Processing

Introduction

Vassilis Anastassopoulos
Electronics Laboratory, Physics Department,
University of Patras

## Outline of the Course

1. Introduction (sampling quantization)
2. Signals and Systems
3. Z-Transform
4. The Discreet and the Fast Fourier Transform
5. Linear Filter Design
6. Noise
7. Median Filters

2/36

## Analog & digital signals

Analog

Digital
Discrete function Vk of
discrete sampling
variable tk, with k =
integer: Vk = V(tk).

Sampled
Signal

0.3

0.3

0.2

0.2

Voltage [V]

Voltage [V]

Continuous function V
of continuous variable t
(time, space etc) : V(t).

0.1
0
-0.1
-0.2

0.1
0
ts ts

-0.1
-0.2

4
6
time [ms]

10

2
4
6
8
sampling time, tk [ms]

10

## Uniform (periodic) sampling.

Sampling frequency fS = 1/ tS

3/36

4/36

## Digital vs analog processing

Digital Signal Processing (DSPing)

Limitations

## A/D & signal processors speed:

wide-band signals still difficult to
treat (real-time systems).

More flexible.

## Better control over accuracy

requirements.
Reproducibility.
Linear phase
No drift with time and
temperature
5/36

Applications

## Implementing a certain processing task.

Studying a certain signal.

Hardware

Software

Fast

Faster

real-time
DSPing

## Programming languages: Pascal, C / C++ ...

High level languages: Matlab, Mathcad, Mathematica

6/36

Related areas

7/36

Applications

8/36

## Important digital signals

Unit Impulse or Unit Sample.
(nTs)

[(n-3)s]

two reasons
ns past

u(nTs)

ns past

(n)=u(n)-u(n-1)

r(nTs)

ns past

9/36

General scheme

ms
V

## Sometimes steps missing

ms
A

(ex: economics);

- D/A + filter
(ex: digital output wanted).

Antialiasing

A
k
V

ms

A/D

Digital
Processing

Digital
Processing
D/A

Filter

Reconstruction
ms

ANALOG
DOMAIN

Topics of this
lecture.

A/D
DIGITAL
DOMAIN

- Filter + A/D

Filter
Filter
Antialiasing

ANALOG
DOMAIN

10/36

Antialiasing
Filter

A/D
Digital
Processing

## KEY DECISION POINTS:

Analysis bandwidth, Dynamic range

## Pass / stop bands.

Sampling rate.
No. of bits. Parameters.
Digital format.

1
2
3

## What to use for processing?

DIGITAL OUTPUT
11/36

12/36

13/36

Sampling

14/36

Sampling
How fast must we sample a continuous
signal to preserve its info content?

## Ex: train wheels in a movie.

25 frames (=samples) per second.
Train starts

wheels go clockwise.

Train accelerates

wheels go counter-clockwise.

Why?
Frequency misidentification due to low sampling frequency.

15/36

Rotating Disk

## How fast do we have to instantly

stare at the disk if it rotates
with frequency 0.5 Hz?

16/36

## A signal s(t) with maximum frequency fMAX can be

Theo* recovered if sampled at frequency f > 2 f
S
MAX .
* Multiple proposers: Whittaker(s), Nyquist, Shannon, Kotelnikov.
Naming gets
confusing !

## Nyquist frequency (rate) fN = 2 fMAX or fMAX or fS,MIN or fS,MIN/2

Example
s(t) 3 cos(50 t) 10 sin(300 t) cos(100 t)

F1

F2

Condition on fS?

F3
fS > 300 Hz

fMAX
17/36

18/36

## Sampling low-pass signals

Continuous spectrum

(a)

## (a) Band-limited signal:

frequencies in [-B, B] (fMAX = B).

-B

(b)

Discrete spectrum
No aliasing

## (b) Time sampling

frequency

repetition.
fS > 2 B
-B

B fS/2

Discrete spectrum
Aliasing & corruption

(c)

fS/2

no aliasing.

(c) fS

2B

aliasing !

## Aliasing: signal ambiguity

in frequency domain
19/36

Antialiasing filter

(a)

## (a),(b) Out-of-band noise can aliase

Signal of interest

Out of band
noise

Out of band
noise

-B

(b)

## (c) Antialiasing filter

Passband: depends on bandwidth of
interest.

(c)

-B
f

B fS/2

## AMIN, dB ~ 6.02 N + 1.76

Out-of-band noise magnitude.
Other parameters: ripple, stopband
frequency...

20/36

Under-sampling

## Using spectral replications to reduce

sampling frequency fS reqments.

Bandpass signal
centered on fC

0
f

2 fC B
2 fC B
fS
m 1
m

fC

## , selected so that fS > 2B

Example
fC = 20 MHz, B = 5MHz
Without under-sampling fS > 40 MHz.
With under-sampling fS = 22.5 MHz (m=1);

-fS
f

fS

2fS

fC

needed.

21/36

## Quantization and Coding

N Quantization Levels

Quantization Noise

22/36

Assumptions
RMS input
(1)
SNRideal 20 log10
Ideal ADC: only quantisation error eq
RMS(e q )

## Also called SQNR

(signal-to-quantisation-noise ratio)

RMS input

T
2
V
1 VFSR

sint dt FSR
T 2
2 2

p(e)

q/2

RMS(e q )

eq2 p eq deq
-q/2

VFSR
q

12 2N 12

1
q

q
2

q
2

eq

Error value

23/36

## SNR of ideal ADC - 2

SNRideal 6.02 N 1.76 [dB]

Substituting in (1) :

(2)

SNR increased by 6 dB

## Real SNR lower because:

- Real signals have noise.
- Forcing input to full scale unwise.

Actually (2) needs correction factor depending on ratio between sampling freq
& Nyquist freq. Processing gain due to oversampling.

24/36

Coding - Conventional

25/36

26/36

DAC process

27/36

PSD

Nyquist Sampler

f
fb

fN

## The oversampling process takes apart

the images of the signal band.

(a)
Oversampling OSR=4

fs=4fN

(b)

PSD
Signal

Quantization noise in
Nyquist converters
Quantization noise in
Oversampling converters

fN/2

PSD
Signal

fs/2

Quantization noise
Nyquist converters

Quantization noise
Oversampling and noise
shaping converters

## Spectrum at the output of a noise

shaping quantizer loop compared to
those obtained from Nyquist and
Oversampling converters.

Quantization noise
Oversampling converters

FN/2

frequency

## When the sampling rate increases (4

over a larger region. The quantization
noise power in the signal band is 4 times
smaller.

Fs/2

28/36

Digital Systems
A discreet-time system is a device or algorithm
that operates on an input sequence according to
some computational procedure
It may be
A general purpose computer
A microprocessor
dedicated hardware
A combination of all these

29/36

## Linear, Time Invariant Systems

System Properties
linear
Time Invariant
Stable
Causal

y ( n ) ak x ( n k )
k 0

Convolution

30/36

5+7-1=11 terms

31/36

5+7-1=11 terms

32/36

## General Linear Structure

k 0

k 1

y (n) ak x(n k ) bk y (n k )
33/36

Simple Examples

34/36

## Linearity Superposition Frequency Preservation

Principle of Superposition
x1(n)

y1(n)
H
ax1(n)+bx2(n)

ay1(n)+by2(n)
H

x2(n)

y2n)
H

x12(n)

x1(n)
x2

x1(n)+x2(n)
x2
x2(n)

Non-linear

x22(n)

## If y(n)=x2(n) then for x(n)=sin(n) y(n)=sin2(n)=0.5+0.5cos(2n)

35/36

The END
Have a nice Weekend

Back on Tuesday

36/36