amp = linspace(0,1,10) time = linspace(-1.4e-6, 6.4e-6, 10) plot([0.260e-6]*len(amp), amp, '--', lw = 1.5, color = 'grey') plot([0.520e-6]*len(amp), amp, '--', lw = 1.5, color = 'grey') plot([2e-6]*len(amp), amp, '--', lw = 1.5, color = 'grey') plot(time , [1.43]*len(time), '--', lw = 1.5, color = 'grey') grid(True, which = 'both') plot(tDDS, rDDS, lw = 1.5, color = 'grey', label = r"$C_{Reference} (t)\ (Trigger)$") plot(taom0, raom0, lw = 1.5, label = r"$C_{Optics}(t)$") #plot(tVCO, rVCO) #plot(taom1, raom1) ylim(0, 1.5) xlim(-1.4e-6, 6.4e-6) p.scale_xaxis(ax,1e6) xlabel(r"Time $\mu$s") ylabel(r"Amplitude relative to Set Value") yticks(arange(0.0,1.6,0.2), [r'0%', '20%', '40%', '60%', '80%', r'100%', '120%', '140%']) legend(loc = 4) #grid() tight_layout() savefig("Final_Step_Response_Optics.png") show() # <headingcell level=3> # II) Second Order System Parameters expected from Device Characteristics # <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 # <codecell> figure() subplot(121) p.grey_title("Data on Linear Scale") p.colorcycle(len_files) for i in arange(0, len_files): plot(x[i], y[i], label = str(i)) p.scale_xaxis(subplot(121),1e-6) xlabel(r'Frequency [MHz]') ylabel(r'Amplitude [dB]') subplot(122) p.grey_title("Data on Log Scale") p.colorcycle(len_files) for i in arange(0, len_files): plot(x[i]-center(x[i],y[i]), y[i], label = 'RBW='+str(RBW[i])) xscale("log") xlabel(r'Offset Frequency [Hz]') ylabel(r'Amplitude [dB]') leg = legend() leg.get_frame().set_alpha(0.35) tight_layout()