資源簡介
用C編的互相關程序,與matlab中的xcorr相對應,correlation
代碼片段和文件信息
#include?
#include?
#include?
#define?NN?10
void?xcorr(float?*r?unsigned?short?*x?unsigned?short?*y?int?N);
int?main()
{??
????unsigned?short?x[10]={1122345678};
????unsigned?short?y[10]={1345678952};
????float?r[19]?=?{0};
????
????FILE?*fp_out;
????int?delay;
????
????xcorr(r?x?y?NN);
//Open?the?file?to?write
????if((fp_out=fopen(“out_xcorr.txt““wt“))?==?NULL)
{
????printf(“Cannot?open?this?file!\n“);
exit(0);
}
for(delay?=?-NN?+?1;?delay?????????fprintf(fp_out“%d?%f\n“delayr[delay?+?NN
- 上一篇:C/C++結構體序列化配置模板化
- 下一篇:NSGA2 C語言代碼
評論
共有 條評論