Skip to content

Commit

Permalink
Added companion functions for noise lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
dreoilin committed Jan 13, 2024
1 parent 53b7f4e commit ebc298d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
37 changes: 36 additions & 1 deletion src/pygmid/Lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from scipy.interpolate import interpn
import pickle

from .constants import eps
from .constants import *
from .numerical import interp1

class Lookup:
Expand Down Expand Up @@ -378,3 +378,38 @@ def look_upVGS(self, **kwargs):
output = output[:]

return np.squeeze(output)

def gamma(self, **kwargs):
"""
Companion gamma function. Computes gamma from:
STH/gm * 1/(4kT)
where STH is thermal noise psd at 1 Hz
Args:
**kwargs: lookup parameters, GM_ID, length, VDS etc...
Output:
output: interpolated data specified by outkeys. Squeezed to remove extra
dimensions
"""

# should provide a GMID, VDS and L
return self.look_up('STH_GM', **kwargs)/(4*kB*self['TEMP'].item())

def fco(self, **kwargs):
"""
Companion flicker corner function. Computes flicker corner from:
SFL/STH
where STH is thermal noise psd at 1 Hz
and SFL is flicker noise psd at 1 Hz
Args:
**kwargs: lookup parameters, GM_ID, length, VDS etc...
Output:
output: interpolated data specified by outkeys. Squeezed to remove extra
dimensions
"""
return self.look_up('SFL_STH', **kwargs)
4 changes: 3 additions & 1 deletion src/pygmid/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import numpy as np
from scipy.constants import k

eps = np.finfo(float).eps
eps = np.finfo(float).eps
kB = k
6 changes: 1 addition & 5 deletions tests/debug/debug_lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,4 @@
# %%
# test for utility function
gm_ID = NCH.look_up('GM_ID', VDS=np.arange(0.025, 1.2+0.025, 0.025), VSB=0.0, L=0.18)
print(gm_ID)

# %%
gmID = NCH.look_up('GM_ID',vgs=VGSs,vds=VDsat,L=L)
JDsat = NCH.look_up('ID_W',GM_ID=np.linspace(2,25))
print(gm_ID)

0 comments on commit ebc298d

Please sign in to comment.