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

📄 xevlmem.c

📁 Numerical Recipes Software 提供的算法子程序集
💻 C
字号:
/* Driver for routine evlmem */

#include <stdio.h>
#include <stdlib.h>
#define NRANSI
#include "nr.h"
#include "nrutil.h"

#define N 1000
#define M 10
#define NFDT 16

int main(void)
{
	int i;
	float fdt,pm,*cof,*data;
	FILE *fp;

	cof=vector(1,M);
	data=vector(1,N);
	if ((fp = fopen("spctrl.dat","r")) == NULL)
		nrerror("Data file spctrl.dat not found\n");
	for (i=1;i<=N;i++) fscanf(fp,"%f",&data[i]);
	fclose(fp);
	memcof(data,N,M,&pm,cof);
	printf("Power spectum estimate of data in spctrl.dat\n");
	printf("     f*delta      power\n");
	for (fdt=0.0;fdt<=0.5;fdt+=0.5/NFDT)
		printf("%12.6f %12.6f\n",fdt,evlmem(fdt,cof,M,pm));
	free_vector(data,1,N);
	free_vector(cof,1,M);
	return 0;
}
#undef NRANSI
/* (C) Copr. 1986-92 Numerical Recipes Software . */

⌨️ 快捷键说明

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