Esempio n. 1
0
            public TxModem(MILSTD_188.Mode modemMode, float processingFreq, float outputFreq, float[] symbolFilter, float[] outputFilter)
            {
                this.ModemMode = modemMode;
                // Set up all the required parameters
                MILSTD188_110B.modemModes[ModemMode].GetModeInfo(out ModemMode, out D1, out D2, out PreambleSize, out InterleaverRows,
                                                                 out InterleaverColumns, out UnknownDataSymbols, out ProbeDataSymbols, out BlockLength,
                                                                 out RepeatDataBits, out BitsPerSymbol, out MGDTable);

                if (modemMode == MILSTD_188.Mode.D_4800N)
                {
                    this.DataInterleaver = new Interleaver_188_110A_4800();
                }
                else
                {
                    this.DataInterleaver = new Interleaver_188_110A(InterleaverColumns, InterleaverRows);
                }
                this.DataInterleaver.Init();
                this.DataScrambler     = new LFSR_188_110A();
                this.PreambleScrambler = new SyncScrambler();
                if (modemMode == MILSTD_188.Mode.D_4800N)
                {
                    this.FECEncoder = null;
                }
                else
                {
                    this.FECEncoder = new ConvEncoder(ConvEncoderType.Truncate, FECEncoderRate * RepeatDataBits, FECEncoderConstraint, FECEncoderPoly, -1, 8);
                }

                this.Encoder      = new IQEncoder(BITS_PER_SYMBOL, Constellation.Table_1_to_1, Constellation.IQTable_8PSK, EncodingType.SCRAMBLE_ADD);
                this.Modulator    = new IQModulator(CARRIER_FREQ, CARRIER_FREQ, NUM_FREQ, processingFreq, SYMBOLRATE, symbolFilter);
                this.OutputBuff   = new float[(int)(processingFreq / SYMBOLRATE)];
                this.OutputFilter = new FIR(outputFilter, (int)(processingFreq / outputFreq));

                this.FlushModulatorLength = 0;
                if (symbolFilter != null)
                {
                    FlushModulatorLength += (symbolFilter.Length * 2);
                }
                if (outputFilter != null)
                {
                    FlushModulatorLength += (outputFilter.Length * 2);
                }

                this.TotalPatternsInBlock = BlockLength / (ProbeDataSymbols + UnknownDataSymbols);

                // FEC Size and Counter - reinitialize FEC on interleaver boundaries
                FECBuffer  = new byte[this.DataInterleaver.Length];
                FECLength  = this.DataInterleaver.Length / (FECEncoderRate * RepeatDataBits);
                FECCounter = 0;     // Re-initialize FEC coder on interleaver boundaries.
            }
Esempio n. 2
0
 public ModeInfo this[MILSTD_188.Mode modeIndex]
 {
     get
     {
         foreach (ModeInfo m in ModeArray)
         {
             if (m.Mode == modeIndex)
             {
                 return(m);
             }
         }
         return(null);
     }
 }
Esempio n. 3
0
 public void GetModeInfo(out MILSTD_188.Mode mod, out int d1, out int d2, out int pSize, out int row, out int col, out int unk, out int prob, out int block, out int rpt, out int bps, out int[] table)
 {
     mod   = Mode;
     d1    = D1; d2 = D2;
     pSize = PreambleSize;
     row   = InterleaverRows;
     col   = InterleaverColumns;
     unk   = UnknownDataSymbols;
     prob  = ProbeDataSymbols;
     block = BlockLength;
     rpt   = RepeatDataBits;
     bps   = BitsPerSymbol;
     table = BitsToSymbolTable;
 }
Esempio n. 4
0
 public ModeInfo(MILSTD_188.Mode mod, int d1, int d2, int pSize, int row, int col, int unk, int prob, int block, int rpt, int bps, int[] table)
 {
     Mode               = mod;
     D1                 = d1; D2 = d2;
     PreambleSize       = pSize;
     InterleaverRows    = row;
     InterleaverColumns = col;
     UnknownDataSymbols = unk;
     ProbeDataSymbols   = prob;
     BlockLength        = block;
     RepeatDataBits     = rpt;
     BitsPerSymbol      = bps;
     BitsToSymbolTable  = table;
 }
Esempio n. 5
0
            public TxModem(MILSTD_188.Mode modemMode, float processingFreq, float outputFreq, float[] symbolFilter, float[] outputFilter)
            {
                this.ModemMode = modemMode;
                // Set up all the required parameters
                MILSTD188_110B_39.modemModes[ModemMode].GetModeInfo(out ModemMode, out D1, out D2, out PreambleSize, out InterleavingDegree,
                                                                    out InterleaverNumBlocks, out BitsPerCodeword, out SyncSymbols, out BlockLength,
                                                                    out RepeatDataBits, out BitsPerSymbol, out BitsToSymbols);

                this.DataRate       = Baudrates[D2];
                this.DiversityArray = Diversity_New[D2];

                this.InputBlockSize = (int)(processingFreq / SYMBOLRATE);

                // For 2400 baud we use RS(14, 10), for all others - RS(7,3)
                int SymbTotal = (DataRate == 2400) ? 14 : 7;
                int SymbData  = (DataRate == 2400) ? 10 : 3;

                DataSymbols = BitsPerCodeword * InterleavingDegree * InterleaverNumBlocks;
                // DataSymbols = TotalBits * RS_BITS * InterleavingDegree * InterleaverNumBlocks;  // The same
                // Here is the magic formula that keeps the incoming and outgoing bitrate:
                //   @ 2400      K = (16 * Int * NumBlocks ) / 9
                //   @ any other K = (4 * Int * NumBlocks ) / 9
                SyncSymbols = (((DataRate == 2400) ? 16 : 4) * InterleavingDegree * InterleaverNumBlocks) / 9;
                SyncLFSR    = new LFSR__188_110B_39(9, 0x0116);
                // Calculate the seed value - the scrambler repeats every 2^9 - 1 = 511 symbols
                // Start with the desired end value and count the (511 - necessary number of symbols)
                int NumShift = 0x1FF - SyncSymbols; if (NumShift < 0)

                {
                    NumShift += 0x1FF;
                }

                SyncLFSR.Init(0x1FF);
                SyncLFSR.Shift(NumShift + 1);
                LSFRSeed = SyncLFSR.Value & 0x1FF;

                this.DataInterleaver = new Interleaver_188_110B_39(InterleavingDegree, InterleaverNumBlocks, RS_BITS, SymbTotal, SymbData);
                this.DataInterleaver.Init();

                this.DiversitySpreader = new DataSpreader <byte>(BitsPerSymbol, this.DiversityArray);
                this.DiversitySpreader.Init();

                this.Encoder = new IQEncoder[NUM_FREQ];
                for (int i = 0; i < NUM_FREQ; i++)
                {
                    Encoder[i] = new IQEncoder(BITS_PER_SYMBOL, Constellation.BitsToPhase_39, Constellation.IQTable_QPSK45,
                                               EncodingType.DIFF_IQ);
                }

                this.Modulator         = new OFDMFFTModulator(CARRIER_FREQ_LO, CARRIER_FREQ_HI, NUM_FREQ, processingFreq, SYMBOLRATE);
                this.PreambleModulator = new IQModulator(CARRIER_FREQ_LO, CARRIER_FREQ_HI, NUM_FREQ, processingFreq, SYMBOLRATE, null);
                this.DopplerTone       = new Generator();
                this.DopplerTone.Init(DOPPLER_FREQ + FREQ_OFFSET, processingFreq, 0);
                this.OutputFilter = new FIR(outputFilter, (int)(processingFreq / outputFreq));

                this.FlushModulatorLength = 20;
                if (symbolFilter != null)
                {
                    FlushModulatorLength += (symbolFilter.Length * 2);
                }
                if (outputFilter != null)
                {
                    FlushModulatorLength += (outputFilter.Length * 2);
                }
            }
Esempio n. 6
0
 public MILSTD188_110B_39(MILSTD_188.Mode modemMode, float processingFreq, float outputFreq, float[] symbolFilter, float[] outputFilter)
 {
     Tx = new TxModem(modemMode, processingFreq, outputFreq, symbolFilter, outputFilter);
     Rx = new RxModem(outputFreq);
 }
Esempio n. 7
0
 public MILSTD188_110B(MILSTD_188.Mode modemMode, float inputFreq, float processingFreq, float outputFreq, float[] symbolFilter, float[] inputFilter, float[] outputFilter)
 {
     Rx = new RxModem(inputFreq, processingFreq, inputFilter, symbolFilter);
     Tx = new TxModem(modemMode, processingFreq, outputFreq, symbolFilter, outputFilter);
 }
Esempio n. 8
0
 public void Add(MILSTD_188.Mode mod, int d1, int d2, int pSize, int row, int col, int unk, int prob, int block, int rpt, int bps, int[] table)
 {
     ModeArray.Add(new ModeInfo(mod, d1, d2, pSize, row, col, unk, prob, block, rpt, bps, table));
 }