public class FFTUtil
extends java.lang.Object
Constructor and Description |
---|
FFTUtil() |
Modifier and Type | Method and Description |
---|---|
static ComplexArray.Double |
fft(GeneralFFT fft,
QDataSet vds)
helper method for doing FFT of a QDataSet.
|
static QDataSet |
fft(GeneralFFT fft,
QDataSet vds,
QDataSet weights)
Perform the fft to get real and imaginary components for intervals.
|
static QDataSet |
fftPower(GeneralFFT fft,
QDataSet vds) |
static QDataSet |
fftPower(GeneralFFT fft,
QDataSet vds,
QDataSet weights)
Produces the power spectrum of the dataset.
|
static QDataSet |
fftPower(GeneralFFT fft,
QDataSet vds,
QDataSet weights,
QDataSet powxTags)
Produces the power spectrum of the dataset.
|
static double[] |
getFrequencyDomainTags(double fs,
int size) |
static QDataSet |
getFrequencyDomainTags(QDataSet timeDomainTags)
return the frequency tags for the given time offset tags, so
f[i]= i / n*T
where T= time[1] - time[0] and n= len(time) . |
static QDataSet |
getFrequencyDomainTagsForPower(QDataSet dep0)
get the frequency tags, for use when calculating the power in each
channel.
|
static QDataSet |
getTimeDomainTags(QDataSet frequencyDomainTags)
return the time domain tags for inverse fft.
|
static QDataSet |
getWindow10PercentEdgeCosine(int size)
Window with ones in the middle, and then the last 10% taper with cos.
|
static QDataSet |
getWindowHanning(int size)
return a "Hanning" (Hann) window of the given size.
|
static QDataSet |
getWindowUnity(int size)
Window that is all ones, also called a boxcar.
|
static ComplexArray.Double |
ifft(GeneralFFT fft,
QDataSet vds)
helper method for doing inverse FFT of a QDataSet.
|
static QDataSet |
ifft(GeneralFFT fft,
QDataSet vds,
QDataSet weights)
Perform the inverse fft to get real and imaginary components for intervals.
|
static QDataSet |
window(QDataSet ds,
int size)
returns a rank 2 dataset from the rank 1 dataset, where the
FFT would be run on each of the datasets.
|
public static QDataSet fftPower(GeneralFFT fft, QDataSet vds)
public static QDataSet window(QDataSet ds, int size)
ds
- rank 1 dataset of length Nsize
- size of each FFT.public static QDataSet getWindowUnity(int size)
size
- the window sizepublic static QDataSet getWindow10PercentEdgeCosine(int size)
size
- the window sizepublic static QDataSet getWindowHanning(int size)
size
- public static QDataSet fftPower(GeneralFFT fft, QDataSet vds, QDataSet weights)
fft
- FFT enginevds
- rank 1 dataset with depend 0 units TimeLocationUnits.weights
- rank 1 datasets that is the window to apply to the data.public static QDataSet fftPower(GeneralFFT fft, QDataSet vds, QDataSet weights, QDataSet powxTags)
fft
- FFT enginevds
- rank 1 dataset with depend 0 units TimeLocationUnits.weights
- rank 1 datasets that is the window to apply to the data.powxTags
- if non-null, then use these xtags instead of calculating them for each record.public static QDataSet fft(GeneralFFT fft, QDataSet vds, QDataSet weights)
fft
- FFT code to use, such as GeneralFFT.newDoubleFFT(len)vds
- QDataSet rank 1 dataset with depend 0 units TimeLocationUnits.weights
- QDataSet rank 1 dataset containing weights, as in hanning. null indicates no weights.public static QDataSet ifft(GeneralFFT fft, QDataSet vds, QDataSet weights)
fft
- FFT code to use, such as GeneralFFT.newDoubleFFT(len)vds
- QDataSet rank 2 dataset with depend 0 units TimeLocationUnits and depend_1=['real','imaginary'].weights
- QDataSet rank 1 dataset containing weights, as in hanning. null indicates no weights.public static QDataSet getFrequencyDomainTagsForPower(QDataSet dep0)
dep0
- the timetags.public static ComplexArray.Double fft(GeneralFFT fft, QDataSet vds)
fft
- the FFT enginevds
- rank 1 ds[n] or rank 2 ds[n,2]Ops.fft(org.das2.qds.QDataSet)
public static ComplexArray.Double ifft(GeneralFFT fft, QDataSet vds)
fft
- the FFT enginevds
- rank 2 dataset[n;real,complex]Ops.ifft(org.das2.qds.QDataSet)
public static double[] getFrequencyDomainTags(double fs, int size)
fs
- the sampling frequencysize
- the size of the time domain data.public static QDataSet getTimeDomainTags(QDataSet frequencyDomainTags)
frequencyDomainTags
- public static QDataSet getFrequencyDomainTags(QDataSet timeDomainTags)
f[i]= i / n*T
where T= time[1] - time[0]
and n= len(time)
.
for the first n/2 points and
f[i]= (n21-n+i) / ( n*T )
for the second half.
When units have a known inverse, this is returned.timeDomainTags
-