资源简介

本程序用C语言来编写,主要包括了CVSD的编码、解码算法,及在最后解码出来后的数字滤波器的编程。

资源截图

代码片段和文件信息

#include
#include
#include
#define BUFFERSIZEOUT  254
#define BUFFERSIZEIN   4064

#define  DeltaMax  1280
#define  DeltaMin 6.5
#define Beta  0.99
#define  ORD  6
#define  MAX_BITS  16

double  ValPreCVSD=0;
double  DeltaCVSD=20;
double Delta0CVSD=10;
char  ThreeJudgeCVSD[3]={010};
double  ValPreCVSDDE=0;
double  DeltaCVSDDE=20;
double Delta0CVSDDE=10;
char  ThreeJudgeCVSDDE[3]={010};

static  double CoefA[ORD]={1.00000000-3.888933296.64074495
-6.086001002.98673653-0.62768820};
static  double CoefB[ORD]={0.03285030-0.057239160.03681835
0.03681835-0.057239160.03285030} ;
static short filterY[ORD-1];
static short filterX[ORD];
char CVSDCoder(short InData);
short CVSDDecoder(char InData);


char CVSDCoder(short InData)
{
  double Diff=0;
     int j=0;
 char OutData;
 Diff=InData-ValPreCVSD;

if(Diff>0)
{
ThreeJudgeCVSD[j]=1;
OutData=1;
}
else
{
ThreeJudgeCVSD[j]=0;
OutData=0;
}                  
if (((ThreeJudgeCVSD[0]==1)&(ThreeJudgeCVSD[1]==1)&(ThreeJudgeCVSD[2]==1))|
      (ThreeJudgeCVSD[0]==0)& (ThreeJudgeCVSD[1]==0)&(ThreeJudgeCVSD[1]==1)))
         
     DeltaCVSD=DeltaCVSD+Delta0CVSD;
else    DeltaCVSD=Beta*DeltaCVSD;
if(DeltaCVSD>DeltaMax)              DeltaCVSD=DeltaMax;
if(DeltaCVSD

if(ThreeJudgeCVSD[j]==1)
{
     ValPreCVSD=ValPreCVSD+DeltaCVSD;
}

if(ThreeJudgeCVS

评论

共有 条评论