Esempio n. 1
0
	def do_fft(self):
		if self.trace == None: return
		transform = []
		for xy in self.trace:
			fr,tr = eyemath.fft(xy[1], self.delay * self.NC * 0.001)
			transform.append([fr,tr])
		p.grace(transform, _('freq'), _('power'))
Esempio n. 2
0
def do_fft():
    global data, delay, NP
    if data == []: return
    fr, tr = eyemath.fft(data[0][1], delay * 0.001)
    p.save([[fr, tr]], 'FFT.dat')
    p.grace([[fr, tr]], _('freq'), _('power'))
    msgwin.config(text=_('Fourier transform Saved to FFT.dat.'))
Esempio n. 3
0
def do_fft():
	global data, delay, NP
	if data == [ [], [] ]: return
	fr,tr = eyemath.fft(data[1], delay * 0.001)
	p.save([ [fr,tr] ], 'FFT.dat')
	p.grace([ [fr,tr] ], _('freq'), _('power'))
	msgwin.config(text = _('Fourier transform Saved to FFT.dat.'))
Esempio n. 4
0
 def measure(self):
     """
     This is a custom method to connect to the
     button for measurements.
     There is no need for another custom method,
     since the method "close" is already inherited
     from the ancestor class.
     """
     sample=int(self.ui.samplesEdit.text())
     delay=int(self.ui.delayEdit.text())
     channel=self.inputCode()
     duration=int(sample*delay/1000) # in ms
     self.ui.statusbar.showMessage(
         "Measuring data for {} seconds, please be patient...".format(duration/1000),
         duration
     )
     self.ui.statusbar.repaint() # immediately shows the status
     t,v = self.p.capture(channel, sample, delay)
     self.signal.setData(t,v,len(t))
     # compute the FFT data and plot them
     xa,ya = eyemath.fft(v,delay)
     xa=1000*xa #(convert kHz to Hz)
     self.fft.setData(xa, ya, len(xa))
     # display the result
     self.ui.signalPlot.replot()
     self.ui.fftPlot.replot()
     return
Esempio n. 5
0
def do_fft():
    global data, delay, NP
    if data == []:
        return
    fr, tr = eyemath.fft(data[0][1], delay * 0.001)
    p.save([[fr, tr]], "FFT.dat")
    p.grace([[fr, tr]], _("freq"), _("power"))
    msgwin.config(text=_("Fourier transform Saved to FFT.dat."))
Esempio n. 6
0
def show_ftr(ch):
	fa = eyemath.fit_sine(chan4[ch][TDATA],chan4[ch][VDATA])	# get frequency to decide suitable 'dt'
	if fa != None:
		fr = fa[1][1]*1000			# frequency in Hz
		dt = int(1.e6/ (20 * fr))	# dt in usecs, 20 samples per cycle
		t,v = p.capture(chan4[ch][CHSRC], 1800, dt)
		xa,ya = eyemath.fft(v,dt)
		eyeplot.plot(xa*1000,ya, title = _('Fourier Transform,power spectrum'), xl = _('Freq'), yl = _('Amp'))
		msg(_('%s Fourier transform done, Data saved to "fft.dat"') %(channels[seltag]))
		p.save([[xa,ya]],'fft.dat')
Esempio n. 7
0
	def do_fft(self):
		global delay, NP, NC, EYEMATH
		if EYEMATH == False:
			showhelp(_('Could not find scipy package. Install it'),'red')
			return
		if self.trace == None: return
		transform = []
		for xy in self.trace:
			fr,tr = eyemath.fft(xy[1], delay * NC * 0.001)
			transform.append([fr,tr])
		self.eye.save(transform, 'exploreFFT.dat')
		self.eye.grace(transform, _('freq'), _('power'))
		showhelp(_('Fourier transform Saved to exploreFFT.dat.'))
Esempio n. 8
0
def show_ftr(ch):
    fa = eyemath.fit_sine(chan4[ch][TDATA],chan4[ch][VDATA])	# get frequency to decide suitable 'dt'
    if fa != None:
        fr = fa[1][1]*1000        # frequency in Hz
        dt = int(1.e6/ (20 * fr)) # dt in usecs, 20 samples per cycle
        t,v = p.capture(chan4[ch][CHSRC], 1800, dt)
        xa,ya = eyemath.fft(v,dt)
        eyeplot.plot(xa*1000,ya,
                     title = _('Fourier Transform,power spectrum'),
                     xl = _('Freq'), yl = _('Amp'))
        msg(_('%s Fourier transform done, Data saved to "fft.dat"')
            % (channels[seltag]))
        p.save([[xa,ya]],'fft.dat')
Esempio n. 9
0
 def do_fft(self):
     global delay, NP, NC, EYEMATH
     if EYEMATH == False:
         showhelp('Could not find scipy package. Install it', 'red')
         return
     if self.trace == None: return
     transform = []
     for xy in self.trace:
         fr, tr = eyemath.fft(xy[1], delay * NC * 0.001)
         transform.append([fr, tr])
     self.eye.save(transform, 'exploreFFT.dat')
     self.eye.grace(transform, 'freq', 'power')
     showhelp('Fourier transform Saved to exploreFFT.dat.')
Esempio n. 10
0
 def do_fft(self, filename='measureFFT.dat'):
     """
     opens xmgrage with current data in a FFT plot
     @param filename the name of the file
     """
     if EYEMATH == False:
         self.showhelp('Could not find scipy package. Install it', 'red')
         return
     if self.trace == None: return
     transform = []
     for xy in self.trace:
         fr, tr = eyemath.fft(xy[1], self.delay * self.nc * 0.001)
         transform.append([fr, tr])
     self.eye.save(transform, filename)
     self.eye.grace(transform, 'freq', 'power')
     self.showhelp('Fourier transform Saved to %s' % filename)
Esempio n. 11
0
 def do_fft(self, filename="measureFFT.dat"):
     """
     opens xmgrage with current data in a FFT plot
     @param filename the name of the file
     """
     if EYEMATH == False:
         self.showhelp("Could not find scipy package. Install it", "red")
         return
     if self.trace == None:
         return
     transform = []
     for xy in self.trace:
         fr, tr = eyemath.fft(xy[1], self.delay * self.nc * 0.001)
         transform.append([fr, tr])
     self.eye.save(transform, filename)
     self.eye.grace(transform, "freq", "power")
     self.showhelp("Fourier transform Saved to %s" % filename)