Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier...

44
Math Review Complex numbers, Fourier transforms, basic differential equations and matrices

Transcript of Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier...

Page 1: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Math Review

Complex numbers, Fourier transforms, basic differential equations and matrices

Page 2: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Basic Math Needed to Understand MRI (In This Course)

•  Complex numbers –  Real and imaginary numbers –  Magnitude and phase

•  Fourier transforms –  Frequency –  Time: 1D Fourier transforms –  Space: 2D Fourier transforms

•  Differential equations –  Linear homogeneous and inhomogeneous

•  Basic calculus –  Will not cover here, if necessary brush up on basic

derivates and integrals from introductory text book

Page 3: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Complex Numbers

•  Consider: – What is the value of √-1 ?

•  Answer: It doesn’t exist

•  There is no real number with this value •  This value can never come from any real

physical measurement •  Number is imaginary

Page 4: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Complex Numbers

•  Consider: – What is the value of √-1 ?

•  Answer: It doesn’t exist

•  Answer #2: i=√-1 – Seems silly? We just define i to be our desired

value. There is no real number.

Page 5: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Complex Numbers

•  Where did i come from?

•  Solve for x: X2 + 1 = 0 Answer: X = √-1

No real number with this value No physical measurement will ever yield i BUT: equation can describe a real physical system e.g., circuit design, fluid dynamics, and MRI

Page 6: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

The Power of i

i = √-1 i0=1 i1=√-1 i2=-1 i3=√-1

Rewrite: i0= +1 + 0i i1= 0 + 1i i2= -1 + 0i i3= +0 - 1i

Page 7: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Complex Numbers •  Complex numbers don’t lie on real number line – they

have their own axis. •  Real and imaginary numbers taken together define the

complex plane

Real (x)

Imaginary (y)

1 + 2i

1

1

2

2

-1 -2

-1

-2

Page 8: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

The Power of i

i0 = +1 + 0i i1 = +0 + 1i i2 = -1 + 0i i3 = +0 - 1i i4 = +1 + 0i i5 = +0 +1i i6 = -1 + 0i i7 =+0 – 1i

Real Imaginary Powers of i correspond to sinusoidal patterns.

Imaginary part lags real part by ¼ cycle

Page 9: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Example: Precession and Detection

B0

Movie  courtesy  of  William  Overall  

Page 10: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Visualizing Complex Numbers

•  Visualize complex numbers in 2D “complex plane” –  x = real part ; y = imaginary part

•  Increasing powers of i rotate in complex plane

Real (x)

Imaginary (y)

1

1 -1

-1

i0

i1

Page 11: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Phase

•  Phase is simply the angle in the complex plane – Phase is determined by the power of i

Real (x)

Imaginary (y)

1

1 -1

-1

i0

i1

Page 12: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Magnitude

•  Complex numbers so far have all been of magnitude 1 – distance from center in complex plane = 1

Real (x)

Imaginary (y)

1

1 -1

-1

i0

i1

Page 13: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Magnitude

•  A x ip

•  Full set of complex numbers can have any length A –  Can be anywhere on complex plane

Real (x)

Imaginary (y)

1

1 -1

-1

Real (x)

Imaginary (y)

1

1 -1

-1

0.3 x i0.5

0.9 x i2.2

Page 14: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Magnitude/Phase vs Real/Imaginary

•  Two ways to represent complex numbers –  Real (x) and imaginary (y) –  Magnitude (length) and phase (angle)

•  One is usually easier to work with

Real (x)

Imaginary (y)

1

1 -1

-1

0 + 0.5i

Magnitude = 0.5 Phase = 90 degrees

OR

Page 15: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Complex Numbers: Why?

•  Many problems can’t be solved by “real” numbers – “Unsolvable” basic algebra: x2+1=0 – But, equation may describe physical system

(e.g., oscillating behavior)

•  Describe 2D coordinate with a single number –  (real, imaginary) OR (magnitude, phase)

Page 16: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Euler’s Formula

•  eix = cos x + i sin x – Describes relationship between trigonometric

functions and complex exponential functions

Leonhard  Euler  Swiss  mathema3cian  1707-­‐1783  

Page 17: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Euler’s Formula

•  eix = cos x + i sin x – Trigonometric vs. exponential form may be

more useful depending on specific problem:

–  [cos(4ωt)+isin(4ωt)] x [cos(7ωt) + isin(7ωt)] •  Yuck!

– ei4ωt x ei7ωt = ei11ωt

•  Nice!

Page 18: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Basic Math Needed to Understand MRI (In This Course)

•  Complex numbers –  Real and imaginary numbers –  Magnitude and phase

•  Fourier transforms –  Frequency –  Time: 1D Fourier transforms –  Space: 2D Fourier transforms

•  Differential equations –  Linear homogeneous and inhomogeneous

•  Basic calculus –  Will not cover here, if necessary brush up on basic

derivates and integrals from introductory text book

Page 19: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Frequency

•  Frequencies are measured in inverse time – often Hertz (Hz) = 1/second, or s-1

Frequency (Hz)

Magnitude

Time (s) Time (s)

Magnitude Magnitude 1/f 1/f

f = 4 f = 2

Page 20: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Amplitude

Time (s) Time (s)

Magnitude Magnitude

Frequency (Hz)

Magnitude f = 2

f = 2

Page 21: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

What is the Frequency Content?

•  The waveform is a summation of two waveforms (f=1, f=1)

Frequency (Hz)

Magnitude f = 1

f = 1

Page 22: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

How About This One?

Frequency (Hz)

Magnitude f = 1 f = 2

Page 23: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Two More

Frequency (Hz)

Magnitude f = 1

f = 1

Frequency (Hz)

Magnitude f = 1

f = 1

•  Summation differs for same frequencies/amplitudes. Phases of f differ!

Page 24: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

What is Frequency Content? •  To describe all possible sums of sinusoids, each

frequency is associated with a magnitude and phase

Real (x)

Imaginary (y) 3

3 -3

-3

Real (x)

Imaginary (y) 3

3 -3

-3

Page 25: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Generalizing Frequencies

•  Need frequency, phase and amplitude information to describe system completely

•  Any shifted sinusoid can be thought of as a summation of sine and cosine contributions (or real and imaginary contributions)

Page 26: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Complex Numbers: Why?

•  Many problems can’t be solved by “real” numbers –  “Unsolvable” basic algebra: x2+1=0 – Elegant description of oscillating behavior

•  Describe 2D coordinate with a single number –  (real, imaginary) OR (magnitude, phase)

•  Natural pairings of quantities – Each frequency component of a signal has a

magnitude and phase

Page 27: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Basic Math Needed to Understand MRI (In This Course)

•  Complex numbers –  Real and imaginary numbers –  Magnitude and phase

•  Fourier transforms –  Frequency –  Time: 1D Fourier transforms –  Space: 2D Fourier transforms

•  Differential equations –  Linear homogeneous and inhomogeneous

•  Basic calculus –  Will not cover here, if necessary brush up on basic

derivates and integrals from introductory text book

Page 28: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Any Signal can be Decomposed into a Sum of Frequencies

Page 29: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Fourier Math

•  Think about listening to an orchestra: you differentiate between instruments based on their frequency

Page 30: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Think about Music

•  Audio Signal – Many frequencies

•  Fourier transform of audio signal –  Identify distinct frequencies

(and magnitudes)

Image  courtesy  of  Karla  Miller  

Page 31: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Think about MRI Signal

Fourier Transform

Image  courtesy  of  Karla  Miller  

Page 32: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Basic Idea of Fourier Transforms

•  Any signal can be decomposed into contributions from different frequencies

•  This decomposition is described mathematically by a Fourier transform

•  The Fourier transform is a complete description: you can exactly recover the original signal from its spectrum with an inverse Fourier transform.

Page 33: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Fourier Transform

•  For each frequency, find the magnitude and phase that best fit the signal

Image  courtesy  of  Karla  Miller  

Page 34: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Fourier Transform •  Synthesize arbitrary phase shift from sum of sine

and cosine •  Fit each frequency using regression of sines and

cosines

Image  courtesy  of  Karla  Miller  

Page 35: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Mathematical Equation for Fourier Transform

X(ω) = Fourier transform of x(t) Some examples to follow on board (and in homework)

Page 36: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

In MRI, We Also Need to Understand Spatial Frequencies

•  Spatial frequencies are central to the concept of k-space

•  Also important for understanding basic image processing

•  How do we extend frequencies to multiple dimensions (e.g., spatial frequencies?)

Page 37: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Consider a Spatial Frequency

Page 38: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Consider a Spatial Frequency

Page 39: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Consider a Spatial Frequency

Page 40: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Each of These Represents One 2D Frequency: Denote (fx,fy)

f = (2,0) f = (0,2)

f = (0,4)

f = (4,0) f = (0,4) f = (1.8,1.8)

f = (1.8,1.8)

f = (1.8,1.8) f = (1.8,1.8)

Page 41: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

2D Spectrum Plots Contribution From Each Spatial Frequency

Page 42: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Next Time: Making an Image

Page 43: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Summary Points

•  Any signal can be completely characterized in terms of frequency components

•  The Fourier transform calculates the amount of signal described by each frequency

•  This holds for signals of any dimensionality (1D=time; 2D=space; 3D=volume)

Page 44: Math Review - Vanderbilt University Medical Center€¦ · Math Review Complex numbers, Fourier transforms, basic differential equations and matrices . ... Some examples to follow

Differential Equations •  Differential equation: equation that relates the values of a function

and its derivates (of one or more order)

•  dy/dx + y(x) = 4 sin (3x)

•  Notation often used: dy/dx = y’

•  Differential equations are interesting and important because they express relationships involving rates of change

•  Order of differential equation: order of the highest derivative: –  1st order: y’ + y = ex

–  2nd order: y’’ + y = ex

•  Solution of differential equation: any function that satisfies it