Exemplo n.º 1
0
        public static RfPulse MakeZeros(string pulseName, double pulseLength, double sampleRate)
        {
            RfPulse rfPulse = new RfPulse(pulseName);

            int totalSamples = Convert.ToInt32(sampleRate * pulseLength * Math.Pow(10, -6));

            double[] iData = new double[totalSamples];
            double[] qData = new double[totalSamples];

            rfPulse.PulseLength  = pulseLength;
            rfPulse.SampleRate   = sampleRate;
            rfPulse.TotalSamples = totalSamples;
            rfPulse.IData        = iData;
            rfPulse.QData        = qData;

            return(rfPulse);
        }
Exemplo n.º 2
0
        public static RfPulse MakePulse(string pulseName, double pulseLength, double sampleRate, double a0, double a1, double a2, double a3, double frequencyStepInHz, double phaseinRadians)
        {
            RfPulse rfPulse = new RfPulse(pulseName);

            int totalSamples = Convert.ToInt32(sampleRate * pulseLength * Math.Pow(10, -6));
            int totalCycles  = Convert.ToInt32(frequencyStepInHz * pulseLength * Math.Pow(10, -6));

            double[] iData = new double[totalSamples];
            double[] qData = new double[totalSamples];

            qData = ThreeColourSinePattern(totalSamples, a0, a1, a2, a3, phaseinRadians, totalCycles);
            iData = ThreeColourSinePattern(totalSamples, a0, a1, a2, a3, phaseinRadians + (Math.PI / 2), totalCycles);

            rfPulse.PulseLength  = pulseLength;
            rfPulse.SampleRate   = sampleRate;
            rfPulse.TotalSamples = totalSamples;
            rfPulse.IData        = iData;
            rfPulse.QData        = qData;

            return(rfPulse);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Frequency step should be integer multiple of 1/(pulse length).
        /// Amplitude range is from 0.9 to 1.1.
        /// Phase entered in radians.
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="pulseLength"></param>
        /// <param name="sampleRate"></param>
        /// <param name="amplitude"></param>
        /// <param name="frequencyStepInHz"></param>
        /// <param name="phaseInRadians"></param>
        public static RfPulse MakeTopHat(string pulseName, double pulseLength, double sampleRate, double amplitude, double frequencyStepInHz, double phaseInRadians)
        {
            RfPulse rfPulse = new RfPulse(pulseName);

            int    totalSamples    = Convert.ToInt32(sampleRate * pulseLength * Math.Pow(10, -6));
            int    totalCycles     = Convert.ToInt32(frequencyStepInHz * pulseLength * Math.Pow(10, -6));
            double scaledAmplitude = amplitude * 0.9;

            double[] iData = new double[totalSamples];
            double[] qData = new double[totalSamples];

            qData = SinePattern(totalSamples, scaledAmplitude, phaseInRadians, totalCycles);
            iData = SinePattern(totalSamples, scaledAmplitude, phaseInRadians + (Math.PI / 2), totalCycles);

            rfPulse.PulseLength  = pulseLength;
            rfPulse.SampleRate   = sampleRate;
            rfPulse.TotalSamples = totalSamples;
            rfPulse.IData        = iData;
            rfPulse.QData        = qData;

            return(rfPulse);
        }
Exemplo n.º 4
0
 public void DisplayRf2PulseData(RfPulse pulse)
 {
     SetTextBox(rf2PulseDurationTextBox, (pulse.PulseLength * Math.Pow(10, 6)).ToString());
     SetTextBox(rf2TotalSamplesTextBox, pulse.TotalSamples.ToString());
 }
Exemplo n.º 5
0
        private void rf2PulseComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            RfPulse pulse = ((KeyValuePair <object, RfPulse>)rf2PulseComboBox.SelectedItem).Value;

            DisplayRf2PulseData(pulse);
        }