Example #1
0
 def set_coefficients(self, c):
     if not c:
         c = [0.]
     self.c0 = c[0]
     c1p = c[1:]
     discrete_compensate(c1p)
     self.c[1:] = c1p
Example #2
0
 def set_coefficients(self, c):
     if not c:
         c = [0.]
     self.c0 = c[0]
     c1p = c[1:]
     discrete_compensate(c1p)
     self.c[1:] = c1p
Example #3
0
    def bias(self, amplitude=[], **kwargs):
        """Append a bias line to this segment.

        Amplitude in volts
        """
        coef = [self.out_scale * a for a in amplitude]
        discrete_compensate(coef)
        data = self.pack([0, 1, 2, 2], coef)
        self.line(typ=0, data=data, **kwargs)
Example #4
0
    def bias(self, amplitude=[], **kwargs):
        """Append a bias line to this segment.

        Amplitude in volts
        """
        coef = [self.out_scale*a for a in amplitude]
        discrete_compensate(coef)
        data = self.pack([0, 1, 2, 2], coef)
        self.line(typ=0, data=data, **kwargs)
Example #5
0
    def bias(self, amplitude=[], **kwargs):
        """Append a bias line to this segment.

        Args:
            amplitude (list[float]): Amplitude coefficients in in Volts and
                increasing powers of ``1/(2**shift*clock_period)``.
                Discrete time compensation will be applied.
            **kwargs: Passed to :meth:`line`.
        """
        coef = [self.out_scale * a for a in amplitude]
        discrete_compensate(coef)
        data = self.pack([0, 1, 2, 2], coef)
        self.line(typ=0, data=data, **kwargs)
Example #6
0
    def dds(self, amplitude=[], phase=[], **kwargs):
        """Append a dds line to this segment.

        Amplitude in volts,
        phase[0] in turns,
        phase[1] in turns*sample_rate,
        phase[2] in turns*(sample_rate/2**shift)**2
        """
        scale = self.out_scale / self.cordic_gain
        coef = [scale * a for a in amplitude]
        discrete_compensate(coef)
        if phase:
            assert len(amplitude) == 4
        coef += [p * self.max_val * 2 for p in phase]
        data = self.pack([0, 1, 2, 2, 0, 1, 1], coef)
        self.line(typ=1, data=data, **kwargs)
Example #7
0
    def dds(self, amplitude=[], phase=[], **kwargs):
        """Append a dds line to this segment.

        Amplitude in volts,
        phase[0] in turns,
        phase[1] in turns*sample_rate,
        phase[2] in turns*(sample_rate/2**shift)**2
        """
        scale = self.out_scale/self.cordic_gain
        coef = [scale*a for a in amplitude]
        discrete_compensate(coef)
        if phase:
            assert len(amplitude) == 4
        coef += [p*self.max_val*2 for p in phase]
        data = self.pack([0, 1, 2, 2, 0, 1, 1], coef)
        self.line(typ=1, data=data, **kwargs)
Example #8
0
    def dds(self, amplitude=[], phase=[], **kwargs):
        """Append a DDS line to this segment.

        Args:
            amplitude (list[float]): Amplitude coefficients in in Volts and
                increasing powers of ``1/(2**shift*clock_period)``.
                Discrete time compensation and CORDIC gain compensation
                will be applied by this method.
            phase (list[float]): Phase/frequency/chirp coefficients.
                ``phase[0]`` in ``turns``,
                ``phase[1]`` in ``turns/clock_period``,
                ``phase[2]`` in ``turns/(clock_period**2*2**shift)``.
            **kwargs: Passed to :meth:`line`.
        """
        scale = self.out_scale / self.cordic_gain
        coef = [scale * a for a in amplitude]
        discrete_compensate(coef)
        if phase:
            assert len(amplitude) == 4
        coef += [p * self.max_val * 2 for p in phase]
        data = self.pack([0, 1, 2, 2, 0, 1, 1], coef)
        self.line(typ=1, data=data, **kwargs)
Example #9
0
 def set_coefficients(self, c):
     if not c:
         c = [0.]
     self.c = copy(c)
     discrete_compensate(self.c)
Example #10
0
 def set_coefficients(self, c):
     if not c:
         c = [0.]
     self.c = copy(c)
     discrete_compensate(self.c)