Comments. Bugfix in tools/config
This commit is contained in:
parent
be3310285e
commit
133b04976e
@ -28,6 +28,7 @@ f1 = np.sqrt((-b-np.sqrt(b**2-4*c))/2)
|
|||||||
f4 = np.sqrt((-b+np.sqrt(b**2-4*c))/2)
|
f4 = np.sqrt((-b+np.sqrt(b**2-4*c))/2)
|
||||||
f4sq = f4**2
|
f4sq = f4**2
|
||||||
|
|
||||||
|
|
||||||
def A_uncor(f):
|
def A_uncor(f):
|
||||||
"""
|
"""
|
||||||
Computes the uncorrected frequency response of the A-filter
|
Computes the uncorrected frequency response of the A-filter
|
||||||
@ -39,14 +40,24 @@ def A_uncor(f):
|
|||||||
|
|
||||||
return (num/(denom1*denom2))
|
return (num/(denom1*denom2))
|
||||||
|
|
||||||
|
|
||||||
def A(f):
|
def A(f):
|
||||||
"""
|
"""
|
||||||
Computes the linear A-weighting freqency response
|
Computes the linear A-weighting freqency response. Hence, to obtain
|
||||||
|
A-weighted values, the *amplitude* need to be multiplied with this value.
|
||||||
|
Hence, to correct dB levels, the value of 20*log(A) needs to be added to
|
||||||
|
the level
|
||||||
|
|
||||||
|
Args:
|
||||||
|
f: Frequency array to compute values for
|
||||||
|
Returns:
|
||||||
|
A(f) for each frequency
|
||||||
"""
|
"""
|
||||||
Auncor = A_uncor(f)
|
Auncor = A_uncor(f)
|
||||||
A1000 = A_uncor(1000.)
|
A1000 = A_uncor(1000.)
|
||||||
return Auncor/A1000
|
return Auncor/A1000
|
||||||
|
|
||||||
|
|
||||||
def C_uncor(f):
|
def C_uncor(f):
|
||||||
"""
|
"""
|
||||||
Computes the uncorrected frequency response of the C-filter
|
Computes the uncorrected frequency response of the C-filter
|
||||||
@ -57,6 +68,7 @@ def C_uncor(f):
|
|||||||
denom2 = (fsq+f4**2)
|
denom2 = (fsq+f4**2)
|
||||||
return num/(denom1*denom2)
|
return num/(denom1*denom2)
|
||||||
|
|
||||||
|
|
||||||
def C(f):
|
def C(f):
|
||||||
"""
|
"""
|
||||||
Computes the linear A-weighting freqency response
|
Computes the linear A-weighting freqency response
|
||||||
|
@ -39,10 +39,10 @@ def init_matplotlib(report_quality=False):
|
|||||||
def init_backend(report_quality=False):
|
def init_backend(report_quality=False):
|
||||||
global _init
|
global _init
|
||||||
if not _init:
|
if not _init:
|
||||||
_init = True
|
|
||||||
import matplotlib
|
import matplotlib
|
||||||
matplotlib.use('Qt5Agg')
|
matplotlib.use('Qt5Agg')
|
||||||
init_matplotlib(report_quality)
|
init_matplotlib(report_quality)
|
||||||
|
_init = True
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
plt.ion()
|
plt.ion()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user