public void PaprCalcAgreesWithCalculated()
 {
     LoopFiles((fileName, waveform, filePath, fileConfig) =>
     {
         System.IntPtr rfsgHandle = sim.GetInstrumentHandle().DangerousGetHandle();
         NIRfsgPlayback.DownloadUserWaveform(rfsgHandle, waveform.Name,
                                             waveform.Data, true);
         NIRfsgPlayback.RetrieveWaveformPapr(rfsgHandle,
                                             waveform.Name, out double calcPapr);
         waveform.PAPR_dB.Should().BeApproximately(calcPapr, 0.1,
                                                   $"of loading file \"{fileName}\"");
     });
 }
        public static Waveform GetWaveformParametersByName(NIRfsg rfsgHandle, string waveformName)
        {
            IntPtr rfsgPtr = rfsgHandle.GetInstrumentHandle().DangerousGetHandle();

            Waveform waveform = new Waveform
            {
                WaveformName = waveformName
            };

            NIRfsgPlayback.RetrieveWaveformSignalBandwidth(rfsgPtr, waveformName, out waveform.SignalBandwidth_Hz);
            NIRfsgPlayback.RetrieveWaveformPapr(rfsgPtr, waveformName, out waveform.PAPR_dB);
            NIRfsgPlayback.RetrieveWaveformSampleRate(rfsgPtr, waveformName, out waveform.SampleRate);
            NIRfsgPlayback.RetrieveWaveformBurstStartLocations(rfsgPtr, waveformName, ref waveform.BurstStartLocations);
            NIRfsgPlayback.RetrieveWaveformBurstStopLocations(rfsgPtr, waveformName, ref waveform.BurstStopLocations);

            waveform.BurstLength_s = CalculateWaveformDuration(waveform.BurstStartLocations, waveform.BurstStopLocations, waveform.SampleRate);

            return(waveform);
        }