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

📄 peaktest.c

📁 FEC Optimized viterbi code
💻 C
字号:
/* Verify correctness of the peak routine * Copyright 2004 Phil Karn, KA9Q */#include <stdio.h>#include <stdlib.h>#include <time.h>/* These values should trigger leading/trailing array fragment handling */#define NSAMP 200002#define OFFSET 1int peakval(signed short *,int);int peakval_port(signed short *,int);int main(){  int i,s;  int result,rresult;  signed short samples[NSAMP];  srandom(time(NULL));  for(i=0;i<NSAMP;i++){    do {      s = random() & 0x0fff;    } while(s == 0x8000);    samples[i] = s;  }  samples[5] = 25000;  rresult = peakval_port(&samples[OFFSET],NSAMP-OFFSET);  result = peakval(&samples[OFFSET],NSAMP-OFFSET);  if(result == rresult){    printf("OK\n");  } else {    printf("peak mismatch: %d != %d\n",result,rresult);  }  exit(0);}

⌨️ 快捷键说明

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