資源簡介
雷克子波與反射系數序列進行卷積,得到合成地震記錄.注釋詳細易懂,包含生成雷克子波,反射系數序列,輸出二進制文件,褶積函數
代碼片段和文件信息
/*
?????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鋼琴
- 下一篇:蘇州大學歷年本科數據結構試題
評論
共有 條評論