33
ECE 420- Embedded DSP Laboratory Lecture 1 – Course Overview & Audio Processing Thomas Moon January 27, 2020

ECE 420-Embedded DSP Laboratory

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ECE 420-Embedded DSP Laboratory

ECE 420- Embedded DSP LaboratoryLecture 1 – Course Overview & Audio Processing

Thomas MoonJanuary 27, 2020

Page 2: ECE 420-Embedded DSP Laboratory

D S Pigital ignal rocessing

-signal processing done by “computer”

Page 3: ECE 420-Embedded DSP Laboratory

Signalsspeech/acoustic signalsmotion signals

images videos

Page 4: ECE 420-Embedded DSP Laboratory

Signals

RF signals

seismic signals stock prices

Extract useful information from the signal

Page 5: ECE 420-Embedded DSP Laboratory

filtering

low-pass filter

high-pass filter

Signal Processing

Page 6: ECE 420-Embedded DSP Laboratory

transforming

Signal Processing

Fourier Transform (FT) Wavelet Transform

Page 7: ECE 420-Embedded DSP Laboratory

modulation & demodulation

Signal Processing

frequency conversion

0 𝑓#−𝑓#

0 𝐵−𝐵

Baseband

Passband

−3 +3+1−1

−3

+3

+1

−1

𝐼

𝑄

16 QAM signal

Page 8: ECE 420-Embedded DSP Laboratory

Digital Signal Processingsampling

t

ADC DAC

t

• • •

Analog Digital Analog

Why DSP?

Page 9: ECE 420-Embedded DSP Laboratory

• Digital circuits are less sensitive to external parameters (temperature, aging, etc).

• Easy to adjust system characteristics (ex: changing filter response).

• Digital signal can be stored almost indefinitely.

• More suitable to process low-frequency signals.

Why DSP?

9

Page 10: ECE 420-Embedded DSP Laboratory

In this course:• Implement the fundamental DSP concepts from

ECE 310.• Learn to prototype & implement real-time DSP

systems.

Embedded Digital Signal Processing

10

Page 11: ECE 420-Embedded DSP Laboratory

How we learn:• Work with hardware.• Run practical experiment.

But, we will not build real-time DSP systems from scratch. à Not a circuit course!

Embedded Digital Signal Processing

11

We will use Android Tablet!

Page 12: ECE 420-Embedded DSP Laboratory

• CPU: 2.2 GHz ARM Cortex A15• GPU: 192 core Kepler• RAM: 2 GB• Display: 8-inch 1920x1200 multi-touch Full-HD display• Motion sensors: 3-axis gyro, 3-axis accelerometer, 3-axis compass• Cameras: Front 5MP HDR, Back 5MP auto-focus HDR• Stereo speakers & microphone

NVIDIA SHIELD Tablets

Page 13: ECE 420-Embedded DSP Laboratory

• CPU: 2.2 GHz ARM Cortex A15• GPU: 192 core Kepler• RAM: 2 GB• Display: 8-inch 1920x1200 multi-touch Full-HD display• Motion sensors: 3-axis gyro, 3-axis accelerometer, 3-axis compass• Cameras: Front 5MP HDR, Back 5MP auto-focus HDR• Stereo speakers & microphone

NVIDIA SHIELD Tablets

YOU are responsible for the tablets.Please, use it carefully!

Page 14: ECE 420-Embedded DSP Laboratory

Software Tools You Need

PyCharm & Jupyter• run python script for simulation.

Android Studio• Upload algorithms into

Android platform.

Page 15: ECE 420-Embedded DSP Laboratory

1. Develop & Test DSP algorithms in high-level languages (Python or MATLAB)

• More rapid development• Test/training signals available • Provide a reference against embedded

implementation

2. Port tested algorithms into embedded platform

Basic Practice in Developing DSP Software

15

prelab + lab (1/2)

lab (2/2)

Page 16: ECE 420-Embedded DSP Laboratory

• Webpage: https://courses.engr.illinois.edu/ece420/sp2020

• Lectures: Mondays 2:00-2:50PM, 4070 ECEB• Learn theory/concept for the associated lab• Come to lecture and ask questions

• Labs: 5072 ECEB• ABA: 2:00-3:50 Tue• ABC: 2:00-3:50 Wed• ABD: 2:00-3:50 Thu• ABE: 2:00-3:50 Fri

• TAs• Dimitrios Gotsis• Spencer Markowitz

Course Info

16

• Prerequisite: ECE 310(We assume you know basic DSP concepts!)

Page 17: ECE 420-Embedded DSP Laboratory

Course Timeline

17

Backgroundfor Labs

Special Topics/ Guest Lectures

Final Quiz

Structured Labs

Assigned Project

Final Project Demo

Final Project

Lecture Labst = 0

t = End of Semester

Page 18: ECE 420-Embedded DSP Laboratory

• First half: 7 Structured Labs

• Embedded DSP development framework• High-level (Python) à Embedded (Android with Java/C)

• Different signal modalities and interfaces: IMU, audio, visual

• Basic DSP algorithms• Digital filtering (lab2)• Spectral analysis (lab3)• Auto-correlation analysis: pitch detection/correction (lab4,5)• Image and multidimensional signal processing (lab6,7)

Course Overview

18

Page 19: ECE 420-Embedded DSP Laboratory

• First half: 7 Structured Labs - Format

• Prelab [Individual]• Complete individually prior to lab, submit to TA

• Quiz [Individual]• Overview of concepts from previous lecture & lab

• Demo [Group]• Demonstrate work from previous week to TA, answer questions

• Lab work [Group]

Please refer to “Submission Instruction” page for details.

Course Overview

Page 20: ECE 420-Embedded DSP Laboratory

• Second half: ‘Student Choice’ Group Projects (subj. to approval)

• Start with an Assigned Project Lab• Explore implementation of a DSP algorithm from the literature• In Python, 2-week duration• Jumping off point for the Final Project

• Final project• Proposal and Design Review• Deliverable, 2 weekly milestones, validation and test plan• Final Project Demo and Presentation• Final Report (and optional Video)

• Recommended not to wait until week 7 to start exploring options

Course Overview

20

Page 21: ECE 420-Embedded DSP Laboratory

• Grading• Structured Labs – 40%• Assigned Project Lab – 15%• Final Project – 40%• Final Quiz – 5%

• We use Gradescope for grading. If you are not invited, please contact us.

• Office hour• TA Dimitrios Gotsis: Thursday 1-2pm, Friday 11am-2pm.• Piazza

Course Overview

21

Page 22: ECE 420-Embedded DSP Laboratory

• Goal: 1. Sample audio signals,2. Perform digital-filtering (notch filter),3. Generate a filtered sound.

Lab2 – Audio Filtering

22

Sampling Digital Filtering+

Page 23: ECE 420-Embedded DSP Laboratory

Sampling

23

Ts

ADC

𝑥- 𝑡 𝑥[𝑛]𝑥 𝑛 = 𝑥-(𝑛𝑇5)

How/when can we reconstruct 𝑥- 𝑡perfectly from 𝑥[𝑛]?

𝑛𝑡

Ts

DAC

𝑥[𝑛]

𝑛

𝑥- 𝑡𝑡

Page 24: ECE 420-Embedded DSP Laboratory

24

𝑋- 𝑗Ω = :;<

<𝑥- 𝑡 𝑒;>?@𝑑𝑡

0 𝐵−𝐵

𝑋- 𝑗Ω

Ω = 2𝜋𝑓

To avoid the overlap, 𝐵 < EFG

(or 𝑓 < HIFG

)

Nyquist rate : 𝐹K =HFG> 2𝑓

CTFT

𝑋 𝑗𝜔 =N;<

<

𝑥 𝑛 𝑒;>OP

0 𝐵𝑇5−𝐵𝑇5

𝑋 𝑗𝜔

𝜔2𝜋−2𝜋

𝜋

1. Scale by Ts

2. Periodic by 2𝜋

• • •• • •

DTFT

Page 25: ECE 420-Embedded DSP Laboratory

Audio Signal

25

0𝐵 = 2𝜋 Q 20𝑘𝐻𝑧

−𝐵

𝑋- 𝑗Ω

Ω = 2𝜋𝑓

Highest frequency audible by humans

Hence, the sampling rate we need is HFG> 2 Q 20𝑘𝐻𝑧 = 40𝑘𝐻𝑧

We will use 48kHz sampling rate.

Page 26: ECE 420-Embedded DSP Laboratory

𝑋- 𝑗Ω = :;<

<𝑥- 𝑡 𝑒;>?@𝑑𝑡

0 𝐵−𝐵

𝑋- 𝑗Ω

Ω = 2𝜋𝑓

CTFT

−𝐵𝑇5 𝜔2𝜋−2𝜋

𝑋 𝑗𝜔 =N;<

<

𝑥 𝑛 𝑒;>OP

0 𝐵𝑇5

𝑋 𝑗𝜔𝜋

• • •• • •

DTFT

0

𝑋[𝑘]

𝑋[𝑘] = NPVW

X;H

𝑥 𝑛 𝑒;>IEYP/X

DFT

𝑁 − 1

CTFT vs DTFT vs DFT

Page 27: ECE 420-Embedded DSP Laboratory

0 𝐵−𝐵

𝑋- 𝑗Ω

Ω = 2𝜋𝑓

0 𝐵𝑇5−𝐵𝑇5

𝑋 𝑗𝜔

𝜔2𝜋−2𝜋

𝜋

• • •• • •

CTFT

DTFT

0

𝑋[𝑘] DFT

𝑁 − 1

Relation

3rd DFT bin

𝜔?

𝑓?

Given 𝑇5, 𝑁

Page 28: ECE 420-Embedded DSP Laboratory

0 𝐵−𝐵

𝑋- 𝑗Ω

Ω = 2𝜋𝑓

0 𝐵𝑇5−𝐵𝑇5

𝑋 𝑗𝜔

𝜔2𝜋−2𝜋

𝜋

• • •• • •

CTFT

DTFT

0

𝑋[𝑘] DFT

𝑁 − 1

Relation

k?

𝜔?

10.3𝑘𝐻𝑧

Given 𝑇5, 𝑁

Page 29: ECE 420-Embedded DSP Laboratory

0 𝐵−𝐵

𝑋- 𝑗Ω

Ω = 2𝜋𝑓

0 𝐵𝑇5−𝐵𝑇5

𝑋 𝑗𝜔

𝜔2𝜋−2𝜋

𝜋

• • •• • •

CTFT

DTFT

0

𝑋[𝑘] DFT

𝑁 − 1

Relation

2𝜋𝑓𝑇 = 𝜔

𝑓𝐹5=

𝜔2𝜋

𝜔2𝜋

=𝑘𝑁

𝑓𝐹5=

𝜔2𝜋

=𝑘𝑁

Page 30: ECE 420-Embedded DSP Laboratory

Digital Filter

30

+

+

+

𝑥[𝑛] 𝑦[𝑛]

𝑍;H

𝑍;H

𝑍;H

𝑍;H

𝑏W

𝑏H

𝑏I

−𝑎H

−𝑎I

• • •

• • •

𝑦 𝑛 = 𝑏W𝑥 𝑛 + 𝑏H 𝑛 − 1 +⋯+ 𝑏c𝑥 𝑛 − 𝐾 − (𝑎H𝑦 𝑛 − 1 +⋯+ 𝑎e𝑦 𝑛 − 𝐿 )

• L = 0, FIR• L > 0, IIR

Page 31: ECE 420-Embedded DSP Laboratory

Examples of Filters

31

Low-pass High-pass

Band-stop Band-pass

Ramp

Page 32: ECE 420-Embedded DSP Laboratory

• Large N (filter order)☺ Close to desired response☺ Sharper transition☺ Less ripples☹ More

computation/memory☹ Longer delay

Filter Design Spec

32

• FIR vs IIR☺ Stable☺ Linear phase☹ Worse magnitude

response with same order

Page 33: ECE 420-Embedded DSP Laboratory

• In lab2, we will implement the convolution using a circular buffer and process sample-by-sample.

Convolution

33

𝑦 𝑛 = NYV;<

<

ℎ 𝑘 𝑥[𝑛 − 𝑘]

𝑦 𝑛 = NYVW

c

ℎ 𝑘 𝑥[𝑛 − 𝑘] FIR filter (causal)