Ejemplo n.º 1
0
    def delete_wave(self, amp, freqs, phase):
        if type(freqs) != type(self.wavefreqs):
            wave = Wave(amplitude=amp,
                        frequency=freqs,
                        phase=phase,
                        stop=self.meas_time,
                        sampling_frequency=self.sampfreq)
            self.wave_array = np.subtract(self.wave_array, wave.get_wave())
            self.wavefreqs.remove(freqs)

        if type(freqs) == type(self.wavefreqs):
            for freq in freqs:
                wave = Wave(amplitude=amp,
                            frequency=freq,
                            phase=phase,
                            stop=self.meas_time,
                            sampling_frequency=self.sampfreq)
                self.wave_array = np.subtract(self.wave_array, wave.get_wave())
                self.wavefreqs.remove(freq)
Ejemplo n.º 2
0
 def add_wave(self, amp, central_frequency, phase):
     wave = Wave(amp,
                 central_frequency,
                 phase,
                 stop=self.meas_time,
                 sampling_frequency=self.sampfreq)
     self.wavefreqs.append(central_frequency)
     param_array = np.array([amp, central_frequency, phase, -1, -1])
     self.wave_array = np.sum([self.wave_array, wave.get_wave()], axis=0)
     del wave
Ejemplo n.º 3
0
    def add_spread_wave(self, amp, central_frequency, phase, freqspread,
                        bunchsize):
        param_array = np.array(
            [amp, central_frequency, phase, freqspread, bunchsize])
        freqs = np.random.normal(
            central_frequency, freqspread,
            size=bunchsize)  #frequency Gaussian distribution

        for freq in freqs:
            wave = Wave(amplitude=amp,
                        frequency=freq,
                        phase=phase,
                        stop=self.meas_time,
                        sampling_frequency=self.sampfreq)
            self.wavefreqs.append(freq)
            self.wave_array = np.sum(
                [self.wave_array, wave.get_wave()], axis=0)
        del wave