class.h

来自「这是一种用C实现的(2,1,7)卷积码维特比译码算法的软件实现.」· C头文件 代码 · 共 89 行

H
89
字号
#include <vcl.h>
#include <stdio.h>
#include <math.h>
#include <sys\stat.h>

#include <stdlib.h>
//---------------------------------------------------------------------------
#ifndef classH
#define classH
//******************************************************************
//名称:        MCreatMatrix
//功能:        产生生成距阵
//******************************************************************
class MCreatMatrix
{
private:
public:
        unsigned char *Buffer;
        int Row,Column;
        void Input(int n0,int k0,int m,int *Member);
        __fastcall MCreatMatrix();
        __fastcall ~MCreatMatrix();
};
//******************************************************************
//名称:        MTransferState
//功能:        生成状态转移表
//******************************************************************
class MTransferState
{
private:
        int num,*out,*in;
	unsigned char *zh1,*zh2;
        int OutNum,InNum,Zh1Num,Zh2Num;
public:
        int *Buffer;
        int Row,Column;
        void Input(int n0,int k0,int m,unsigned char *Matrix);
        __fastcall MTransferState();
        __fastcall ~MTransferState();
};
//******************************************************************
//名称:        MVitebiDecode
//功能:        通用维特比译码器
//******************************************************************
class MVitebiDecode
{
private:
        int *Measurement,*State,Old,New,Row,Column,PathNum,n0,k0;
        int PathStoreLength,NowStoreLength,NowStoreSite,RemainBitLen,RemainByteLen;
        Byte *PathStore,*RemainBit,BitSite,*ByteCodeIn;
        MCreatMatrix CreatMatrix;
        MTransferState TransferState;
public:
        Byte *Buffer,*ByteBuffer;
        int BufBitLen,ByteBufLen;
        void Initial(int n,int k,int m,int *Member);
        void Input(char *Data,int BitLength);
        void ByteInput(char *Data,int ByteLength);
        __fastcall MVitebiDecode();
        __fastcall ~MVitebiDecode();

};

//**********************************************************************
//名称:MPuncturedDecoder
//功能:卷积码的增信删余译码
//**********************************************************************
class MPuncturedDecoder
{
private:
        MVitebiDecode Decoder;
        int *Measurement,*State,Old,New,Row,Column,PathNum,SendNum,k0;
        int PathStoreLength,NowStoreLength,NowStoreSite,RemainDataLen;
        Byte *PathStore,*RemainData,BitSite,*ByteCodeIn,*ReBuffer,*DivData,*PunSite;
        MCreatMatrix CreatMatrix;
        MTransferState TransferState;
        int ReBufferLen,DivDataLen;
        Byte *CodeIn;
public:
        Byte *Buffer;
        int BufferLen;

        void Initial(int n,int k,int m,int *Member,Byte *Site);
        void Input(Byte *Data,int DataLen);
        MPuncturedDecoder();
        ~MPuncturedDecoder();
};
#endif

⌨️ 快捷键说明

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