Posts

Showing posts with the label leeson

Python Script that Tells You the RMS Cycle-to-Cycle Jitter of Your Oscillator

Image
$ python3 script.py phas_noi_export.csv f_center [f_lower or 0] [f_higher] # if specify only f_higher, then use 0 for arg2 import numpy as np import pandas as pd import sys def read_phase_noise_file ( filename ):     with open ( filename , 'r' ) as f :         first_line = f . readline ()     try :         float ( first_line . split ( ',' )[ 0 ])         df = pd . read_csv ( filename , header = None )     except ValueError :         df = pd . read_csv ( filename )     freq = df . iloc [:, 0 ]. values     L_dbc_per_hz = df . iloc [:, 1 ]. values     return freq , L_dbc_per_hz def calc_cycle_to_cycle_jitter ( freq , L_dbc_per_hz , f0 , f_min = None , f_max = None ):     # Apply frequency limits     mask = np .ones_like( freq , dtype = bool )     if f_min is not None :       ...