You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.8 KiB
C++

//////////////////////////////////////////////////////////////////////////////
//文件: SegY文件操作类
//主要功能:
//
//程序编写: 2005-12-07
//
//
/////////////////////////////////////////////////////////////////////////////
#pragma once
#define MATH_TRACE_INTEGRAL 0x0001L//道积分
#define MATH_THREE_INSTANTANEOUS 0x0002L//三瞬
#define MATH_AVERAGE_2_POINT 0x0004L//二点平均
#define MATH_AVERAGE_3_POINT 0x0010L//三点平均法
#define MATH_5_POINT_3_TIMES 0x0020L//五点三次
#define MATH_WALSH 0x0040L//快速沃什变换
#define MATH_UNIFORM 0x0080L//规一化处理
#define MATH_POWER_2 0x0100L//振幅平方
#define MATH_POWER_3 0x0200L//振幅立方
class AFX_EXT_CLASS CSectionMath
{
int num;
double *a;
public:
CSectionMath(void);
virtual ~CSectionMath(void);
virtual void Clear(void);
int TraceIntegral(CVector& vt); //道积分
int ThreeInstantaneous(CVector& vt,int mode); //三瞬,mode=0瞬时振幅,mode=1瞬时相位,mode=2瞬时频率
int OppositeWave(CVector &vt); //相对波阻抗
int Play(CVector& vt, UINT uIdea, int times=1);
int Play(CVector& vt, UINT* pMode, int nNum);
//道积分参数
double v0; //零点层速度值
double f1,f2; //带通滤波门限值
int m; //
double dt; //采样间隔
//为了提高频进行备份道
CVector *m_pBkVector;
void BackupTrace(CVector& vector);
protected:
void Average3Point(int n,double *x,double *b); //三点平均法
void Average2Point(int n,double *x,double *b); //二点平均
void Point5Time3(int n, double *y, double *yy); //五点三次平滑
void Walsh(double *p, int n, int k, double *x); //快速沃什变换
public:
//规一化处理,返回所有振幅的平均值
double Uniform(CVector& vt);
double Uniform(CVector& vt, double max, double min);
void Power(CVector& vt, int nPower); //对振幅进行多次方
int Walsh(CVector& vt,BOOL bFirstTime); //快速沃什变换
double HT(double ff1, double ff2, double t); //带通滤波
};