⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xcor.c

📁 seismic software,very useful
💻 C
字号:
/* Copyright (c) Colorado School of Mines, 1990./* All rights reserved.                       *//*FUNCTION: compute z = x cross-correlated with y; i.e.,           ifx+lx-1    z[i] =   sum    x[j]*y[i+j]  ;  i = ifz,...,ifz+lz-1            j=ifxPARAMETERS:lx			i length of x arrayifx			i sample index of first xx			i array to be cross-correlated with yly			i length of y arrayify			i sample index of first yy			i array with which x is to be cross-correlatedlz			i length of z arrayifz			i sample index of first zz			o array containing x cross-correlated with yAUTHOR:  Dave Hale, Colorado School of Mines, 06/02/89MODIFIED:  Dave Hale, Colorado School of Mines, 03/01/90	Use dot products for faster performance on non-vector machines.*/void xcor (int lx, int ifx, float x[], int ly, int ify, float y[],	int lz, int ifz, float z[]){	int ilx=ifx+lx-1,ily=ify+ly-1,ilz=ifz+lz-1,i,j,jlow,jhigh;	float *xp=x-ifx,*yp=y-ify,*zp=z-ifz,sum;	for (i=ifz; i<=ilz; ++i) {		jlow = ify-i;  if (jlow<ifx) jlow = ifx;		jhigh = ily-i;  if (jhigh>ilx) jhigh = ilx;		for (j=jlow,sum=0.0; j<=jhigh; ++j)			sum += xp[j]*yp[i+j];		zp[i] = sum;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -