资源简介
SAC(Seismic Analysis Code)是美国加州大学Lawrence Livermore国家实验室(LLNL)开发研制的,用于研究连续信号,特别是时间序列数据的通用程序
代码片段和文件信息
#include
#include
#include
#include
#include
#define MAX 4000
#define ERROR_MAX 256
int
main(int argc char *argv[]) {
/* Local variables */
int i j;
int nlen nlen1 nlen2 nerr max;
float beg delta end;
char *kname;
float yarray1[MAX] yarray2[MAX] ytmp[MAX] xarray[1];
float *out;
int nwin wlen nfft leven;
char error[ERROR_MAX];
max = MAX;
for(i = 0; i < MAX; i++) {
yarray1[i] = 0.0;
yarray2[i] = 0.0;
ytmp[i] = 0.0;
}
/* Read in the first file */
kname = strdup(“convolvec_in1.sac“);
rsac1(kname ytmp &nlen1 &beg &delta &max &nerr SAC_STRING_LENGTH);
if (nerr != 0) {
fprintf(stderr “Error reading in file(%d): %s\n“ nerr kname);
exit(-1);
}
/* Read in the second file */
kname = strdup(“convolvec_in2.sac“);
rsac1(kname yarray2 &nlen2 &beg &delta &max &nerr SAC_STRING_LENGTH);
if (nerr != 0) {
fprintf(stderr “Error reading in file: %s\n“ kname);
exit(-1);
}
/* Reverse the First Signal */
j = 0;
for(i = nlen1 - 1; i >= 0; i--) {
yarray1[j] = ytmp[i];
j++;
}
nlen = nlen1;
if(nlen2 > nlen) {
nlen = nlen2;
}
/* Allocate space for the correlation of yarray1 and yarray2 */
max = next2((2 * nlen) - 1) * 2;
out = (float *) malloc(sizeof(float) * max);
if(out == NULL) {
fprintf(stderr “Error allocating memory for correlation\n“);
exit(-1);
}
/* Set up values for the cross correlation */
nwin = 1;
wlen = nlen;
nfft = 0;
/* Call crscor ( Cross Correlation no wait uh Convolution )
* - yarray1 - First Input array to correlate
* - yarray2 - Second Input array to correlate
* - nlen - Number of points in yarray and yarray2
* - nwin - Windows to use in the correlation
* - wlen - Length of the windows
* - type - Type of Window (SAC_RECTANGLE)
* - out - output sequence
* - nfft - Length of the output sequence
* - error - Error Message
* - err_len - Length of Error Message (on input)
*/
crscor(yarray1 yarray2 nlen
nwin wlen SAC_RECTANGLE
out &nfft error ERROR_MAX);
/* Zero out the tmp signal */
for(i = 0; i < MAX; i++) {
ytmp[i] = 0.0;
}
/* Reconstruct the signal from the “cross correlation“ back to front
*
* ytmp[0 : nlen1 - 2 ] <- out[nfft-nlen1+1 : nfft - 1 ]
* ytmp[nlen1 - 1 : nlen1 + nlen2 -2 ] <- out[0 : nlen2 - 1 ]
*
* nfft-1 is the last point of the output sequence
*/
for(i = 0; i <= nlen1 - 2; i++) {
ytmp[i] = out[nfft - nlen1 + i + 1];
}
for(i = 0; i <= nlen2 - 1; i++) {
ytmp[nlen1 + i - 1] = out[i];
}
- 上一篇:Praat将连续录制的声音文件切成小单位文件
- 下一篇:PMSM电机MTPA推导
相关资源
- SAC型液压支架控制器检测平台的设计
- pACTERT-TRAIL对涎腺腺样囊性癌SACC-83
- Using GIS to Perform Seismic Hazard Analysis
- USACO翻译及题解
- Seismic Frequency-domain Full waveform 2-D inv
- 论文研究-改进的基于SIFT和RANSAC的图像
- PCL点云库SACSegmentation用法demo
-
syba
se数据库的基本语法 - USACO全部的测试数据
- prosac源代码
- SIFT+RANSAC
- sacd解码源代码字数补丁
- seismic unix 中文使用说明
- seismic analysis code
- 利用OpenCV(2.4.13)的SURF/SIFT + RANSAC
- 提取SIFT并用RANSAC剔去错匹配byRobHess
- Morgan Kaufmann - Transactional Information Sy
- Transactional Information Systems
- Transactional Memory 2nd edition - Synthesis L
- fragment+radioButton实现底部菜单切换fr
- Knapsack Problems. Algorithms and Computer Imp
- USACO训练测试数据
- ABB低压塑壳断路器SACE Isomax S特性曲线
- KnapsackProblems ByHansKellererUlrichPferschyD
- seismic unix指导全书14章
- Transaction Processing Concepts and Techniques
- KnapsackProblems
- usaco历年测试数据
- SURF算法+单应矩阵+RANSAC算法实现拼接
- SACC2014大会PPT
评论
共有 条评论