Ejemplo n.º 1
0
            void InitReceiveData()
            {
                if (CurrentMode.Mode == MILSTD_188.Mode.D_4800N)
                {
                    this.Interleaver = new Interleaver_188_110A_4800();
                }
                else
                {
                    this.Interleaver = new Interleaver_188_110A(CurrentMode.InterleaverColumns, CurrentMode.InterleaverRows);
                }
                this.TotalPatternsInBlock = CurrentMode.BlockLength / (CurrentMode.ProbeDataSymbols + CurrentMode.UnknownDataSymbols);
                this.ProbeCounter         = 0;
                this.ProbeTarget          = new IQ[CurrentMode.ProbeDataSymbols];
                this.Probe = new int[CurrentMode.ProbeDataSymbols];

                this.DataBlock = new int[CurrentMode.UnknownDataSymbols];
                this.FECBuffer = new byte[Interleaver.Length];
                this.OutputData.Clear();

                this.DataScrambler = new LFSR_188_110A();
                if (CurrentMode.Mode == MILSTD_188.Mode.D_4800N)
                {
                    this.FECDecoder = null;
                }
                else
                {
                    this.FECDecoder = new VitDecoder(ConvEncoderType.Truncate, FECEncoderRate * CurrentMode.RepeatDataBits, FECEncoderConstraint, FECEncoderPoly, -1, 8, 0);
                }
                this.ProbeCorr = new Correlator(CORR_TYPE.NONE, CurrentMode.ProbeDataSymbols, CurrentMode.ProbeDataSymbols, 0, 0, 0, 0);
                this.Decoder   = new IQDecoder(CurrentMode.BitsPerSymbol, CurrentMode.BitsToSymbolTable, Constellation.IQTable_8PSK, EncodingType.SCRAMBLE_ADD);
                this.Decoder.StartCorrectionProcess(CurrentMode.UnknownDataSymbols + CurrentMode.ProbeDataSymbols);
            }
Ejemplo n.º 2
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.
            }