示例#1
0
        public static void CMCreateCMaster()
        {
            // set radio structure
            int[] cmSPC = new int[1] {
                2
            };
            int[] cmInboundSize = new int[8] {
                240, 240, 240, 240, 240, 720, 240, 240
            };

            fixed(int *pcmSPC = cmSPC, pcmIbSize = cmInboundSize)
            cmaster.SetRadioStructure(8, cmRCVR, 1, cmSubRCVR, 1, pcmSPC, pcmIbSize, 1536000, 48000, 384000);

            // send function pointers
            cmaster.SendCallbacks();

            // set default rates
            int[] xcm_inrates = new int[8] {
                192000, 192000, 192000, 192000, 192000, 48000, 192000, 192000
            };
            int aud_outrate = 48000;

            int[] rcvr_ch_outrates = new int[5] {
                48000, 48000, 48000, 48000, 48000
            };
            int[] xmtr_ch_outrates = new int[1] {
                192000
            };

            fixed(int *p1 = xcm_inrates, p2 = rcvr_ch_outrates, p3 = xmtr_ch_outrates)
            cmaster.SetCMDefaultRates(p1, aud_outrate, p2, p3);

            // create receivers, transmitters, specials, and buffers
            cmaster.CreateRadio();

            // get transmitter idenifiers
            int txinid = cmaster.inid(1, 0);        // stream id
            int txch   = cmaster.chid(txinid, 0);   // wdsp channel

            // setup transmitter input sample rate here since it is fixed
            cmaster.SetXcmInrate(txinid, 48000);

            // setup CFIR to run; it will always be ON with new protocol firmware
            WDSP.SetTXACFIRRun(txch, true);

            // set PureSignal basic parameters
            // note:  if future models have different settings, these calls could be moved to
            //      CMLoadRouterAll() which is called each time the receiver model changes.
            SetPSRxIdx(0, 0);   // txid = 0, all current models use Stream0 for RX feedback
            SetPSTxIdx(0, 1);   // txid = 0, all current models use Stream1 for TX feedback
            puresignal.SetPSFeedbackRate(txch, 192000);
            puresignal.SetPSHWPeak(txch, 0.2899);

            // setup transmitter display
            WDSP.TXASetSipMode(txch, 1);            // 1=>call the appropriate 'analyzer'
            WDSP.TXASetSipDisplay(txch, txinid);    // disp = txinid = tx stream

            NetworkIO.CreateRNet();
            cmaster.create_rxa();

            // create_wb();
        }