# Joined Function and RBW Value Readout # <headingcell level=2> # Load Traces into Arrays, Plot and Read out the Resolution Bandwidth RBW # <codecell> my_name = 'Joined_Function.csv' import numpy as np # numpy for array handling and numeric calculations import panna as p # panna will search for all csv files and read them into one data array from pylab import * data = p.load_all() len_files = p.number_of_files() RBW = p.load_RBW() # <codecell> x, y = [0]*len_files, [0]*len_files for i in arange(0,len_files): x[i], y[i] = array(data[i][:,0]), array(data[i][:,1]) # <codecell> def center(x_values, y_values): y_values = list(y_values) maximum_index = y_values.index(max(y_values)) centerfreq = x_values[maximum_index] return centerfreq
amplifier = 40.0 # index of the data file that contains the system floor (read off from output from last cell) ifloor = 1 # index of the data file that contains the phase noise measurement (read off from output from last cell) iphase = 0 # <codecell> ### Calculation of Phase Noise Spectrum after substracting the floor, amplifier, K_phi y_res = 10*log10(abs(10**(array(p.y[iphase])/10.) - 10**(array(p.y[ifloor])/10.))) - 20*log10(K_phi)-amplifier y_res_lin = 10**(y_res/10.) x_res = p.x[iphase] # <codecell> n = p.number_of_files() # integration limits: see footnote in text xmin = 1.2 # Hz xmax = 1e6 # Hz x, y, y_lin, start, stop, phi = [0]*n,[0]*n,[0]*n,[0]*n,[0]*n,[0]*n # <codecell> ########## Step 1: plot all found input data ############ figure(1) p.colorcycle(n+1) for i in arange(0,n): plot(p.x[i], p.y[i], label = str(i))