📄 main.c
字号:
#include<stdio.h>
#include<stdlib.h>
#include"ctc.h"
void main()
{
int i,j,k,index;
int count=1,FrameNum=20000;
float buffer[L_total*2*2];
// double *buffer;
int decode[L_total*2],data[L_total*2];
int errornum,framenum,temp;
int L1=4;
FILE *fp,*fp1;
// buffer=(double *)malloc(8*FrameNum*L_total*2*count*2);
// data=(int *)malloc(sizeof(i)*FrameNum*L_total*2);
fp=fopen("noise.dat","r");
fp1=fopen("data.dat","r");
for(i=0;i<count;i++){
errornum=0;
framenum=0;
for(j=0;j<FrameNum;j++){
index=0;
while(!feof(fp)&&index<L_total*2*2){
fscanf(fp,"%f",&buffer[index++]);
}
decoder(buffer,L1+8,L1,decode);
temp=0;
index=0;
while(!feof(fp1)&&index<L_total*2){
fscanf(fp1,"%d",&data[index++]);
}
// for(k=0;k<L_total*2;k++)
// printf("%d ",decode[k]);
for(k=0;k<L_total*2;k++){
if(data[k]!=decode[k]){
temp++;
}
}
if(temp!=0){
framenum++;
}
errornum+=temp;
// printf("%d:%d,%d\n",j,errornum,framenum);
}
printf("%d:%d,%d\n",i,errornum,framenum);
rewind(fp1);
}
fclose(fp);
fclose(fp1);
getchar();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -