資源簡介
BCH可調參數源代碼下載,基于AWGN信道。BCH可調參數源代碼下載,基于AWGN信道。

代碼片段和文件信息
//?------------------------------------------------------------------------
//?File:????bch_awgn.c
//?Date:????January?12?2000
//
//?Simulation?of?hard-decision?decoding?of?a?binary?BCH?code?with?binary
//?transmission?over?an?AWGN?channel.?Decoding?using?the?BM?algorithm.
//?------------------------------------------------------------------------
//?This?program?is?complementary?material?for?the?book:
//
//?R.H.?Morelos-Zaragoza?The?Art?of?Error?Correcting?Coding?Wiley?2002.
//
//?ISBN?0471?49581?6
//
//?This?and?other?programs?are?available?at?http://the-art-of-ecc.com
//
//?You?may?use?this?program?for?academic?and?personal?purposes?only.?
//?If?this?program?is?used?to?perform?simulations?whose?results?are?
//?published?in?a?journal?or?book?please?refer?to?the?book?above.
//
//?The?use?of?this?program?in?a?commercial?product?requires?explicit
//?written?permission?from?the?author.?The?author?is?not?responsible?or?
//?liable?for?damage?or?loss?that?may?be?caused?by?the?use?of?this?program.?
//
//?Copyright?(c)?2002.?Robert?H.?Morelos-Zaragoza.?All?rights?reserved.
//?------------------------------------------------------------------------
#include?
#include?
#include?
#include?
#include?
#define?MAX_RANDOM?LONG_MAX????//?Maximum?value?of?random()?
int?i;
int?m?n?length?k?t?d;
int?p[10];
int?alpha_to[1024]?index_of[1024]?g[1024];
int?recd[1024]?data[1024]?bb[1024];
int?numerr?errpos[1024]?decerror?=?0;
FILE?*fp2;
double?rate;
float?init_snr;
float?final_snr;
float?snr_increment;
double?snr;
double?num_sim;
double?sim;
double?ber;
double?amp;
long?seed;
int?error;
char?filename[40]?name2[40];
void?read_p(void);
void?generate_gf(void);
void?gen_poly(void);
void?encode_bch(void);
void?decode_bch(void);
void?bpsk_awgn(void);
main(int?argc?char?*argv[])
{
?? //?Command?line?processing
?? if?(argc?!=?10)
???? {
printf(“\nSimulation?of?BCH?codes?over?a?binary?input?AWGN?channel\n“);
printf(“Copyright?1994-2000.?Robert?Morelos-Zaragoza\n\n“);
?????? printf(“Usage:?%s?m?length?t?init_snr?final_snr?snr_inc?num_sim?output_file?seed\n“?
??????????????????????argv[0]);
printf(“?-?m?is?the?order?of?GF(2^m)\n“);
printf(“?-?length?of?the?BCH?code\n“);
? printf(“?-?t?=?[d-1/2]\n“);
printf(“?-?init_snr?is?the?initial?value?of?Eb/No?(dB)\n“);
printf(“?-?final_snr?is?the?final?value?of?Eb/No?(dB)\n“);
printf(“?-?snr_inc?is?the?increment?in?Eb/No?(dB)\n“);
printf(“?-?num_sim?is?the?number?of?simulations?per?Eb/No?value\n“);
printf(“?-?output_file?is?the?name?of?a?file?with?Eb/No?and?BER\n“);
printf(“?-?seed?is?the?value?used?in?srandom\n“);
?????? exit(0);
???? }
?? sscanf(argv[1]“%d“?&m);
?? sscanf(argv[2]“%d“?&length);
?? sscanf(argv[3]“%d“?&t);
?? sscanf(argv[4]“%f“?&init_snr);
?? sscanf(argv[5]“%f“?&final_snr);
?? sscanf(argv[6]“%f“?&snr_increment);
?? sscanf(argv[7]“%lf“&num_sim)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????15953??2010-04-20?15:49??bch_awgn2.c
?????文件???????3435??2010-04-22?11:15??bch_awgn2.dsp
?????文件??????48640??2010-04-22?11:15??bch_awgn2.opt
?????文件???????1246??2010-04-22?11:15??bch_awgn2.plg
?????目錄??????????0??2010-04-15?11:26??Debug
?????文件??????33792??2010-04-22?11:15??Debug\vc60.idb
?????文件??????53248??2010-04-22?11:15??Debug\vc60.pdb
?????文件?????203728??2010-04-16?13:17??Debug\bch_awgn2.pch
?????文件??????26343??2010-04-22?11:15??Debug\bch_awgn2.obj
?????文件?????525312??2010-04-22?11:15??Debug\bch_awgn2.pdb
?????文件?????244636??2010-04-22?11:15??Debug\bch_awgn2.ilk
?????文件?????237618??2010-04-22?11:15??Debug\bch_awgn2.exe
?????文件??????????0??2010-04-21?11:33??Debug\a.dat
?????文件??????????0??2010-04-21?15:31??Debug\00.dat
-----------?---------??----------?-----??----
??????????????1393951????????????????????14
評論
共有 條評論