Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

1 Basics DSP AV Intro

Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

Basics on Digital Signal Processing

Introduction
Vassilis Anastassopoulos

Electronics Laboratory, Physics Department,
University of Patras
2/36
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
3/36
-0.2
-0.1
0
0.1
0.2
0.3
0 2 4 6 8 10
sampling time, t
k
[ms]
V
o
l
t
a
g
e

[
V
]
t
s
-0.2
-0.1
0
0.1
0.2
0.3
0 2 4 6 8 10
sampling time, t
k
[ms]
V
o
l
t
a
g
e

[
V
]
t
s
Analog & digital signals
Continuous function V
of continuous variable t
(time, space etc) : V(t).
Analog
Discrete function V
k
of
discrete sampling
variable t
k
, with k =
integer: V
k =
V(t
k
).
Digital
-0.2
-0.1
0
0.1
0.2
0.3
0 2 4 6 8 10
time [ms]
V
o
l
t
a
g
e

[
V
]
Uniform (periodic) sampling.
Sampling frequency f
S
= 1/ t
S
Sampled
Signal
4/36
Analog & digital systems
5/36
Digital vs analog processing
Digital Signal Processing (DSPing)
More flexible.
Often easier system upgrade.
Data easily stored -memory.
Better control over accuracy
requirements.
Reproducibility.
Linear phase
No drift with time and
temperature
Advantages
A/D & signal processors speed:
wide-band signals still difficult to
treat (real-time systems).
Finite word-length effect.
Limitations
6/36
DSPing: aim & tools
Software
Programming languages: Pascal, C / C++ ...
High level languages: Matlab, Mathcad, Mathematica
Dedicated tools (ex: filter design s/w packages).
Applications
Predicting a systems output.
Implementing a certain processing task.
Studying a certain signal.
General purpose processors (GPP), -controllers.
Digital Signal Processors (DSP).
Programmable logic ( PLD, FPGA ).
Hardware real-time
DSPing
Fast
Faster
7/36
Related areas
8/36
Applications
9/36
Important digital signals
Unit Impulse or Unit Sample.
The most important signal for
two reasons
(n)=1 for n=0
Unit Step u(n)=1 for n>0
(n)=u(n)-u(n-1)
Unit Ramp r(n)=nu(n)

(nT
s
)
[(n-3)
s
]
n
s
past

u(nTs)
ns past

r(nTs)
ns past
10/36
Digital system example

ms
V
A
N
A
L
O
G

D
O
M
A
I
N


ms
V
Filter
Antialiasing

k
A
D
I
G
I
T
A
L

D
O
M
A
I
N


A/D


k
A
Digital
Processing

ms
V
A
N
A
L
O
G

D
O
M
A
I
N


D/A


ms
V
Filter
Reconstruction
Sometimes steps missing
- Filter + A/D
(ex: economics);
- D/A + filter
(ex: digital output wanted).
General scheme
Topics of this
lecture.
Digital
Processing
Filter
Antialiasing

A/D
11/36
Digital system implementation
Sampling rate.
Pass / stop bands.
KEY DECISION POINTS:
Analysis bandwidth, Dynamic range
No. of bits. Parameters.
1
2
3
Digital
Processing

A/D

Antialiasing
Filter
ANALOG INPUT
DIGITAL OUTPUT
Digital format.
What to use for processing?
12/36
AD/DA Conversion General Scheme
13/36
AD Conversion - Details
14/36
Sampling
15/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.
Frequency misidentification due to low sampling frequency.
Train starts wheels go clockwise.
Train accelerates wheels go counter-clockwise.
1
Why?
16/36
Rotating Disk


How fast do we have to instantly
stare at the disk if it rotates
with frequency 0.5 Hz?
17/36
The sampling theorem
A signal s(t) with maximum frequency f
MAX
can be
recovered if sampled at frequency f
S
> 2 f
MAX
.
Condition on f
S
?
f
S
> 300 Hz
t) cos(100 t) sin(300 10 t) cos(50 3 s(t) + =
F
1
=25 Hz, F
2
= 150 Hz, F
3
= 50 Hz
F
1
F
2
F
3
f
MAX
Example
1
Theo
*

*
Multiple proposers: Whittaker(s), Nyquist, Shannon, Kotelnikov.
Nyquist frequency (rate) f
N
= 2 f
MAX
or f
MAX
or f
S,MIN
or f
S,MIN
/2
Naming gets
confusing !
18/36
Sampling and Spectrum
19/36
Sampling low-pass signals

-B 0 B f
Continuous spectrum
(a) Band-limited signal:
frequencies in [-B, B] (f
MAX
= B).
(a)

-B 0 B f
S
/2 f
Discrete spectrum
No aliasing
(b) Time sampling frequency
repetition.
f
S
> 2 B no aliasing.
(b)
1

0 f
S
/2 f
Discrete spectrum
Aliasing & corruption
(c)
(c) f
S
2 B aliasing !
Aliasing: signal ambiguity
in frequency domain
20/36
Antialiasing filter

-B 0 B f
Signal of interest
Out of band
noise
Out of band
noise


-B 0 B f
S
/2
f
(a),(b) Out-of-band noise can aliase
into band of interest. Filter it before!
(a)
(b)
(c)
Passband: depends on bandwidth of
interest.

Attenuation A
MIN
: depends on
ADC resolution ( number of bits N).
A
MIN, dB
~ 6.02 N + 1.76
Out-of-band noise magnitude.

Other parameters: ripple, stopband
frequency...
(c) Antialiasing filter
1
21/36
Under-sampling
1
Using spectral replications to reduce
sampling frequency f
S
reqments.
m
B
C
f 2
S
f
1 m
B
C
f 2
s s
+
+
me , selected so that f
S
> 2B

B
0 f
C

f
Bandpass signal
centered on f
C


-f
S
0 f
S
2f
S



f
f
C

Advantages
Slower ADCs / electronics
needed.
Simpler antialiasing filters.
f
C
= 20 MHz, B = 5MHz
Without under-sampling f
S
> 40 MHz.
With under-sampling f
S
= 22.5 MHz (m=1);
= 17.5 MHz (m=2); = 11.66 MHz (m=3).
Example
22/36
Quantization and Coding
q
N Quantization Levels
Quantization Noise
23/36
SNR of ideal ADC
2
( )
|
|
.
|

\
|
=
)
q
RMS(e
input RMS
10
log 20
ideal
SNR (1)
Also called SQNR
(signal-to-quantisation-noise ratio)
Ideal ADC: only quantisation error e
q

(p(e) constant, no stuck bits)
e
q
uncorrelated with signal.
ADC performance constant in time.
Assumptions
( ) ( )
2 2
FSR
V
T
0
dt
2
t sin
2
FSR
V
T
1
input RMS = |
.
|

\
|
=
}
Input(t) = V
FSR
sin(e t).
( )
12
N
2
FSR
V
12
q
q/2
q/2 -
q
de
q
e p
2
q
e )
q
RMS(e

= = =
}

e e
q q

Error value
p p( (e e) )
quantisation error probability density
1
q
q
2
q
2
(sampling frequency f
S
= 2 f
MAX
)
24/36
SNR of ideal ADC - 2
[dB] 1.76 N 6.02 SNR
ideal
+ =
(2) Substituting in (1) :
One additional bit SNR increased by 6 dB
2
Actually (2) needs correction factor depending on ratio between sampling freq
& Nyquist freq. Processing gain due to oversampling.
- Real signals have noise.
- Forcing input to full scale unwise.
- Real ADCs have additional noise (aperture jitter, non-linearities etc).
Real SNR lower because:
25/36
Coding - Conventional
26/36
Coding Flash AD
27/36
DAC process
28/36
Oversampling Noise shaping

f
s
=4f
N

(b)
(a)
f
f
f
N

Oversampling OSR=4
Nyquist Sampler
PSD
f
b

The oversampling process takes apart
the images of the signal band.

PSD
f
N
/2
0
Signal
Quantization noise in
Nyquist converters
f
s
/2
Quantization noise in
Oversampling converters
When the sampling rate increases (4
times) the quantization noise spreads
over a larger region. The quantization
noise power in the signal band is 4 times
smaller.

frequency
PSD
F
N
/2
0
Signal
Quantization noise
Nyquist converters
F
s
/2
Quantization noise
Oversampling 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.
29/36
A discreet-time system is a device or algorithm
that operates on an input sequence according to
some computational procedure
Digital Systems
It may be
A general purpose computer
A microprocessor
dedicated hardware
A combination of all these
30/36
Linear, Time Invariant Systems

=
=
N
k
k
k n x a n y
0
) ( ) (
System Properties
linear
Time Invariant
Stable
Causal
Convolution
31/36
Linear Systems - Convolution
5+7-1=11 terms
32/36
Linear Systems - Convolution
5+7-1=11 terms
33/36


= =
=
L
k
k
M
k
k
k n y b k n x a n y
1 0
) ( ) ( ) (
General Linear Structure
34/36
Simple Examples
35/36
Linearity Superposition Frequency Preservation
Principle of Superposition

H
y
1
(n) x
1
(n)
H
y
2
n) x
2
(n)
H
ay
1
(n)+by
2
(n) ax
1
(n)+bx
2
(n)
Principle of Superposition Frequency Preservation

x
2

x
1
2
(n) x
1
(n)
x
2
(n)
x
1
(n)+x
2
(n)
x
2

x
2

x
2
2
(n)
x
1
2
(n)+x
2
2
(n)+2 x
1
(n) x
2
(n)
If y(n)=x
2
(n) then for x(n)=sin(n) y(n)=sin
2
(n)=0.5+0.5cos(2n)
Non-linear
36/36
The END
Back on Tuesday
Have a nice Weekend

You might also like