资源简介
雷克子波与反射系数序列进行卷积,得到合成地震记录.注释详细易懂,包含生成雷克子波,反射系数序列,输出二进制文件,褶积函数
代码片段和文件信息
/*
A Program of synthetic seismogram generation.
Author: Zhang Junhua Date: Sep.2006 */
#include “stdio.h“ // standard input/output head file.
#include “math.h“ // math. head file.
#include “malloc.h“ // memory allocation head file.
#define fm 35 // The main frequency of Ricker wavelet you can change it.
#define dt 0.002 // The sample interval you can also set it to 0.001 or 0.004.
#define XL 0.060 // The length of wavelet(s) you can change it.
#define HL 0.300 // The length of h(t) namely reflection coefficient.
// Here the length is 0.3 second you can change it.
#define PI 3.1415926
main()
{
FILE *fp1*fp2*fp3;
float *x*h*y; // define the dynamic array.
float t;
int iMN;
void conv();
M=XL/dt+1; // The number of x(t). For this example M=31.
N=HL/dt+1; // The number of h(t). For this example N=151.
// allocate dynamic array.
x=(float *)calloc(Msizeof(float));
h=(float *)calloc(Nsizeof(float));
y=(float *)calloc(M+N-1sizeof(float));
// Generate Ricker wavelet.
fp1=fopen(“Ricker.txt“
- 上一篇:labview钢琴
- 下一篇:苏州大学历年本科数据结构试题
评论
共有 条评论