Introduction to DSP - msvincognito.nl · Introduction to DSP . Source: . Free textbook on DSP . 1 Version 2

Post on 16-Oct-2020

29 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

Transcript

Introduction to DSP

Source: http://www.dspguide.com Free textbook on DSP

1 Version 2

Digital Signal Processing

• Key aspect is signals • Signals acquired from the environment

through sensors • Digitized through ADCs • DSP answers “what next”?

2

DSP Roots

3

DSP overlaps with many fields…

4

Signals and Systems

• Signal – Description of how one parameter varies with another parameter – Voltage vs. time – Brightness vs. distance

• System – Any process that produces output signal in response to an input signal

5

Continuous and Discrete systems

6

Understanding a System

• We need to understand a system i.e., how it transforms the input signal to generate an output signal

• Examples: – How to remove noise from an ECG – How does telephone line transmit your voice

signal and changes along the way… • Too many systems with varied characteristics

– Is it really possible?

7

Linear System

• Fortunately, many useful systems are linear in nature

• They possess properties that make them amenable to be abstracted and studied

• What properties make a system linear?

8

Linear System

• A linear system satisfies two mathematical properties: – Homogeneity – Additivity

• If we show that a system exhibits the above two properties, then we prove that the system is linear

• A third property known as shift invariance is not required for linear system but usually satisfied

• It is mandatory of linear systems for DSP

9

Homogeneity

10

Additivity

11

Shift Invariance

12

Additional Properties

• Unfortunately, the three properties of linear systems, namely, homogeneity, additivity, and shift invariance are not enough to understand/study linear systems

• Two additional properties usually displayed by linear systems – Static linearity – Sinusoidal fidelity

13

Static Linearity • defines how a linear system reacts when the signals aren't changing, i.e.,

when they are DC or static. • static response of a linear system is very simple: the output is the input

multiplied by a constant. • All linear systems have static linearity, the opposite is not always true

14

Examples of Static nonlinearity

15

Sinusoidal Fidelity

• Important characteristic exhibited by linear systems

• If the input to a linear system is a sinusoidal wave, the output will also be a sinusoidal wave, and at exactly the same frequency as the input.

• However, the output may differ in amplitude and phase

16

Examples of Linear Systems

17

Examples of Non-linear systems

18

Special Properties of Linearity

• Linearity is commutative

19

Special Properties of Linearity

• A system with multiple inputs and/or outputs will be linear if it is composed of linear subsystems and additions of signals. The complexity does not matter, only that nothing nonlinear is allowed inside of the system.

20

Multiply Operation

• With a constant is linear… • Multiplication of two signals is non-linear

21

Synthesis & Decomposition

22

Superposition – Foundation

of DSP

23

Common Decompositions

• Using Impulses Impulse=single non zero

value in a sequence of zeroes

δ[n] δ[n-s]

• Using Step signals

24

0 s

25

Fourier Decomposition

• Not very obvious • N-point signal decomposed to N+2 signals • Half are sine waves • Half are cosine waves

26

Fourier Decomposition

27

Convolution

• Convolution is a mathematical way of combining two signals to form a third signal

• The most important concept in DSP • Input and impulse response are combined to

compute the output signal

28

Impulse Response of a Linear System

29

Computing output signal

Question: If a linear system has an impulse response of h[n] then compute the output for -3*δ[n-8]

Answer: If δ[n] gives output h[n] then δ[n-8] gives output h[n-8] … shift invariant

and -3* δ[n-8] gives output 3*h[n-8] … homogeneity

30

Computing Output Response

Given an input signal, we can compute the output of a linear system if we know its impulse response

Step 1: Decompose signal into sum of scaled and shifted impulses

Step 2: Compute output for each scaled and shifted impulse input

Step 3: Add all the output signals

31

Convolution

• Is another mathematical operation just like add, subtract, multiply

• Represented by * (asterisk) • y[n] = x[n] * h[n] • “x[n] is convolved with h[n] to produce y[n]”

32

Filtering Example

33

Input = Sine wave

(High Frequency) +

Ramp (Low Frequency)

More Examples

34

Input and Output Lengths • Output Length = Input Length + Impulse Length – 1

• Usually Impulse length is very short (~100) • While input can be very large (~millions of samples)

35

= 81 + 31 – 1 = 111

= 81 + 31 – 1 = 111

Understanding Convolution

• We can understand from the perspective of – Input Signal (Input side algorithm) – Output Signal (Output side algorithm)

36

Input Side Algorithm

• This first viewpoint of convolution is based on the fundamental concept of DSP – decompose the input, – pass the components through the system, – and synthesize the output.

37

Input Side Algorithm – An illustrative example

38

39

Same example – input and impulse response swapped

40

We observe that we get the

same output

Convolution Is commutative

Output Side Algorithm

• Input side perspective answers the following question – How does each input sample contribute to the

output? – This approach is not a natural way of computing

output • Output side perspective tries to answer the

following question – For each output sample, what input samples

contribute to its generation? – This approach is more natural

41

Example revisited

42

Which inputs contribute to output y[6]? To answer this, we can look at sample 6 in each plot We see that X[3], x[4], x[5], and x[6] contribute to y[6] i.e., y[6]=x[3]h[3] + x[4]h[2] + x[5]h[1] + x[6]h[0]

Example revisited

• y[6] = x[3]h[3] + x[4]h[2] + x[5]h[1] + x[6]h[0] • Note that samples of h in the above equation

are in decreasing order • While input samples are in an increasing order • From the output perspective, thus, the

impulse response is “flipped”

43

44

45

Samples Not Available!!

46

Samples Not Available!!

Convolution – Mathematical Formula

47

End effects of convolution

48

Convolution - Applications

• A linear system's characteristics are completely specified by the system's impulse response, as governed by the mathematics of convolution

• The above is the basis for many signal processing techniques

• Examples – Filters – systems with appropriate impulse response – Enemy aircraft detected by radar by analyzing measured

impulse response – Echo suppression in long distance phone calls

• Create impulse response that counteracts impulse response of echo

49

50

Example Low Pass Filter Kernels

• Kernel another word for Impulse Response

51

High Pass Filter Kernels

52

top related