LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches
lasp.lasp_slm.SLM Class Reference

Multi-channel Sound Level Meter. More...

Public Member Functions

 __init__ (self, fs, fbdesigner=None, TimeWeighting tw=TimeWeighting.fast, FreqWeighting fw=FreqWeighting.A, xmin=None, xmax=None, include_overall=True, level_ref_value=P_REF, offset_t=0)
 Initialize a sound level meter object.
 
 run (self, data)
 Add new fresh timedata to the Sound Level Meter.
 
 return_as_dict (self, dat)
 Helper function used to return resulting data in a proper way.
 
 Leq (self)
 Returns the computed equivalent levels for each filter channel.
 
 Lmax (self)
 Returns the computed max levels for each filter channel.
 
 Lpeak (self)
 Returns the computed peak levels for each filter channel.
 
 Leq_array (self)
 
 Lmax_array (self)
 
 Lpeak_array (self)
 

Public Attributes

 fbdesigner
 
 xs
 
 include_overall
 
 offset_t
 
 nom_txt
 
 slm
 
 fs_slm
 
 N
 

Detailed Description

Multi-channel Sound Level Meter.

Input data: time data with a certain sampling frequency. Output: time-weighted (fast/slow) sound pressure levels in dB(A/C/Z). Possibly in octave bands.

Definition at line 25 of file lasp_slm.py.

Constructor & Destructor Documentation

◆ __init__()

lasp.lasp_slm.SLM.__init__ (   self,
  fs,
  fbdesigner = None,
TimeWeighting   tw = TimeWeighting.fast,
FreqWeighting   fw = FreqWeighting.A,
  xmin = None,
  xmax = None,
  include_overall = True,
  level_ref_value = P_REF,
  offset_t = 0 
)

Initialize a sound level meter object.

Args: fs: Sampling frequency of input data [Hz] fbdesigner: FilterBankDesigner to use for creating the (fractional) octave bank filters. Set this one to None to only do overalls fs: Sampling frequency [Hz] tw: Time Weighting to apply fw: Frequency weighting to apply xmin: Filter designator of lowest band. xmax: Filter designator of highest band include_overall: If true, a non-functioning filter is added which is used to compute the overall level. level_ref_value: Reference value for computing the levels in dB offset_t: Offset to be added to output time data [s]

Definition at line 32 of file lasp_slm.py.

Member Function Documentation

◆ Leq()

lasp.lasp_slm.SLM.Leq (   self)

Returns the computed equivalent levels for each filter channel.

Definition at line 202 of file lasp_slm.py.

◆ Leq_array()

lasp.lasp_slm.SLM.Leq_array (   self)

Definition at line 220 of file lasp_slm.py.

◆ Lmax()

lasp.lasp_slm.SLM.Lmax (   self)

Returns the computed max levels for each filter channel.

Definition at line 208 of file lasp_slm.py.

◆ Lmax_array()

lasp.lasp_slm.SLM.Lmax_array (   self)

Definition at line 223 of file lasp_slm.py.

◆ Lpeak()

lasp.lasp_slm.SLM.Lpeak (   self)

Returns the computed peak levels for each filter channel.

Definition at line 214 of file lasp_slm.py.

◆ Lpeak_array()

lasp.lasp_slm.SLM.Lpeak_array (   self)

Definition at line 226 of file lasp_slm.py.

◆ return_as_dict()

lasp.lasp_slm.SLM.return_as_dict (   self,
  dat 
)

Helper function used to return resulting data in a proper way.

Returns a dictionary with the following keys: 'data': The y-values of Lmax, Lpeak, etc 'overall': The overall value, in [dB] COULD BE NOT PART OF OUTPUT 'x': The exponents of the octave, such that the midband frequency corresponds to 1000*G**(x/b), where b is the bands, either 1, 3, or 6 'mid': The center frequencies of each band, as a numpy float array 'nom': The nominal frequency array text, as textual output corresponding to the frequencies in x, they are '16', .. up to '16k'

Definition at line 172 of file lasp_slm.py.

◆ run()

lasp.lasp_slm.SLM.run (   self,
  data 
)

Add new fresh timedata to the Sound Level Meter.

Args: data: one-dimensional input data

Definition at line 141 of file lasp_slm.py.

Member Data Documentation

◆ fbdesigner

lasp.lasp_slm.SLM.fbdesigner

Definition at line 61 of file lasp_slm.py.

◆ fs_slm

lasp.lasp_slm.SLM.fs_slm

Definition at line 136 of file lasp_slm.py.

◆ include_overall

lasp.lasp_slm.SLM.include_overall

Definition at line 77 of file lasp_slm.py.

◆ N

lasp.lasp_slm.SLM.N

Definition at line 139 of file lasp_slm.py.

◆ nom_txt

lasp.lasp_slm.SLM.nom_txt

Definition at line 91 of file lasp_slm.py.

◆ offset_t

lasp.lasp_slm.SLM.offset_t

Definition at line 78 of file lasp_slm.py.

◆ slm

lasp.lasp_slm.SLM.slm

Definition at line 128 of file lasp_slm.py.

◆ xs

lasp.lasp_slm.SLM.xs

Definition at line 72 of file lasp_slm.py.


The documentation for this class was generated from the following file: