예제 #1
0
if __name__ == '__main__':
    print JitterInjection.__doc__
    test = JitterInjection()
    frequencies = numpy.arange(90e6,3e9,50e6)
    (rmsJitters,backgroundJitter,transmittedPowers) = test.frequencySweep(frequencies,Power(.01,'W'))
    
    pyplot.plot(frequencies,rmsJitters*1e12,label='RMS Jitter')
#    pyplot.plot(frequencies,peakToPeakJitters,label='Peak to peak Jitter')
    pyplot.plot([frequencies[0],frequencies[-1]],[backgroundJitter*1e12,backgroundJitter*1e12],label='Background RMS jitter')
    
#    pyplot.title('Prana at 900 MHz with 20 dB attenuator (spectrum analyser)')
    pyplot.xlabel('Perturbation frequency (Hz)')
    pyplot.ylabel('Jitter (ps)')
    pyplot.legend()
    pyplot.show()
    
    pyplot.plot(frequencies,transmittedPowers)
    pyplot.xlabel('Frequency (Hz)')
    pyplot.ylabel('Transmitted power (W)')    
    pyplot.show()
    
    from utility.metaarray import MetaArray,axis
    resultArray = MetaArray((len(frequencies),2), info=[
                    axis('Frequency', values=frequencies, units='Hz',title='Time'), 
                    axis('Measurement', cols=[('j', 'ps', 'RMS jitter'),('P_trans', 'W', 'Transmitted power')])
                    ])

    resultArray['Measurement':'j'] = rmsJitters
    resultArray['Measurement':'P_trans'] = transmittedPowers
    resultArray.writeToExcel('Y:/emctestbench/results/jitter/jitterC1.xls')
예제 #2
0
#		capture range chip 2 (type 6) 17.8 26.5
#		for inputFrequency in numpy.arange(16.5e6,24.9e6,.1e6):	  
	startTime = time.time()	  
	for inputFrequency in inputFrequencies:
		generator.setWaveform(inputFrequency, 2.5,2.5,'SQU')
		time.sleep(.4) # .3 should be safe
		phaseShift,frequency = experiment.measurePhaseAndFrequency()
		sweepResults = numpy.append(sweepResults,[phaseShift],axis=1)
	print 'Sweep took %f s' % (startTime-time.time())
	
	unwrappedResults = numpy.unwrap(sweepResults)
	halfwayAngle = unwrappedResults[len(unwrappedResults)/2]
	correction = (numpy.trunc(halfwayAngle / (2*numpy.pi)) +1)*-2*numpy.pi
	unwrappedResults = unwrappedResults + correction


	results['experiment':experimentName] = numpy.rad2deg(unwrappedResults)
		
	pyplot.plot(inputFrequencies,numpy.rad2deg(unwrappedResults),'.-',label=experimentName)
	
	results.writeToExcel('../../results/pllSweepResults.xls')
	results.write('../../results/pllSweepResults.ma')
	



pyplot.xlabel('PLL input frequency (Hz)')
pyplot.ylabel('phi_out - phi_in (degrees)')
pyplot.legend()
pyplot.show()