Comments. Bugfix in tools/config

This commit is contained in:
Anne de Jong 2018-10-16 14:14:13 +02:00 committed by J.A. de Jong - ASCEE
parent be3310285e
commit 133b04976e
2 changed files with 17 additions and 5 deletions

View File

@ -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)
f4sq = f4**2
def A_uncor(f):
"""
Computes the uncorrected frequency response of the A-filter
@ -39,14 +40,24 @@ def A_uncor(f):
return (num/(denom1*denom2))
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)
A1000 = A_uncor(1000.)
return Auncor/A1000
def C_uncor(f):
"""
Computes the uncorrected frequency response of the C-filter
@ -57,6 +68,7 @@ def C_uncor(f):
denom2 = (fsq+f4**2)
return num/(denom1*denom2)
def C(f):
"""
Computes the linear A-weighting freqency response

View File

@ -39,10 +39,10 @@ def init_matplotlib(report_quality=False):
def init_backend(report_quality=False):
global _init
if not _init:
_init = True
import matplotlib
matplotlib.use('Qt5Agg')
init_matplotlib(report_quality)
_init = True
import matplotlib.pyplot as plt
plt.ion()