Sampling Theory: Fourier Theory Made Easy
Sampling Theory: Fourier Theory Made Easy
Sampling, FFT
and Nyquist
Frequency
A sine wave
8
5*sin (24t)
Amplitude = 5
Frequency = 4 Hz
-2
-4
-6
-8
0.1
0.2
0.3
0.4
0.5
seconds
0.6
0.7
0.8
0.9
We take an
ideal sine wave
to discuss
effects of
sampling
5*sin(24t)
Amplitude = 5
4
Frequency = 4 Hz
-2
Sampling duration =
1 second
-4
-6
-8
0.1
0.2
0.3
0.4
0.5
seconds
0.6
0.7
0.8
0.9
We do sampling of 4Hz
with 256 Hz so sampling
is much higher rate than
the base frequency, good
An undersampled signal
Sampling rate
Red dots
represent
the sampled
data
sin(28t), SR = 8.5 Hz
1.5
0.5
-0.5
-1
-1.5
-2
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
Undersampling
can be confusing
Here it suggests
a different
frequency of
sampled signal
Undersampled signal can confuse you about its frequency when reconstructed.
Because we used to small frequency of sampling. Nyquist teaches us what should
be a good frequency
http://www.falstad.com/fourier/j2/
H f h t e
h t H f e
2ift
dt
2ift
df
H n hk e
2ikn N
k 0
N 1
1
2ikn N
hk H n e
N n 0
2.
3.
4.
5.
Using the FFT, the same task on the same machine took 2.4 seconds!
Examples of
FFT
Sine wave
0
-1
-2
0
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
In time
300
250
200
Delta function
150
100
50
0
20
40
60
80
100
120
In frequency
Gaussian
0.3
0.2
0.1
0
10
15
20
25
30
35
40
45
50
In time
6
5
4
Gaussian
3
2
1
0
50
100
150
200
250
In frequency
Sinc function
0.5
0
-0.5
-1
-0.8
-0.6
-0.4
-0.2
0.2
0.4
0.6
0.8
In time
6
5
4
Square wave
3
2
1
0
-100
-50
50
100
In frequency
Sinc function
0.5
0
-0.5
-1
-0.8
-0.6
-0.4
-0.2
0.2
0.4
0.6
0.8
In time
6
5
4
Square wave
3
2
1
0
-100
-50
50
100
In frequency
Exponential
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
In time
30
25
20
Lorentzian
15
10
5
0
50
100
150
200
250
In frequency
FFT of FID
1. If you can see your NMR spectra on a computer its because they are in a
digital format.
2. From a computer's point of view, a spectrum is a sequence of numbers.
3. Initially, before you start manipulating them, the points correspond to the
nuclear magnetization of your sample collected at regular intervals of time.
4. This sequence of points is known, in NMR jargon, as the FID (free
induction decay).
5. Most of the tools that enrich iNMR are meant to work in the frequency
domain; they are disabled when the spectrum is in the time domain.
6. Indeed, the main processing task is to transform the time-domain FID into a
frequency-domain spectrum.
T2
FFT of FID
T2=0.5s
SR=sampling
rate
0
f = 8 Hz
SR = 256 Hz
T2 = 0.5 s
-1
-2
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
In time
70
60
50
40
30
20
10
0
20
40
60
80
100
120
In frequency
FFT of FID
T2
2
f = 8 Hz
SR = 256 Hz
T2 = 0.1 s
1
0
T2=0.1s
Effect of
change of T2
from previous
slide
-1
-2
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
14
In time
12
10
8
6
4
2
0
20
40
60
80
100
120
In frequency
FFT of FID
T2 = 2s
T2
Effect of
change of T2
from previous
slide
2
1
0
-1
-2
f = 8 Hz
SR = 256 Hz
T2 = 2 s
0
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
In time
200
150
100
50
0
20
40
60
80
100
120
In frequency
In time
f = 8 Hz
T2 = 0.5 s
0
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
70
35
60
30
50
25
40
20
30
15
20
10
10
10
20
30
40
50
60
In frequency
SR = 128 kHz
Reduces the
maximum
measurable
frequency
Does not affect the
frequency resolution
SR = 256 Hz
SR = 128 Hz
1
0
-1
-2
0.2
0.4
0.6
0.8
1.2
f = 8 Hz
T2 = 0.5 s
1.4
1.6
1.8
70
35
60
30
50
40
20
15
20
10
10
5
0
10
20
30
40
In time
25
30
50
60
In frequency
To remember
f = 8 Hz
T2 = .5 s
0
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
10
12
14
16
18
20
In time
70
60
50
40
30
20
10
0
In frequency
2
1
ST = 2.0 s
ST = 1.0 s
0
-1
-2
f = 8 Hz
T2 = .5 s
0
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
10
12
14
16
18
20
In time
70
60
50
40
30
20
10
0
In frequency
To remember
2
1
0
-1
-2
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
In time
200
150
100
50
0
f = 8 Hz
T2 = 2.0 s
0
10
12
14
16
18
20
In frequency
2
ST = 2.0 s
ST = 1.0 s
1
0
f = 8 Hz
T2 = 0.1 s
-1
-2
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
10
12
14
16
18
20
In time
14
12
10
8
6
4
2
0
In frequency
2
1
0
-1
-2
-3
SR = 256 Hz
0
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
In time
120
100
80
60
40
20
0
20
40
60
80
100
120
In frequency
Good sampling
is important for
accuracy
2
1
0
-1
-2
-3
SR = 256 Hz
0
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
In time
120
100
80
60
40
20
0
20
40
60
80
100
120
In frequency
Sampling
Theorem of
Nyquist
Continuous signal:
x
Shah function (Impulse train):
s x
s x
x nx
projected
x0
Sampled function:
Sampled and
discretized
f s x f x s x f x x nx0
n
image
Sampling
frequency
Shah function
(Impulse
train):
f s x f x s x f x x nx0
1
x0
1
FS u F u S u F u
x0
n
u x
n
0
FS u
F u
A
u max
x0
u max
Only if u max
1
2 x0
x0
We do not want
trapezoids to overlap
Nyquist Theorem
If u max
FS u
2 x0
x0
Aliasing
u
umax
1
x0
umax
We can use
(Nyquist Frequency)
2 x0
Cu
x0
0
Then
u 1
2 x0
otherwise
F u FS u C u and
f x IFT F u
2umax
Nyquist Theorem;
We can recover F(u)
from Fs(u) when the
sampling frequency is
greater than 2 u max
Aliasing in 2D image
High
frequencies
Low
frequencies
http://www.falstad.com/fourier/
Fourier series java applet
http://www.jhu.edu/~signals/
Collection of demonstrations about digital signal processing
http://www.ni.com/events/tutorials/campus.htm
FFT tutorial from National Instruments
http://www.cf.ac.uk/psych/CullingJ/dictionary.html
Dictionary of DSP terms
http://jchemed.chem.wisc.edu/JCEWWW/Features/McadInChem/mcad008/FT
4FreeIndDecay.pdf
Mathcad tutorial for exploring Fourier transforms of free-induction decay
http://lcni.uoregon.edu/fft/fft.ppt
This presentation
Conclusions
1. Signal (image) must be sampled with high
enough frequency
2. Use Nyquist theorem to decide
3. Using two small sampling frequency leads to
distortions and inability to reconstruct a
correct signal.
4. Spectrum itself has high importance, for
instance in reading NMR signal or speech
signal.