fourier transform: applications in seismologyfbernauer/teaching/spektr… · spectra: applications...
TRANSCRIPT
Spectra: Applications Computational Geophysics and Data Analysis1
Fourier Transform: Applications in seismology
• Fourier: Space and Time• Fourier: continuous and discrete• Seismograms – spectral content (exercises)• Filter (exercises)
Scope: Understand how to calculate the spectrum from time series and interpret both phase and amplitude part. Learn the basic concepts of filtering
Spectra: Applications Computational Geophysics and Data Analysis2
Fourier: Space and Time
Spacex space variableL spatial wavelengthk=2p/λ spatial wavenumberF(k) wavenumber spectrum
Timet Time variableT periodf frequencyω=2πf angular frequency
Fourier integrals
With the complex representation of sinusoidal functions eikx (or (eiωt) the Fourier transformation can be written as:
∫
∫∞
∞−
∞
∞−
−
=
=
dxexfkF
dxekFxf
ikx
ikx
)(21)(
)(21)(
π
π
Spectra: Applications Computational Geophysics and Data Analysis3
The Fourier Transformdiscrete vs. continuous
∫
∫∞
∞−
∞
∞−
−
=
=
dxexfkF
dxekFxf
ikx
ikx
)(21)(
)(21)(
π
π
1,...,1,0,
1,...,1,0,1
/21
0
/21
0
−==
−==
∑
∑−
=
−−
=
NkeFf
NkefN
F
NikjN
jjk
NikjN
jjk
π
π
discrete
continuousWhatever we do on the computer with data will be based on the discrete Fourier transform
Spectra: Applications Computational Geophysics and Data Analysis4
Phase and amplitude spectrum
)()()( ωωω Φ= ieFF
The spectrum consists of two real-valued functions of angular frequency, the amplitude spectrum mod (F(ω)) and the phase spectrum φ(ω)
In many cases the amplitude spectrum is the most important part to be considered. However there are cases where the phase spectrum plays an important role (-> resonance, seismometer)
Spectra: Applications Computational Geophysics and Data Analysis5
Spectral synthesis
The red trace is the sum of all blue traces!
Spectra: Applications Computational Geophysics and Data Analysis6
The spectrum
Amplitude spectrum Phase spectrumFo
urie
r sp
ace
Spectra: Applications Computational Geophysics and Data Analysis7
)
Most processing tools (e.g. Python, octave, Matlab, Mathematica, Fortran, etc) have intrinsic functions for FFTs
numpy.fft
See: https://docs.scipy.org/
Spectra: Applications Computational Geophysics and Data Analysis8
Good practice – for estimating spectra
1. Filter the analogue record to avoid aliasing2. Digitise such that the Nyquist lies above the
highest frequency in the original data3. Window to appropriate length 4. Detrend (e.g., by removing a best-fitting line)5. Taper to smooth ends to avoid Gibbs6. Pad with zeroes (to smooth spectrum or to use
2n points for FFT)
Spectra: Applications Computational Geophysics and Data Analysis9
Resampling (Decimating)
• Often it is useful to down-sample a time series (e.g., from 100Hz to 1Hz, when looking at surface waves).
• In this case the time series has to be preprocessed to avoid aliasing effects
• All frequencies above twice the new sampling interval have to be filtered out
Spectra: Applications Computational Geophysics and Data Analysis10
Spectral leakage, windowing, tapering
Care must be taken when extracting time windows when estimating spectra:
– as the FFT assumes periodicity, both ends must have the same value
– this can be achieved by „tapering“– It is useful to remove drifts as to avoid any
discontinuities in the time series -> Gibbs phenonemon-> practicals
Spectra: Applications Computational Geophysics and Data Analysis11
Spectral leakage
Spectra: Applications Computational Geophysics and Data Analysis12
Frequencies in seismograms
Spectra: Applications Computational Geophysics and Data Analysis13
Time – frequency analysis
Fin Whale
Blue Whale
Spectra: Applications Computational Geophysics and Data Analysis16
Spectral analysis: windowed spectra
24 hour ground motion, do you see any signal?
Spectra: Applications Computational Geophysics and Data Analysis17
Seismo-“weather“
Running spectrum of the same data
Exercise
Spectra: Applications Computational Geophysics and Data Analysis18
Sound of an instrument
a‘ - 440Hz
Spectra: Applications Computational Geophysics and Data Analysis19
Instrument Earth
26.-29.12.2004 (FFB )
0S2 – Earth‘s gravest tone T=3233.5s =53.9min
Theoretical eigenfrequencies
Exercise
Spectral analysis: foundations Computational Geophysics and Data Analysis 20
Convolution
∫∫∞
∞−
∞
∞−
−=−=∗ ')'()'(')'()'()()( dttgttfdtttgtftgtf
The convolution operation is at the heart of linear systems.
Definition:
Properties: )()()()( tftgtgtf ∗=∗
)()()( tfttf =∂∗
∫=∗ dttftHtf )()()(
H(t) is the Heaviside function:
Spectral analysis: foundations Computational Geophysics and Data Analysis 21
The convolution theorem
A convolution in the time domain corresponds to a multiplication in the frequency domain.
… and vice versa …
a convolution in the frequency domain corresponds to a multiplication in the time domain
)()()()( ωω GFtgtf ⇒∗
)()()()( ωω GFtgtf ∗⇒
The first relation is of tremendous practical implication!
Spectral analysis: foundations Computational Geophysics and Data Analysis 22
The convolution theorem
From Bracewell (Fourier transforms)
Spectral analysis: foundations Computational Geophysics and Data Analysis 23
Discrete Convolution
Convolution is the mathematical description of the change of waveform shape after passage through a filter (system).
There is a special mathematical symbol for convolution (*):
Here the impulse response function g is convolved with the input signal f. g is also named the „Green‘s function“
)()()( tftgty ∗=
nmk
fgym
iikik
+=
=∑=
−
,,2,1,00
migi ,....,2,1,0=
njf j ,....,2,1,0=
Spectral analysis: foundations Computational Geophysics and Data Analysis 24
Convolution Example(Matlab)
>> x
x =
0 0 1 0
>> y
y =
1 2 1
>> conv(x,y)
ans =
0 0 1 2 1 0
Impulse response
System input
System output
Spectral analysis: foundations Computational Geophysics and Data Analysis 25
Convolution Example (pictorial)
x y„Faltung“
0 1 0 0
1 2 1
0 1 0 01 2 1
0 1 0 0
1 2 1
0 1 0 0
1 2 1
0 1 0 01 2 1
0 1 0 0
1 2 1
0
0
1
2
1
0
y x*y
Digitales Filtern
Oftmals beinhaltet ein aufgezeichnetes Signal eine Fülle von Informationen, an denen wir nicht interessiert sind (Rauschen, Störsignale). Um uns des Rauschens zu entledigen fügen wir einenFilter im Frequenzraum hinzu.
Die wichtigsten Filter sind: Hochpass: schneidet niedrige Frequenzen ab
Tiefpass: schneidet hohe Frequenzen ab
Bandpass: schneidet hohe und tiefe Frequenzen heraus, und hinterlässt ein Band von mittleren Frequenzen
Bandfilter: schneidet bestimmte Frequenzen heraus und hinterlässtalle anderen Frequenzen
Bandpass FilterE
ckfre
quen
z w
ird k
lein
er, A
ntei
l hoh
er F
requ
enze
n ni
mm
t ab
The Butterworth Filter (Low-pass, 0-phase)
Computational Geophysics and 28
nc
LF 2)/(11)(ωω
ω+
=
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1 Butterworth n=1, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1 Butterworth n=4, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1 Butterworth n=9, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1 Butterworth n=16, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
In log-log scale …
Computational Geophysics and 29
100 101 10210-2
10-1
100 Butterworth n=1, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
100 101 10210-6
10-4
10-2
100 Butterworth n=4, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
100 101 10210-15
10-10
10-5
100 Butterworth n=9, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
100 101 10210-30
10-20
10-10
100 Butterworth n=16, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
… effect on a spike …
Computational Geophysics and 30
0 1 2 3 4 50
0.2
0.4
0.6
0.8
1 Original function
Time (s)
Am
plitu
de
0 0.2 0.4 0.6 0.8 1
0.05
0.1
0.15
0.2
Filtered with n=1, f0=20 Hz
Time (s)
Am
plitu
de
0 0.2 0.4 0.6 0.8 1
0
0.05
0.1
0.15
0.2 Filtered with n=4, f0=20 Hz
Time (s)
Am
plitu
de
0 0.2 0.4 0.6 0.8 1
0
0.05
0.1
0.15
0.2 Filtered with n=9, f0=20 Hz
Time (s)
Am
plitu
de
… on a seismogram … … varying the order …
Computational Geophysics and 31
40 45 50 55 60 65
-5
0
5
x 10-6 Original function
Time (s)
Am
plitu
de
40 45 50 55 60 65
-1
0
1
x 10-6 Filtered with n=4, f0=1 Hz
Time (s)
Am
plitu
de
40 45 50 55 60 65-2
-1
0
1
2x 10-6 Filtered with n=9, f0=1 Hz
Time (s)
Am
plitu
de
40 45 50 55 60 65-2
-1
0
1
2x 10-6 Filtered with n=16, f0=1 Hz
Time (s)
Am
plitu
de
… on a seismogram … … varying the cut-off frequency…
Computational Geophysics and 32
40 45 50 55 60 65
-5
0
5
x 10-6 Original function
Time (s)
Am
plitu
de
40 45 50 55 60 65
-1
0
1
x 10-6 Filtered with n=4, f0=1 Hz
Time (s)
Am
plitu
de
40 45 50 55 60 65
-1
-0.5
0
0.5
1
x 10-6 Filtered with n=4, f0=0.666667 Hz
Time (s)
Am
plitu
de
40 45 50 55 60 65
-1
-0.5
0
0.5
1
x 10-6 Filtered with n=4, f0=0.5 Hz
Time (s)
Am
plitu
de
The Butterworth Filter (High-Pass)
Computational Geophysics and 33
nc
HF 2)/(111)(ωω
ω+
−=
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1 Butterworth n=1, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1 Butterworth n=4, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1 Butterworth n=9, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1 Butterworth n=16, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
… effect on a spike …
Computational Geophysics and 34
0 1 2 3 4 50
0.2
0.4
0.6
0.8
1 Original function
Time (s)
Am
plitu
de
0 0.2 0.4 0.6 0.8 1
0
0.2
0.4
0.6
Filtered with n=1, f0=20 Hz
Time (s)
Am
plitu
de
0 0.2 0.4 0.6 0.8 1
0
0.2
0.4
0.6
Filtered with n=4, f0=20 Hz
Time (s)
Am
plitu
de
0 0.2 0.4 0.6 0.8 1
0
0.2
0.4
0.6
Filtered with n=9, f0=20 Hz
Time (s)
Am
plitu
de
… on a seismogram … … varying the order …
Computational Geophysics and 35
40 45 50 55 60 65
-5
0
5
x 10-6 Original function
Time (s)
Am
plitu
de
40 45 50 55 60 65
-5
0
5
x 10-6 Filtered with n=4, f0=1 Hz
Time (s)
Am
plitu
de
40 45 50 55 60 65
-5
0
5
x 10-6 Filtered with n=9, f0=1 Hz
Time (s)
Am
plitu
de
40 45 50 55 60 65
-5
0
5
x 10-6 Filtered with n=16, f0=1 Hz
Time (s)
Am
plitu
de
… on a seismogram … … varying the cut-off frequency…
Computational Geophysics and 36
50 52 54 56 58 60-5
0
5x 10-6 Original function
Time (s)
Am
plitu
de
50 52 54 56 58 60-4
-2
0
2
4x 10-6 Filtered with n=4, f0=1 Hz
Time (s)
Am
plitu
de
50 52 54 56 58 60-4
-2
0
2
4x 10-6 Filtered with n=4, f0=1.5 Hz
Time (s)
Am
plitu
de
50 52 54 56 58 60-4
-2
0
2
4 x 10-6 Filtered with n=4, f0=2 Hz
Time (s)
Am
plitu
de
The Butterworth Filter (Band-Pass)
Computational Geophysics and 37
[ ] nb
BPF 2/)(111)(
ωωωω
∆−+−=
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1 Butterworth n=2, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1 Butterworth n=4, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1 Butterworth n=6, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
0 20 40 60 80 1000
0.2
0.4
0.6
0.8
1 Butterworth n=8, f0=20 Hz
Frequency (Hz)
Filt
er a
mpl
itude
Hz5=∆ω
… effect on a spike …
Computational Geophysics and 38
0 1 2 3 4 50
0.2
0.4
0.6
0.8
1 Original function
Time (s)
Am
plitu
de
0 0.2 0.4 0.6 0.8 1
-0.05
0
0.05
0.1
Filtered with n=1, f0=20 Hz
Time (s)
Am
plitu
de
0 0.2 0.4 0.6 0.8 1
-0.05
0
0.05
0.1 Filtered with n=4, f0=20 Hz
Time (s)
Am
plitu
de
0 0.2 0.4 0.6 0.8 1
-0.05
0
0.05
0.1 Filtered with n=9, f0=20 Hz
Time (s)
Am
plitu
de
… on a seismogram … … varying the order …
Computational Geophysics and 39
40 45 50 55 60 65
-5
0
5
x 10-6 Original function
Time (s)
Am
plitu
de
40 45 50 55 60 65
-2
-1
0
1
2x 10-6 Filtered with n=2, f0=1 Hz
Time (s)
Am
plitu
de
40 45 50 55 60 65
-2
-1
0
1
2
x 10-6 Filtered with n=3, f0=1 Hz
Time (s)
Am
plitu
de
40 45 50 55 60 65
-2
0
2
x 10-6 Filtered with n=4, f0=1 Hz
Time (s)
Am
plitu
de
… on a seismogram … … varying the cut-off frequency…
Computational Geophysics and 40
50 52 54 56 58 60-5
0
5x 10-6 Original function
Time (s)
Am
plitu
de
50 52 54 56 58 60
-5
0
5
x 10-7 Filtered with n=4, f0=2 Hz
Time (s)
Am
plitu
de
50 52 54 56 58 60
-5
0
5
x 10-7 Filtered with n=4, f0=3 Hz
Time (s)
Am
plitu
de
50 52 54 56 58 60
-5
0
5
x 10-7 Filtered with n=4, f0=4 Hz
Time (s)
Am
plitu
de
Zero phase and causal filters - Examples
Computational Geophysics and 41
Zero phase filters can be realised by
Convolve first with a chosen filter Time reverse the original filter and convolve
again First operation multiplies by F(ω), the 2nd
operation is a multiplication by F*(ω) The net multiplication is thus | F(w)|2 These are also called two-pass filters
Zero phase and causal filters
Computational Geophysics and 42
0 1 2 3 4 50
0.2
0.4
0.6
0.8
1 Original function
Time (s)
Am
plitu
de
0 0.2 0.4 0.6 0.8 1
0.05
0.1
0.15
0.2
Filtered with n=1, f0=20 Hz
Time (s)
Am
plitu
de
0 0.2 0.4 0.6 0.8 1
0
0.05
0.1
0.15
0.2 Filtered with n=4, f0=20 Hz
Time (s)
Am
plitu
de
0 0.2 0.4 0.6 0.8 1
0
0.05
0.1
0.15
0.2 Filtered with n=9, f0=20 Hz
Time (s)
Am
plitu
de
When the phase of a filter is set to zero (and simply the amplitude spectrum is inverted) we obtain a zero-phase filter. It means a peak will not be shifted.
Such a filter is acausal. Why?
(causal) Butterworth Low-pass (20 Hz) on spike
Computational Geophysics and 43
0 50
0.5
1 Original function
Time (s)
Am
plitu
de
0 0.5 10
0.2
Filtered with n=1, f0=20 Hz
Time (s)
Am
plitu
de
0 0.5 1
0
0.1
0.2
Filtered with n=4, f0=20 Hz
Time (s)
Am
plitu
de
0 0.5 1
0
0.1
0.2 Filtered with n=9, f0=20 Hz
Time (s)
Am
plitu
de
Butterworth Low-pass (20 Hz) on data
Computational Geophysics and 44
40 45 50 55 60 65
-5
0
5
x 10-6 Original function
Time (s)
Am
plitu
de
40 45 50 55 60 65-1
-0.5
0
0.5
1x 10-6 Filtered with n=2, f0=0.5 Hz
Time (s)
Am
plitu
de
40 45 50 55 60 65
-2
-1
0
1
2
x 10-6 Filtered with n=2, f0=2.5 Hz
Time (s)
Am
plitu
de
40 45 50 55 60 65
-2
0
2
x 10-6 Filtered with n=2, f0=4.5 Hz
Time (s)
Am
plitu
de
Spectra: Applications Computational Geophysics and Data Analysis45
Summary
• Care has to be taken when estimating spectra for finite-length signals (detrending, down-sampling, …)
• The Fourier transform is extremely useful in understanding and analysing seismic recordings
• Filters are powerful tools for extracting information from seismic recordings