#include <fftw3.h>
#include <math.h>
#include <string>
#include <iostream>
#include <algorithm>
#include "IGBheader.h"
#include "dft_cmdline.h"
#include "Filter.h"
Go to the source code of this file.
|
| #define | creal(A) (A[0]) |
| |
| #define | cimag(A) (A[1]) |
| |
| #define | cmag(A) sqrt(A[0]*A[0]+A[1]*A[1]) |
| |
|
| void | do_phase (double **in, int n, fftw_plan fftp, fftw_plan bftp, fftw_complex **out, int t) |
| |
| void | bp_filt (double **in, int n, fftw_plan fftp, fftw_plan bftp, fftw_complex **out, int t, float dt, float low, float high) |
| |
| void | bp_notch (double **in, int n, fftw_plan fftp, fftw_plan bftp, fftw_complex **out, int t, float dt, float notch, int nwidth) |
| |
| void | do_PSD (double **in, int n, fftw_plan ftp, fftw_complex **out, int t, float dt) |
| |
| void | do_domF (double **in, int n, fftw_plan ftp, fftw_complex **out, float t, float dt) |
| |
| template<class T > |
| void | write_traces (T **data, int nr, int n, IGBheader *ohead) |
| |
| int | main (int argc, char *argv[]) |
| |
◆ cimag
| #define cimag |
( |
|
A | ) |
(A[1]) |
◆ cmag
| #define cmag |
( |
|
A | ) |
sqrt(A[0]*A[0]+A[1]*A[1]) |
◆ creal
| #define creal |
( |
|
A | ) |
(A[0]) |
◆ bp_filt()
| void bp_filt |
( |
double ** |
in, |
|
|
int |
n, |
|
|
fftw_plan |
fftp, |
|
|
fftw_plan |
bftp, |
|
|
fftw_complex ** |
out, |
|
|
int |
t, |
|
|
float |
dt, |
|
|
float |
low, |
|
|
float |
high |
|
) |
| |
frequency domain band pass filter
- Parameters
-
| in | time series |
| n | number of time series |
| fftp | forward fftw3 plan |
| bftp | backward fftw3 plan |
| out | array to hold the DFT |
| t | number of time samples |
| dt | sampling period in ms |
| low | bottom of band |
| high | top of band |
- Postcondition
- in is overwritten
Definition at line 85 of file IGBdft.cc.
◆ bp_notch()
| void bp_notch |
( |
double ** |
in, |
|
|
int |
n, |
|
|
fftw_plan |
fftp, |
|
|
fftw_plan |
bftp, |
|
|
fftw_complex ** |
out, |
|
|
int |
t, |
|
|
float |
dt, |
|
|
float |
notch, |
|
|
int |
nwidth |
|
) |
| |
frequency domain notch filter
- Parameters
-
| in | time series |
| n | number of time series |
| fftp | forward fftw3 plan |
| bftp | backward fftw3 plan |
| out | array to hold the DFT |
| t | number of time samples |
| dt | sampling period in ms |
| notch | filter around this |
| nwidth | width of notch |
- Postcondition
- in is overwritten
Definition at line 125 of file IGBdft.cc.
◆ do_domF()
| void do_domF |
( |
double ** |
in, |
|
|
int |
n, |
|
|
fftw_plan |
ftp, |
|
|
fftw_complex ** |
out, |
|
|
float |
t, |
|
|
float |
dt |
|
) |
| |
determine dominant frequencies
- Parameters
-
| in | time series |
| n | number of time series |
| ftp | fftw3 plan |
| out | array to hold the DFT |
| t | number of time samples |
| dt | sampling period in ms |
Definition at line 187 of file IGBdft.cc.
◆ do_phase()
| void do_phase |
( |
double ** |
in, |
|
|
int |
n, |
|
|
fftw_plan |
fftp, |
|
|
fftw_plan |
bftp, |
|
|
fftw_complex ** |
out, |
|
|
int |
t |
|
) |
| |
compute phase by Hilbert transform
- Parameters
-
| in | a bunch of time series |
| n | number of time series |
| fftp | forward fftw3 plan |
| bftp | backward fftw3 plan |
| out | array to hold the DFT |
| t | number of time samples |
- Postcondition
- in is overwritten
Definition at line 50 of file IGBdft.cc.
◆ do_PSD()
| void do_PSD |
( |
double ** |
in, |
|
|
int |
n, |
|
|
fftw_plan |
ftp, |
|
|
fftw_complex ** |
out, |
|
|
int |
t, |
|
|
float |
dt |
|
) |
| |
compute the Power Spectral Density
- Parameters
-
| in | time series data |
| n | number of time series |
| ftp | fftw3 plan |
| out | array to hold the DFT |
| t | number of time samples |
| dt | sampling period in ms |
Definition at line 158 of file IGBdft.cc.
◆ main()
| int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
◆ write_traces()
template<class T >
| void write_traces |
( |
T ** |
data, |
|
|
int |
nr, |
|
|
int |
n, |
|
|
IGBheader * |
ohead |
|
) |
| |
output a portion of the data
- Parameters
-
| data | the data to output |
| nr | number of data traces |
| n | offset of first data set |
| ohead | header of output file |
Definition at line 226 of file IGBdft.cc.