public class SourceTimeFunction
extends java.lang.Object
You have to multiply
Source time function: stf[0], .. stf[NP-1]
on
Waveform in frequency domain: U[1].. U[NP], respectively. See
convolve(Complex[])
修飾子とタイプ | フィールドと説明 |
---|---|
protected int |
np
The number of steps in frequency domain.
|
protected double |
samplingHz |
protected org.apache.commons.math3.complex.Complex[] |
sourceTimeFunction
The length is NP
|
protected double |
tlen
timeLength [s].
|
修飾子 | コンストラクタと説明 |
---|---|
protected |
SourceTimeFunction(int np,
double tlen,
double samplingHz) |
修飾子とタイプ | メソッドと説明 |
---|---|
static SourceTimeFunction |
boxcarSourceTimeFunction(int np,
double tlen,
double samplingHz,
double halfDuration)
Boxcar source time function
The width is determined by the half duration τ.
|
protected static boolean |
checkValues(int np,
double tlen,
double samplingHz) |
static SourceTimeFunction |
computeSourceTimeFunction(int np,
double tlen,
double samplingHz,
double[] obs,
double[] syn)
Source time function is computed simply by division.
|
org.apache.commons.math3.complex.Complex[] |
convolve(org.apache.commons.math3.complex.Complex[] data)
Operates convolution for data in frequency domain.
|
double[] |
convolve(double[] data)
Operates convolution for data in time domain.
|
SACData |
convolve(SACData sacData) |
int |
getNp() |
double |
getSamplingHz() |
org.apache.commons.math3.complex.Complex[] |
getSourceTimeFunctionInFrequencyDomain() |
Trace |
getSourceTimeFunctionInTimeDomain()
x axis: time [s], y axis: amplitude
After considering that conjugate F[i] = F[N-i],
|
double |
getTlen() |
static SourceTimeFunction |
readSourceTimeFunction(java.nio.file.Path sourcePath) |
static SourceTimeFunction |
smoothedRampSourceTimeFunction(int np,
double tlen,
double samplingHz,
double halfDuration)
Smoothed ramp source time function
The width is determined by the half duration τ.
|
static SourceTimeFunction |
triangleSourceTimeFunction(int np,
double tlen,
double samplingHz,
double halfDuration)
Triangle source time function
The width is determined by the half duration τ.
|
void |
writeSourceTimeFunction(java.nio.file.Path outPath,
java.nio.file.OpenOption... options) |
protected final int np
protected final double tlen
protected final double samplingHz
protected org.apache.commons.math3.complex.Complex[] sourceTimeFunction
protected SourceTimeFunction(int np, double tlen, double samplingHz)
np
- must be a power of 2tlen
- [s] must be a tenth of powers of 2samplingHz
- 20 preferred (now must)public static SourceTimeFunction triangleSourceTimeFunction(int np, double tlen, double samplingHz, double halfDuration)
The width is determined by the half duration τ.
f(t) = 1/τ2 t + 1/τ (-τ ≤ t ≤ 0), -1/τ
2 t + 1/τ (0 ≤ t ≤ τ), 0 (t < -τ, τ
< t)
Source time function F(ω) = (2-2cos(2πωτ))
/(2πωτ)2
np
- the number of steps in frequency domaintlen
- [s] time lengthsamplingHz
- [Hz]halfDuration
- [s] of the sourcepublic static SourceTimeFunction boxcarSourceTimeFunction(int np, double tlen, double samplingHz, double halfDuration)
The width is determined by the half duration τ.
f(t) = 1/(2×τ) (-τ ≤ t ≤ τ), 0 (t < -τ,
τ < t)
Source time function F(ω) =
sin(2πωτ)/(2πωτ);
np
- the number of steps in frequency domaintlen
- [s] time lengthsamplingHz
- [Hz]halfDuration
- [s] of the sourcepublic static SourceTimeFunction smoothedRampSourceTimeFunction(int np, double tlen, double samplingHz, double halfDuration)
The width is determined by the half duration τ.
f(t) = (1-tanh2(2t/τ))/τ (-τ ≤ t ≤ τ), 0
(t < -τ, τ < t)
Source time function F(ω) = (π2
ωτ/2)/sinh(π2ωτ/2)
np
- the number of steps in frequency domaintlen
- [s] time lengthsamplingHz
- [Hz]halfDuration
- [s] of the sourceprotected static boolean checkValues(int np, double tlen, double samplingHz)
public static SourceTimeFunction readSourceTimeFunction(java.nio.file.Path sourcePath) throws java.io.IOException
java.io.IOException
public static SourceTimeFunction computeSourceTimeFunction(int np, double tlen, double samplingHz, double[] obs, double[] syn)
obs
- waveform of observedsyn
- waveform of synnp
- steps of frequency [should be same as synthetics]tlen
- [s] length of waveform [should be same as synthetics]samplingHz
- [Hz]public int getNp()
public double getTlen()
public double getSamplingHz()
public org.apache.commons.math3.complex.Complex[] getSourceTimeFunctionInFrequencyDomain()
np
public void writeSourceTimeFunction(java.nio.file.Path outPath, java.nio.file.OpenOption... options) throws java.io.IOException
outPath
- Path for a file.options
- for writing the filejava.io.IOException
- if the source time function is not computed, then an error
occurspublic final double[] convolve(double[] data)
data
- to be convolved in time domain. The data is convolved
after FFTed.public final org.apache.commons.math3.complex.Complex[] convolve(org.apache.commons.math3.complex.Complex[] data)
data
- to be convolved in frequency domain. The length must be
np
+ 1public final SACData convolve(SACData sacData)
sacData
- to convolute with this.public Trace getSourceTimeFunctionInTimeDomain()