public void Connect() { //string resourceName; //double frequency, frequencyOffset, power, actualIQRate; //decimal phase, phaseOffset, amplitude, amplitudeOffset; //double[] iData, qData; //double frequencyOffset, actualIQRate; //int numSamples = 100; //use waveform quantum to find num samples instead? ComplexWaveform <ComplexDouble> IQData = new ComplexWaveform <ComplexDouble>(numSamples); List <PhaseAmplitudeOffset> offsets = new List <PhaseAmplitudeOffset>(); try { //initialize rfsg session //subscribe to rfsg warnings _rfsgSession.DriverOperation.Warning += new EventHandler <RfsgWarningEventArgs>(DriverOperation_Warning); //configure generator _rfsgSession.RF.Configure(frequency, power); _rfsgSession.Arb.GenerationMode = RfsgWaveformGenerationMode.ContinuousWave; _rfsgSession.Arb.IQRate = 50e6; actualIQRate = _rfsgSession.Arb.IQRate; frequencyOffset = actualIQRate / numSamples; _rfsgSession.Arb.SignalBandwidth = 2 * frequencyOffset; //stimulate w/ CW stimulateDUTwithCW(numSamples); } catch (Exception ex) { MessageBox.Show("Error in Connect()\n" + ex.Message); } }
public ComplexWaveform <ComplexSingle> ConvertComplexSingleToNiComplexWaveformFormat(ComplexSingle[] data, double sRate) { double absoluteInitialX = 0; // -0.000005; double IQmag = 0, IQmax = 0; double[] arrMag = new double[data.Length]; ComplexWaveform <ComplexSingle> target = new ComplexWaveform <ComplexSingle>(data.Length); var targetBuffer = target.GetWritableBuffer(); for (int i = 0; i < data.Length; i++) { targetBuffer[i] = new ComplexSingle(data[i].Real, data[i].Imaginary); IQmag = Math.Sqrt(Math.Pow(data[i].Real, 2) + Math.Pow(data[i].Imaginary, 2)); arrMag[i] = IQmag; if (IQmag > 1.0) { //Console.WriteLine("IQmag = " + IQmag.ToString() + "\nArrayElement = " + i.ToString()); if (IQmag > IQmax) { IQmax = IQmag; } } } target.PrecisionTiming = PrecisionWaveformTiming.CreateWithRegularInterval( new PrecisionTimeSpan(1.0 / sRate), new PrecisionTimeSpan(absoluteInitialX)); Console.WriteLine("IQmax = " + IQmax.ToString()); return(target); }
/// <summary> /// Writes the specified waveform to the generator only if the waveform does not already exist in the generator's onboard memory. /// </summary> public void ConditionalWriteWaveform(string waveformName, ComplexWaveform <ComplexDouble> waveform) { if (!waveformCache.Contains(waveformName)) { RfsgHandle.Arb.WriteWaveform(waveformName, waveform); waveformCache.Add(waveformName); } }
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { var complexArray = (T[])objectProvider.GetObject(); double t0 = 0.0; double dt = 1.0; var wfm = ComplexWaveform <T> .FromArray1D(complexArray); double[] real = wfm.GetRealDataArray(true); double[] imag = wfm.GetImaginaryDataArray(true); LabVIEWVisualizers.ComplexWaveform(t0, dt, real, imag); }
private void Acquire() { long numberOfSamples = transceiver.RfsaHandle.Configuration.IQ.NumberOfSamples; for (int i = 0; i < rxFrequencyRamp.Length * numberOfRuns; i++) { ComplexWaveform <ComplexDouble> iqData = transceiver.RfsaHandle.Acquisition.IQ.FetchIQSingleRecordComplexWaveform <ComplexDouble>(i, numberOfSamples, timeout); queue.Add(iqData); } transceiver.RfsgHandle.Abort(); acquisitionCompleteEvent.Set(); }
public static NoiseFloorTest[] Multisite( Transceiver[] sites, string band, string waveformName, ComplexWaveform <ComplexDouble> waveform, double txStartFrequency = 1920E6, double txStopFrequency = 1980E6, double rxStartFrequency = 2110E6, double rxStopFrequency = 2170E6, double frequencyStep = 1E6, int numberOfRuns = 1, string referenceTriggerLine = "PXI_Trig0", double sgPowerLevel = -10, double saReferenceLevel = 10, double vbw = 10000, bool preSoakSweep = false, double soakFrequency = 1955E6, double soakTime = 0, double dwellTime = 1E-3, double idleTime = 300E-6, double referenceTriggerDelay = 15E-6, double timeout = 10) { NoiseFloorTest[] testArr = new NoiseFloorTest[sites.Length]; for (int i = 0; i < testArr.Length; i++) { testArr[i] = new NoiseFloorTest( sites[i], band, waveformName, waveform, txStartFrequency, txStopFrequency, rxStartFrequency, rxStopFrequency, frequencyStep, numberOfRuns, referenceTriggerLine, sgPowerLevel, saReferenceLevel, vbw, preSoakSweep, soakFrequency, soakTime, dwellTime, idleTime, referenceTriggerDelay, timeout); } return(testArr); }
public PowerServoTest( Transceiver transceiver, string waveformName, ComplexWaveform <ComplexDouble> waveform, double centerFrequency = 1E9, double powerLevel = -10 ) { this.transceiver = transceiver; this.waveformName = waveformName; this.waveform = waveform; this.centerFrequency = centerFrequency; this.powerLevel = powerLevel; }
public void writeWaveform(ComplexWaveform <ComplexDouble> IQdata) //input is complex waveform that was created using createWaveform(offsets); { //rest of code to write offsets ComplexWaveform <ComplexDouble> NewIQData = new ComplexWaveform <ComplexDouble>(numSamples); //List<PhaseAmplitudeOffset> offsetList = new List<PhaseAmplitudeOffset>(); PrecisionTimeSpan dt = PrecisionTimeSpan.FromSeconds(1 / actualIQRate); IQdata.PrecisionTiming = PrecisionWaveformTiming.CreateWithRegularInterval(dt); _rfsgSession.Arb.WriteWaveform("", IQdata); _rfsgSession.Initiate(); //ComplexWaveform<ComplexDouble> IQdata }
public NoiseFloorTest( Transceiver transceiver, string band, string waveformName, ComplexWaveform <ComplexDouble> waveform, double txStartFrequency = 1920E6, double txStopFrequency = 1980E6, double rxStartFrequency = 2110E6, double rxStopFrequency = 2170E6, double frequencyStep = 1E6, int numberOfRuns = 1, string referenceTriggerLine = "PXI_Trig0", double sgPowerLevel = -10, double saReferenceLevel = 10, double vbw = 10000, bool preSoakSweep = false, double soakFrequency = 1955E6, double soakTime = 0, double dwellTime = 1E-3, double idleTime = 300E-6, double referenceTriggerDelay = 15E-6, double timeout = 10) { this.transceiver = transceiver; this.band = band; this.waveformName = waveformName; this.waveform = waveform; this.txStartFrequency = txStartFrequency; this.txStopFrequency = txStopFrequency; this.rxStartFrequency = rxStartFrequency; this.rxStopFrequency = rxStopFrequency; this.frequencyStep = frequencyStep; this.numberOfRuns = numberOfRuns; this.referenceTriggerLine = referenceTriggerLine; this.sgPowerLevel = sgPowerLevel; this.saReferenceLevel = saReferenceLevel; this.vbw = vbw; this.preSoakSweep = preSoakSweep; this.soakFrequency = soakFrequency; this.soakTime = soakTime; this.dwellTime = dwellTime; this.idleTime = idleTime; this.referenceTriggerDelay = referenceTriggerDelay; this.timeout = new PrecisionTimeSpan(timeout); ThreadPool.QueueUserWorkItem(o => LVFilters.Initialize()); // this is launched asynchronously and will never be waited on transceiver.Initialize(); }
public ComplexWaveform <ComplexDouble> createWaveform(List <PhaseAmplitudeOffset> offsets) { ComplexWaveform <ComplexDouble> complexWaveform; ComplexDouble[] IQData = new ComplexDouble[offsets.Count]; for (int i = 0; i < offsets.Count; i++) { IQData[i] = ComplexDouble.FromPolar((double)offsets[i].Amplitude, (double)offsets[i].Phase); } complexWaveform = ComplexWaveform <ComplexDouble> .FromArray1D(IQData); return(complexWaveform); }
public static PowerServoTest[] Multisite( Transceiver[] sites, string waveformName, ComplexWaveform <ComplexDouble> waveform, double centerFrequency = 1E9, double powerLevel = -10) { PowerServoTest[] testArr = new PowerServoTest[sites.Length]; for (int i = 0; i < sites.Length; i++) { testArr[i] = new PowerServoTest( sites[i], waveformName, waveform, centerFrequency, powerLevel); } return(testArr); }
public void TestConfigureLookUpTable() { LookUpTableConfiguration lutConfig = new LookUpTableConfiguration() { DutAverageInputPower_dBm = 10.0, // results in no scaling of iq data DutInputPower_dBm = new float[] { 1.0f, 3.0f, 2.0f, 4.0f }, SupplyVoltage_V = new float[] { 5.0f, 7.0f, 6.0f, 8.0f } }; Waveform referenceWaveform = new Waveform() { Data = ComplexWaveform <ComplexSingle> .FromArray1D(new ComplexSingle[] { ComplexSingle.FromSingle(0.5f), ComplexSingle.FromSingle(1.5f), ComplexSingle.FromSingle(2.5f), ComplexSingle.FromSingle(3.5f), ComplexSingle.FromSingle(4.5f) }) }; // p = 10log(i^2) + 10 // i = sqrt(10**(p - 10) / 10) var writableBuffer = referenceWaveform.Data.GetWritableBuffer(); for (int i = 0; i < referenceWaveform.Data.SampleCount; i++) { writableBuffer[i] = ComplexSingle.FromSingle((float)Math.Sqrt(Math.Pow(10.0, (writableBuffer[i].Real - 10.0) / 10.0))); } Waveform envelopeWaveform = CreateLookUpTableEnvelopeWaveform(referenceWaveform, lutConfig); ComplexSingle.DecomposeArrayPolar(envelopeWaveform.Data.GetRawData(), out float[] yi, out _); float[] solution = new float[] { 4.5f, 5.5f, 6.5f, 7.5f, 8.5f }; using (new AssertionScope()) { for (int i = 0; i < yi.Length; i++) { yi[i].Should().BeApproximately(solution[i], 0.1f); } } }
public PowerServoTest[] BuildPwrServoTest(string strWaveform, string strWaveformName, S_NoiseConfig[] noiseConfig) { var pwrServoSite = new PowerServoTest[testSite]; for (int i = 0; i < testSite; i++) { #region Load waveform (CW or from file) ComplexDouble[] iqDataArr; s_SignalType value = new s_SignalType(); Get_s_SignalType(strWaveform, strWaveformName, out value); if (value.signalMode == "CW") { iqDataCW_Array(out iqDataArr); } else { iqData_Array(value.SG_IPath, value.SG_QPath, out iqDataArr); } var iqWaveform = ComplexWaveform <ComplexDouble> .FromArray1D(iqDataArr); iqWaveform.PrecisionTiming = PrecisionWaveformTiming.CreateWithRegularInterval(new PrecisionTimeSpan(1 / value.SG_IQRate)); #endregion //pass configuration to Contact global config pwrServoSite[i] = new PowerServoTest( VST[i], waveformName: strWaveformName, waveform: iqWaveform, centerFrequency: noiseConfig[i].TXFrequencyStart, powerLevel: noiseConfig[i].SGPowerLevel ); } return(pwrServoSite); }
public NoiseFloorTest[] BuildNFTest(string strWaveform, string strWaveformName, S_NoiseConfig[] noiseConfig) { var nfSite = new NoiseFloorTest[testSite]; for (int i = 0; i < testSite; i++) { #region decode and re-arrange multiple bandwidth (Ascending) int multiRBW_cnt = 0; int bw_cnt = 0; double[] multiRBW_Hz = new double[noiseConfig[i].Bandwidths.Length]; Array.Sort(noiseConfig[i].Bandwidths); foreach (double key in noiseConfig[i].Bandwidths) { multiRBW_Hz[bw_cnt] = Convert.ToDouble(key); bw_cnt++; } multiRBW_cnt = multiRBW_Hz.Length; noiseConfig[i].Rbw = multiRBW_Hz[multiRBW_cnt - 1]; //the largest RBW is the last in array #endregion #region Load waveform (CW or from file) ComplexDouble[] iqDataArr; s_SignalType value = new s_SignalType(); Get_s_SignalType(strWaveform, strWaveformName, out value); if (value.signalMode == "CW") { iqDataCW_Array(out iqDataArr); } else { iqData_Array(value.SG_IPath, value.SG_QPath, out iqDataArr); } var iqWaveform = ComplexWaveform <ComplexDouble> .FromArray1D(iqDataArr); iqWaveform.PrecisionTiming = PrecisionWaveformTiming.CreateWithRegularInterval(new PrecisionTimeSpan(1 / value.SG_IQRate)); #endregion //pass configuration to Contact global config nfSite[i] = new NoiseFloorTest( VST[i], waveformName: strWaveformName, waveform: iqWaveform, numberOfRuns: noiseConfig[i].NumberOfRuns, band: noiseConfig[i].Band, dwellTime: noiseConfig[i].DwellTime, soakTime: noiseConfig[i].SoakTime, soakFrequency: noiseConfig[i].TXFrequencyStart, preSoakSweep: noiseConfig[i].preSoakSweep, txStartFrequency: noiseConfig[i].TXFrequencyStart, txStopFrequency: noiseConfig[i].TXFrequencyStop, frequencyStep: noiseConfig[i].TXFrequencyStep, rxStartFrequency: noiseConfig[i].RXFrequencyStart, rxStopFrequency: noiseConfig[i].RXFrequencyStop, saReferenceLevel: noiseConfig[i].SAReferenceLevel, sgPowerLevel: noiseConfig[i].SGPowerLevel, vbw: noiseConfig[i].Vbw ); nfSite[i].bandwidths = multiRBW_Hz; } return(nfSite); }
public void ConfigureNR(ComplexWaveform <ComplexSingle> niFormattedData) { NR = instrSession.GetNRSignalConfiguration(); /* Create a new RFmx Session */ instrSession.ConfigureRFAttenuation("", RFmxInstrMXRFAttenuationAuto.True, 20); instrSession.ConfigureFrequencyReference("", RFmxInstrMXConstants.OnboardClock, 10e6); //instrSession.SetTriggerExportOutputTerminal("", ""); NR.ConfigureDigitalEdgeTrigger("", "PXI_Trig2", RFmxNRMXDigitalEdgeTriggerEdge.Rising, 0, true); NR.SelectMeasurements("", RFmxNRMXMeasurementTypes.ModAcc, true); NR.ModAcc.Configuration.SetMeasurementEnabled("", true); NR.ModAcc.Configuration.SetAveragingEnabled("", averagingEnabled); NR.ModAcc.Configuration.SetAveragingCount("", averagingCount); // NR.SetBand("", band); // Signal COnfiguration NR.SetLinkDirection("", lnkDirection); // Carrier Definition NR.ComponentCarrier.SetNumberOfComponentCarriers("", 1); #if false //*************************************************************** //-------------DEVELOPMENT OF MULTI_CARRIER---------------------- //*************************************************************** // 2-CC // Carrier Definition string[] arrCC = new string[2]; NR.ComponentCarrier.SetNumberOfComponentCarriers("", 2); for (int i = 0; i < arrCC.Length; i++) { arrCC[i] = RFmxNRMX.BuildCarrierString("", i); NR.ComponentCarrier.SetCellID(arrCC[i], cellID); NR.ComponentCarrier.SetBandwidth(arrCC[i], componentCarrierBandwidth); NR.ComponentCarrier.SetNumberOfBandwidthParts(arrCC[i], 1); NR.ComponentCarrier.SetBandwidthPartSubcarrierSpacing(arrCC[i], subcarrierSpacing); NR.SetAutoResourceBlockDetectionEnabled(arrCC[i], RFmxNRMXAutoResourceBlockDetectionEnabled.False); NR.ComponentCarrier.SetPuschResourceBlockOffset(arrCC[i], puschRBOffset); NR.ComponentCarrier.SetPuschNumberOfResourceBlocks(arrCC[i], puschNumberOfRBs); } //*************************************************************** #endif NR.ComponentCarrier.SetCellID("", cellID); NR.ComponentCarrier.SetBandwidth("", componentCarrierBandwidth); // BWP Setup NR.ComponentCarrier.SetNumberOfBandwidthParts("", 1); NR.ComponentCarrier.SetBandwidthPartSubcarrierSpacing("", subcarrierSpacing); NR.SetAutoResourceBlockDetectionEnabled("", RFmxNRMXAutoResourceBlockDetectionEnabled.False); NR.ComponentCarrier.SetPuschResourceBlockOffset("", puschRBOffset); NR.ComponentCarrier.SetPuschNumberOfResourceBlocks("", puschNumberOfRBs); // PUSCH Setup NR.ComponentCarrier.SetNumberOfPuschConfigurations("", 1); NR.ComponentCarrier.SetPuschSymbolAllocation("", puschSymbolAllocation); NR.ComponentCarrier.SetPuschSlotAllocation("", puschSlotAllocation); NR.ComponentCarrier.SetPuschNumberOfResourceBlockClusters("", puschNumberOfRBClusters); //int maxRBs = 0, offsetRBs = 0; //NR.ComponentCarrier.GetPuschResourceBlockOffset("", out offsetRBs); //NR.ComponentCarrier.GetPuschNumberOfResourceBlocks("", out maxRBs); // PUSCH Allocations //NR.ComponentCarrier.SetResourceBlockAlignmentMode("", RFmxNRMXResourceBlockAlignmentMode.Disabled); //for (int i = 0; i < NumberOfSubblocks; i++) //{ // subblockString = RFmxNRMX.BuildSubblockString("", 0); // carrierString = RFmxNRMX.BuildCarrierString(subblockString, 0); // puschClusterString = RFmxNRMX.BuildPuschClusterString(carrierString, i); // NR.ComponentCarrier.SetPuschResourceBlockOffset(puschClusterString, puschRBOffset); // NR.ComponentCarrier.SetPuschNumberOfResourceBlocks(puschClusterString, puschNumberOfRBs); //} NR.ComponentCarrier.SetPuschModulationType("", puschModulationType); NR.ComponentCarrier.SetPuschTransformPrecodingEnabled("", puschTransformPrecodingEnabled); // Missing DataScramblingIDMode Methods NR.ComponentCarrier.SetPuschDmrsScramblingIDMode("", RFmxNRMXPuschDmrsScramblingIDMode.CellID); NR.ComponentCarrier.SetPuschDmrsScramblingID("", 0); NR.ComponentCarrier.SetPuschMappingType("", puschDmrsMappingType); // PUSCH DM-RS NR.ComponentCarrier.SetPuschDmrsScramblingIDMode("", RFmxNRMXPuschDmrsScramblingIDMode.CellID); NR.ComponentCarrier.SetPuschDmrsScramblingID("", 0); // PUSCH---DMRS //I would like to add the following DMRS settings to the user configured EVM measurement: //DMRS Config type, //DMRS Mapping type, //DMRS Type A Position, //DMRS Duration, //DMRS Additional Positions, //Number of CDM Groups //*** DMRS Power only available if CP-OFDM NR.ComponentCarrier.SetPuschDmrsPowerMode("", puschDmrsPowerMode); if (puschDmrsPowerMode == RFmxNRMXPuschDmrsPowerMode.CdmGroups) { NR.ComponentCarrier.SetPuschDmrsPower("", 0); NR.ComponentCarrier.SetPuschDmrsConfigurationType("", RFmxNRMXPuschDmrsConfigurationType.Type1); } else { NR.ComponentCarrier.SetPuschDmrsPower("", puschDmrsPower); } if (puschTransformPrecodingEnabled == RFmxNRMXPuschTransformPrecodingEnabled.False) { NR.ComponentCarrier.SetPuschDmrsConfigurationType("", puschDmrsConfigurationType); } NR.ComponentCarrier.SetPuschDmrsDuration("", puschDmrsDuration); NR.ComponentCarrier.SetPuschDmrsTypeAPosition("", puschDmrsTypeAPosition); NR.ComponentCarrier.SetPuschDmrsAdditionalPositions("", puschDmrsAdditionalPositions); NR.ComponentCarrier.SetPuschMappingType("", puschDmrsMappingType); if (puschTransformPrecodingEnabled == RFmxNRMXPuschTransformPrecodingEnabled.True) { NR.ComponentCarrier.SetPuschDmrsNumberOfCdmGroups("", 2); } else { if (puschDmrsConfigurationType == RFmxNRMXPuschDmrsConfigurationType.Type1) { NR.ComponentCarrier.SetPuschDmrsNumberOfCdmGroups("", MathHelper.Clamp <int>(puschDmrsNumCdmGroups, 1, 2)); } else { NR.ComponentCarrier.SetPuschDmrsNumberOfCdmGroups("", MathHelper.Clamp <int>(puschDmrsNumCdmGroups, 1, 3)); } } // Why String??? NR.ComponentCarrier.SetPuschDmrsAntennaPorts("", 0.ToString()); if (puschTransformPrecodingEnabled == RFmxNRMXPuschTransformPrecodingEnabled.True) { NR.ComponentCarrier.SetPuschDmrsScramblingIDMode("", RFmxNRMXPuschDmrsScramblingIDMode.CellID); NR.ComponentCarrier.SetPuschDmrsScramblingID("", 0); NR.ComponentCarrier.SetPdschDmrsnScid("", 0); } NR.ComponentCarrier.SetPuschDmrsPuschIDMode("", RFmxNRMXPuschDmrsPuschIDMode.CellID); NR.ComponentCarrier.SetPuschDmrsPuschID("", 0); //NR.ModAcc.Configuration.SetFftWindowLength("", 10e-3); if (this.duplexScheme == frmRFmxSettings.RFmxDuplexMode.TDD) { NR.ModAcc.Configuration.SetMeasurementLengthUnit("", RFmxNRMXModAccMeasurementLengthUnit.Time); NR.ModAcc.Configuration.SetMeasurementOffset("", 0); NR.ModAcc.Configuration.SetMeasurementLength("", 1e-3); } else { NR.ModAcc.Configuration.SetMeasurementLengthUnit("", measurementLengthUnit); NR.ModAcc.Configuration.SetMeasurementOffset("", measurementOffset); NR.ModAcc.Configuration.SetMeasurementLength("", measurementLength); } NR.ModAcc.Configuration.SetEvmUnit("", evmUnit); //NR.ModAcc.Configuration.SetSynchronizationMode("", RFmxNRMXModAccSynchronizationMode.HalfSubframe); //NR.Initiate("", ""); NR.Commit(""); #region Run Analysis bool averagingDone; double recommendedPreTriggerTime; RFmxInstrMXRecommendedAcquisitionType recType; instrSession.GetRecommendedAcquisitionType("", out recType); double acquisitionTime; instrSession.GetRecommendedIQAcquisitionTime("", out acquisitionTime); int numberOfRecords; instrSession.GetRecommendedNumberOfRecords("", out numberOfRecords); //instrSession.GetRecommendedSpectralAcquisitionSpan("", out spectralAcquisitionSpan); double minimumSampleRate; instrSession.GetRecommendedIQMinimumSampleRate("", out minimumSampleRate); instrSession.GetRecommendedIQPreTriggerTime("", out recommendedPreTriggerTime); Console.WriteLine("Rec pre-trigger time = " + recommendedPreTriggerTime.ToString()); //ComplexWaveform<ComplexSingle> niFormattedData; //if (!RIFileType) // niFormattedData = ConvertIqDataToNiComplexFormat(traceData); //else // niFormattedData = RIData; #endregion Run Analysis ///AnalyzeIQ reset must be true for for last or single AnalyzeIQ call. ///Note: averaging in offline mode is done in MXA (IQ data in this module has been averaged). NR.AnalyzeIQ("", "", niFormattedData, true, out averagingDone); //int err = NR.Initiate("", ""); NR.WaitForMeasurementComplete("", 10); }
private void btnDemod_Click(object sender, EventArgs e) { Stopwatch sw = new Stopwatch(); sw.Start(); try { RFmxOBJ.InitializeVariables(); //Variables RFmxOBJ.componentCarrierBandwidth = Convert.ToDouble(this.numCarrierBW.Value) * 1e6; RFmxOBJ.cellID = 0; RFmxOBJ.duplexScheme = (RFmxDuplexMode)this.cboDuplex.SelectedItem; RFmxOBJ.lnkDirection = (RFmx.NRMX.RFmxNRMXLinkDirection) this.cboLinkDirection.SelectedItem; RFmxOBJ.subcarrierSpacing = Convert.ToDouble(this.numSubCarrierSpacing.Value) * 1e3; RFmxOBJ.band = 78; //Convert.ToInt32(this.numBand.Value); //RFmxOBJ.uplinkWaveformType = (RFmx.NRMX.RFmxNRMXUplinkWaveformType)this.cboUplinkType.SelectedItem; RFmxOBJ.puschTransformPrecodingEnabled = (((RFmxMultiplexing)this.cboMiltiplexingScheme.SelectedItem == RFmxMultiplexing.DFTSOFDM) ? RFmx.NRMX.RFmxNRMXPuschTransformPrecodingEnabled.True : RFmx.NRMX.RFmxNRMXPuschTransformPrecodingEnabled.False); RFmxOBJ.puschNumberOfRBClusters = 1; RFmxOBJ.puschRBOffset = (Int32)this.numRBOffset.Value; RFmxOBJ.puschNumberOfRBs = (Int32)this.numRBQty.Value; RFmxOBJ.puschModulationType = (RFmx.NRMX.RFmxNRMXPuschModulationType) this.cboPUSCHMod.SelectedItem; RFmxOBJ.puschSlotAllocation = "0-Last"; RFmxOBJ.puschSymbolAllocation = "0-Last"; RFmxOBJ.puschDmrsPowerMode = (RFmx.NRMX.RFmxNRMXPuschDmrsPowerMode) this.cboDmrsPowerMode.SelectedItem; RFmxOBJ.puschDmrsNumCdmGroups = (Int32)this.numCdmGroups.Value; RFmxOBJ.puschDmrsPower = (double)this.numDmrsPower.Value; RFmxOBJ.puschDmrsConfigurationType = (RFmx.NRMX.RFmxNRMXPuschDmrsConfigurationType) this.cboDmrsConfigType.SelectedItem; RFmxOBJ.puschDmrsMappingType = (RFmx.NRMX.RFmxNRMXPuschMappingType) this.cboDmrsMappingType.SelectedItem; RFmxOBJ.puschDmrsTypeAPosition = (Int32)this.numDmrsPosition.Value; RFmxOBJ.puschDmrsDuration = (RFmx.NRMX.RFmxNRMXPuschDmrsDuration) this.cboDmrsDuration.SelectedItem; RFmxOBJ.puschDmrsAdditionalPositions = (Int32)this.numDmrsAdditionalPosition.Value; RFmxOBJ.averagingEnabled = RFmx.NRMX.RFmxNRMXModAccAveragingEnabled.False; RFmxOBJ.averagingCount = 10; RFmxOBJ.measurementLengthUnit = (RFmx.NRMX.RFmxNRMXModAccMeasurementLengthUnit) this.cboMeasUnit.SelectedItem; RFmxOBJ.measurementOffset = Convert.ToInt32(this.numMeasOffset.Value); RFmxOBJ.measurementLength = Convert.ToInt32(this.numMeasLength.Value); RFmxOBJ.evmUnit = (RFmx.NRMX.RFmxNRMXModAccEvmUnit) this.cboEVMUnit.SelectedItem; RFmxOBJ.timeout = 10.0; // (s) //Instrument Open Session RFmxOBJ.InitializeInstr(); //Load Complex File RIWave = RFmxOBJ.ConvertComplexSingleToNiComplexWaveformFormat(RIData, (Convert.ToDouble(this.numSampleRate.Value) * 1e6)); RFmxOBJ.ConfigureNR(RIWave); RFmxOBJ.RetrieveResults(); MessageBox.Show("EVM = " + RFmxOBJ.meanRmsCompositeEvm); RFmxOBJ.PrintResults(); CreateDataSet(); if (chkConstellation.Checked == true) { ComplexSingle[] Cont = RFmxOBJ.dataConstellation; //WriteFile(Cont, "C:\\Users\\cdma_gsm\\Downloads\\RFmx2.5_Demod_DEV\\ConstellationFile_data.txt", FileMode.OpenOrCreate); ComplexSingle[] dmrsCont = RFmxOBJ.dmrsDataConstellation; double[] evmMax = RFmxOBJ.evmMaxPerSubcarrier.GetScaledData(); Console.WriteLine("EVM Max Subcarrier: " + evmMax.Max()); //WriteFile(dmrsCont, "C:\\Users\\cdma_gsm\\Downloads\\RFmx2.5_Demod_DEV\\ConstellationFile_dmrs.txt", FileMode.OpenOrCreate); //Plot Constellation Constellation frmChart = new Constellation(); actionDone = false; this.Refresh(); Parallel.Invoke(() => SpinProgressBar(), () => frmChart.LoadQAMChart(Cont, dmrsCont, RFmxOBJ.meanRmsCompositeEvm)); //frmChart.LoadQAMChart(Cont, dmrsCont); actionDone = false; this.Refresh(); Parallel.Invoke(() => SpinProgressBar(), () => frmChart.LoadSubCarrierChart(evmMax)); //frmChart.LoadSubCarrierChart(evmMax); frmChart.ShowDialog(); } } catch (Exception ex) { RFmxOBJ.DisplayError(ex); } finally { /* Close session */ RFmxOBJ.CloseSession(); } long testTime = sw.ElapsedMilliseconds; MessageBox.Show("TestTime: " + testTime.ToString() + " mS"); }