Return to KLUBNL.PL main page

rsgb_lf_group
[Top] [All Lists]

LF: Re: RE: Re: WOLF - Transmit?

To: [email protected]
Subject: LF: Re: RE: Re: WOLF - Transmit?
From: "Stewart Nelson" <[email protected]>
Date: Thu, 22 Mar 2001 09:23:41 -0800
Organization: SC Group
References: <[email protected]>
Reply-to: [email protected]
Sender: <[email protected]>
Hi Andy and all,

Sorry that I don't have a good document on the format, but
here is the code used to generate it; I hope that it is
enough info for you to build something compatible with WOLF.

You can run WOLF in the "EEPROM" mode to see if a given
message encoding matches your software.  If you have trouble,
let me know and I'll try to help.

Transmission involves radix-40 encode, convolutional encode,
interleave, and reference bit insertion.

#define MSGLEN 15  /* source message len in chars */
#define MSGLENW 5  /* radix 40 message len in 16-bit words */
#define WLEN 16   /* bits in 3-character coded group */
#define MSGLENB 80  /* message length in bits */
#define RRATE 6   /* reciprocal of code rate */

/* Radix-40 encoder */
/* Future versions may use codes >=64000 for
  control functions, CRC, etc. */
/* in: ASCII string, up to 15 chars
  out: array of 16 bit words, radix-40 encoded */
void encr40(char *in, ushort out[])
{
 int ch, fill, val, i;
 fill = 0;
 val = 0;
 for (i = 0; i < MSGLEN; ++i) {
   if (fill)
     ch = 0;
   else if (!(ch = *in++))
     fill = 1;
   else if (ch >= 'A' && ch <= 'Z')
     ch = ch - 'A' + 1;
   else if (ch >= 'a' && ch <= 'z')
     ch = ch - 'a' + 1;
   else if (ch >= '0' && ch <= '9')
     ch = ch - '0' + 27;
   else if (ch == ' ')
     ch = 0;
   else if (ch == '.')
     ch = 37;
   else if (ch == '/')
     ch = 38;
   else
     ch = 39;
   val = val * 40 + ch;
   if (i % 3 == 2) {
     *out++ = val;
     val = 0;
   }
 }
}

/* These values are bit-reversed from those in the NASA paper
  because the register shifts left */

int cnvcod[] = {042631, 047245, 073363, 056507, 077267, 064537};

/* tail-biting encoder
  in: array of radix-40 encoded 16 bit words
  out: baseband signal in xmit order, array of chars */
void enccnv(ushort in[], char out[])
{
 int sr, i, j, k, b, t;
 sr = in[MSGLENW-1];  /* init sr to last 15 bits */
 for (i = 0; i < MSGLENW; ++i) {
   for (j = 0; j < WLEN; ++j) {
     sr = (sr << 1) | (in[i] >> (15-j)) & 1;
     for (k = 0; k < RRATE; ++k) {
       b = 0;
       for (t = sr & cnvcod[k]; t; t &= t-1)
         b ^= 1;
       /* store */
#if INTLV
       out[k*MSGLENB + (j&7)*10 + ((j&8)>>3) + i*2] = b;
#else
       out[k*MSGLENB + j + i*WLEN] = b;
#endif
     }
   }
 }
}

char pnpat[] = {
0,0,1,1,1,1,1,0,1,0,1,0,1,1,0,0,0,0,1,1,0,1,0,1,1,0,0,1,0,1,0,0,1,0,0,0,1,0,0,1,
1,0,1,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,1,0,0,0,1,0,1,1,0,0,0,1,0,1,1,1,1,0,1,0,1,1,
1,1,0,0,1,0,0,0,1,0,0,1,1,1,0,1,0,1,0,0,0,1,0,1,1,0,0,0,1,0,1,0,1,1,0,1,1,0,1,0,
1,0,1,1,0,0,0,0,0,1,0,1,1,0,1,1,0,1,0,0,0,1,0,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,1,
1,0,1,1,0,1,0,0,1,1,1,0,1,0,0,1,1,0,1,0,1,0,0,1,0,0,0,1,1,1,0,1,0,0,1,0,0,0,1,1,
0,0,1,0,1,0,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,0,1,1,0,0,1,1,1,
1,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,0,1,0,1,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,0,1,0,1,1,0,0,1,0,0,1,1,0,1,0,1,1,0,1,1,1,0,0,1,0,1,0,1,0,1,1,1,1,0,
1,1,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,0,1,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,0,1,0,0,1,
0,1,0,0,0,1,1,0,0,1,0,1,0,1,0,0,1,1,0,1,1,1,0,0,1,1,1,0,0,1,1,1,1,1,0,1,1,0,1,0,
1,0,0,1,1,1,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,1,1,0,0,0,0,1,1,0,1,0,1,1,1,0,1,0,1,1,
1,0,0,0,1,1,1,1,1,0,0,0,1,1,0,1,0,0,1,1,1,1,1,1,0,1,0,0,1,0,0,1,0,1,0,0,0,1,1,1,
};

Notes:  The interleave function is far from optimum but a lot better than
nothing.  The PN pattern was chosen literally at random, selecting for low
autocorrelation and for low autocorrelation with short substrings, but is
also far from optimum.  I would greatly appreciate it if you find a good
replacement pattern.

Hope this is useful.

73,

Stewart KK7KA


----- Original Message -----
From: "Talbot Andrew" <[email protected]>
To: <[email protected]>
Sent: Thursday, March 22, 2001 7:02 AM
Subject: LF: RE: Re: WOLF - Transmit?


I would like add Wolf coding to my PIC based BPSK generator.
Stuart, can you reveal the exact coding details, I can't find them in
any of the documentation on the Web.   Just a comment that the mesage
data is interleaved (?) with a PN Sequence to assist clock recovery and
timing.

Andy  G4JNT




<Prev in Thread] Current Thread [Next in Thread>