EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M....

49
EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture 15A (!) DFT The end MRI

Transcript of EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M....

Page 1: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

EE16BDesigning Information

Devices and Systems IILecture 15A (!)

DFTThe end

MRI

Page 2: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Properties of the DFT

• Scaling and superposition:

Page 3: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Properties of the DFT

• Parseval’s relation (Energy conservation)

Page 4: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Conjugate Symmetry

• When the DFT coefficients satisfy:

0 1 2 3 40 1 2 3

Proof concept: Use properties of: WN(N-k) = (WN

k)*, DFT and the realness of x

Page 5: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Example

Page 6: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Example

• FFTSHIFT

Page 7: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Example

• Often, display only half (if signal is real)• If the spectrum (DFT) is not conjugate symmetric, then the signal is complex!

Page 8: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Example

0 500 1000 1500 2000 2500 3000 3500 40000

20

40

60

80

100

120

0 500 1000 1500 2000 2500 3000 3500 4000 45000

10

20

30

40

50

60

70

80

0 1000 2000 3000 4000 5000 6000 7000 80000

50

100

150

200

250

Page 9: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Modulation and Circular shift

Similarly, circular shift - modulation

Modulation – Circular shift

Page 10: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

DFT Matrix and Circulant Matrices

• DFT diagonalizes Circulant matrices:

Page 11: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

DFT Matrix and Circulant Matrices

Page 12: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

• If, then,

Fast Circulant Matrix Vector Multiplication

• Given :

Page 13: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Fast Circulant Matrix Vector Multiplication

• Why bother?• Option I, compute:

• Option II, compute:

Using the fast Fourier Transform (FFT) calculation of the DFT (and inverse) is O(N log N)

For N = 1024: N2 = 1,048,576 whereas, N log N = 10240

Page 14: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Fast Convolution Sum using the DFT

• We can write linear operators on finite sequences as matrix vector multiplication

• Recall… convolution sum.....

Page 15: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Graphical Example of Convolution

1 2 3 4 5 6 70 8 9 10-1

1 2 3 4 5 6 70 8 9 10-1

1 2 3 4 5 6 70 8 9 10-1

Page 16: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Graphical Example of Convolution

1 2 3 4 5 6 70 8 9 10-1

1 2 3 4 5 6 70 8 9 10-1

1 2 3 4 5 6 70 8 9 10-1

Page 17: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Graphical Example of Convolution

1 2 3 4 5 6 70 8 9 10-1

1 2 3 4 5 6 70 8 9 10-1

1 2 3 4 5 6 70 8 9 10-1

Page 18: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Graphical Example of Convolution

1 2 3 4 5 6 70 8 9 10-1

1 2 3 4 5 6 70 8 9 10-1

1 2 3 4 5 6 70 8 9 10-1

Page 19: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Graphical Example of Convolution

1 2 3 4 5 6 70 8 9 10-1

1 2 3 4 5 6 70 8 9 10-1

1 2 3 4 5 6 70 8 9 10-1

Page 20: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Example:If h[n] is length 2 and x[n] is length 5, what is thelength of their convolution sum?

1 2 3 401 2 3 40 1 2 3 4 50

Page 21: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Example

1 2 3 40

1 2 3 40

Page 22: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

1 2 3 40

1 2 3 40

Example

Page 23: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

1 2 3 40

1 2 3 40

Example

Page 24: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Example

• This matrix is called a Toeplitz matrix– But.. Not square… not circulant....

Page 25: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Example• Convert system to be square circulant by zero-padding

• Now can compute using the DFT!

Page 26: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

General Case for Convolution Sum

• Given:

• Zeropad both to M+N-1

• Compute:

• Finally:

Page 27: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Spectrum of filtering?

• Example:

0 5 10 15 20 25 30 35-0.05

0

0.05

0.1

0.15

0.2

Page 28: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Where from here….

Page 29: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

EE16B M. Lustig, EECS UC Berkeley

Readers: Sherwin Afshar, Ryan Tjitro, Sicen Luan, Mohammed Shaikh, Khanh Dang Lab Assistants: Tiffany Cappellari, Jenna Wen, Alyssa Huang, Bikramjit Kukreja, Justin Lu, Nirmaan Shanker, Nathan Mar, Rahul Tewari, Daniel Zu, Raymond Gu, Ilya Chugunov, Chufan Liang, Dre Mahaarachchi, Benjamin Carlson, Victor Lee, Rafael Calleja, Jackson Paddock, David Allan Vakshlyak, Christian Castaneda, Ashley Lin, Jason Wang, Jove Yuan, Ryan Purpura, Merryle Wang, Avanthika Ramesh, Adilet Pazylkarim, Mariyam Jivani, Angela WangAcademic Interns: David Dongwon Kim, Vin Ramamurti, Tanner Yamada, Carolyn Schwendeman, Akash Velu, Mikaela Frichtel, Steven Lu, Grace Park Sun

Page 30: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

MRI vs CT• MRI is VERY VERY different from CT

MRICTBased on MagnetismNo moving partsNo ionizing radiationSensitive to soft tissueComplicated to operate

Based on X-rayRapidly moving partsUses ionizing radiationLess sensitive to soft tissueEasy to operate

Page 31: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

How Does MRI Work?

•Magnetic Polarization-- Very strong uniform magnet• Excitation

-- Very powerful RF transmitter• Acquisition

-- Location is encoded by gradient magnetic fields-- Very powerful audio amps

Page 32: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

Polarization

•Protons have a magnetic moment•Protons have spins•Like rotating magnets

1H

Page 33: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

Polarization

• Body has a lot of protons• In a strong magnetic field B0, spins align with B0 giving a net

magnetization

B0

*Graphic rendering Bill Overall

Page 34: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

• 0.1 to 12 Tesla• 0.5 to 3 T common• 1 T is 10,000 Gauss• Earth’s field is 0.5G• Typically a superconducting

magnet

M. Lustig, EECS UC Berkeley

Polarizing Magnet

B0

Page 35: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

Typical MRI Scanner

Page 36: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture
Page 37: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

Polarizaion

Page 38: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

Free Precession•Much like a spinning top•Frequency proportional to the field• f = 127MhZ @ 3T

MIT physics demos

Page 39: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

Free Precession•Precession induces magnetic flux•Flux induces voltage in a coil

Signal

Page 40: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture
Page 41: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

Frequency Demo

Page 42: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

Intro to MRI - The NMR signalB0

γB0

time frequency

• Signal from 1H (mostly water)

• Magnetic field ⇒ Magnetization

• Radio frequency ⇒ Excitation

• Frequency ∝ Magnetic field

Page 43: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

Intro to MRI - The NMR signal• Signal from 1H (mostly water)

• Magnetic field ⇒ Magnetization

• Radio frequency ⇒ Excitation

• Frequency ∝ Magnetic field

γB0

B0

time frequency

γB0

Page 44: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

Intro to MRI - Imaging

γB0

center

B0

time frequency

• B0 Missing spatial information

Page 45: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

Phone Imaging I

Page 46: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

Intro to MRI - ImagingB0

center

γB0

G

Stronger field

Weaker field

unchanged

time frequency

• B0 Missing spatial information

• Add gradient field, G

Page 47: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

Intro to MRI - ImagingB0

Reference (γB0)

center

time

• B0 Missing spatial information

• Add gradient field, G • Mapping:

spatial position ⇒ frequency

G

0

frequency

Page 48: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

Phone Imaging II

Page 49: EE16B Designing Information Devices and Systems IIee16b/fa18/lectures/LastLecture.pdf · EE16B M. Lustig, EECS UC Berkeley EE16B Designing Information Devices and Systems II Lecture

M. Lustig, EECS UC Berkeley

MR Imagingmagnitude k-space (Raw Data) Image

Fourier transform

Video courtesy Brian Hargreaves

Fourier