AcousticMetrics.AbstractNarrowbandSpectrum
— TypeAbstractNarrowbandSpectrum{IsEven,IsTonal,Tel} <: AbstractVector{Tel}
Supertype for a generic narrowband acoustic metric which will behave as an immutable AbstractVector
of element type Tel
.
The IsEven
parameter is a Bool
indicating if the length of the spectrum is even or not, affecting how the Nyquist frequency is calculated. IsTonal
indicates how the acoustic energy is distributed through the frequency bands:
IsTonal == false
means the acoustic energy is assumed to be evenly distributed thoughout each bandIsTonal == true
means the acoustic energy is assumed to be concentrated at each band center
AcousticMetrics.AbstractPressureTimeHistory
— TypeAbstractPressureTimeHistory{IsEven}
Supertype for a pressure time history, i.e., pressure as a function of time defined on evenly-spaced time samples.
The IsEven
parameter is a Bool
indicating if the length of the pressure time history is even or not.
AcousticMetrics.AbstractProportionalBandSpectrum
— TypeAbstractProportionalBandSpectrum{NO,TF} <: AbstractVector{TF}
Abstract type representing a proportional band spectrum with band fraction NO
and eltype
TF
.
AcousticMetrics.AbstractProportionalBands
— TypeAbstractProportionalBands{NO,LCU,TF} <: AbstractVector{TF}
Abstract type representing the exact proportional frequency bands with band fraction NO
and eltype
TF
.
The LCU
parameter can take one of three values:
:lower
: Thestruct
returns the lower edges of each frequency band.:center
: Thestruct
returns the center of each frequency band.:upper
: Thestruct
returns the upper edges of each frequency band.
AcousticMetrics.ApproximateOctaveBands
— TypeApproximateOctaveBands{LCU,TF} <: AbstractProportionalBands{1,LCU,TF}
Representation of the approximate octave proportional frequency bands with eltype
TF
.
The LCU
parameter can take one of three values:
:lower
: Thestruct
returns the lower edges of each frequency band.:center
: Thestruct
returns the center of each frequency band.:upper
: Thestruct
returns the upper edges of each frequency band.
AcousticMetrics.ApproximateOctaveBands
— MethodApproximateOctaveBands{LCU,TF}(bstart::Int, bend::Int)
Construct an ApproximateOctaveBands
with eltype
TF
encomposing band index numbers from bstart
to bend
.
The "standard" band frequencies will be scaled by scaler
, e.g. if scaler = 0.5
then what would normally be the 1000 Hz
frequency will be 500 Hz
, etc..
AcousticMetrics.ApproximateOctaveBands
— MethodApproximateOctaveBands{LCU}(fstart::TF, fend::TF, scaler=1)
Construct an ApproximateOctaveBands
with eltype
TF
, scaled by scaler
, encomposing the bands needed to completely extend over minimum frequency fstart
and maximum frequency fend
.
AcousticMetrics.ApproximateOctaveCenterBands
— TypeApproximateOctaveCenterBands{TF}
Alias for ApproximateOctaveBands{:center,TF}
AcousticMetrics.ApproximateOctaveLowerBands
— TypeApproximateOctaveLowerBands{TF}
Alias for ApproximateOctaveBands{:lower,TF}
AcousticMetrics.ApproximateOctaveUpperBands
— TypeApproximateOctaveUpperBands{TF}
Alias for ApproximateOctaveBands{:upper,TF}
AcousticMetrics.ApproximateThirdOctaveBands
— TypeApproximateThirdOctaveBands{LCU,TF} <: AbstractProportionalBands{3,LCU,TF}
Representation of the approximate third-octave proportional frequency bands with eltype
TF
.
The LCU
parameter can take one of three values:
:lower
: Thestruct
returns the lower edges of each frequency band.:center
: Thestruct
returns the center of each frequency band.:upper
: Thestruct
returns the upper edges of each frequency band.
AcousticMetrics.ApproximateThirdOctaveBands
— MethodApproximateThirdOctaveBands{LCU}(TF=Float64, bstart::Int, bend::Int, scaler=1)
Construct an ApproximateThirdOctaveBands
with eltype
TF
encomposing band index numbers from bstart
to bend
.
The "standard" band frequencies will be scaled by scaler
, e.g. if scaler = 0.5
then what would normally be the 1000 Hz
frequency will be 500 Hz
, etc..
AcousticMetrics.ApproximateThirdOctaveBands
— MethodApproximateThirdOctaveBands{LCU}(fstart::TF, fend::TF, scaler=1)
Construct an ApproximateThirdOctaveBands
with eltype
TF
, scaled by scaler
, encomposing the bands needed to completely extend over minimum frequency fstart
and maximum frequency fend
.
AcousticMetrics.ApproximateThirdOctaveCenterBands
— TypeApproximateThirdOctaveCenterBands{TF}
Alias for ApproximateThirdOctaveBands{:center,TF}
AcousticMetrics.ApproximateThirdOctaveLowerBands
— TypeApproximateThirdOctaveLowerBands{TF}
Alias for ApproximateThirdOctaveBands{:lower,TF}
AcousticMetrics.ApproximateThirdOctaveUpperBands
— TypeApproximateThirdOctaveUpperBands{TF}
Alias for ApproximateThirdOctaveBands{:upper,TF}
AcousticMetrics.ExactOctaveCenterBands
— TypeExactOctaveCenterBands{TF}
Alias for ExactProportionalBands{1,:center,TF}
AcousticMetrics.ExactOctaveLowerBands
— TypeExactOctaveLowerBands{TF}
Alias for ExactProportionalBands{1,:lower,TF}
AcousticMetrics.ExactOctaveUpperBands
— TypeExactOctaveUpperBands{TF}
Alias for ExactProportionalBands{1,:upper,TF}
AcousticMetrics.ExactProportionalBands
— TypeExactProportionalBands{NO,LCU,TF} <: AbstractProportionalBands{NO,LCU,TF}
Representation of the exact proportional frequency bands with band fraction NO
and eltype
TF
.
The LCU
parameter can take one of three values:
:lower
: Thestruct
returns the lower edges of each frequency band.:center
: Thestruct
returns the center of each frequency band.:upper
: Thestruct
returns the upper edges of each frequency band.
AcousticMetrics.ExactProportionalBands
— MethodExactProportionalBands{NO,LCU}(TF=Float64, bstart::Int, bend::Int, scaler=1)
Construct an ExactProportionalBands
with eltype
TF
encomposing band index numbers from bstart
to bend
.
The "standard" band frequencies will be scaled by scaler
, e.g. if scaler = 0.5
then what would normally be the 1000 Hz
frequency will be 500 Hz
, etc..
AcousticMetrics.ExactProportionalBands
— MethodExactProportionalBands{NO,LCU}(fstart::TF, fend::TF, scaler)
Construct an ExactProportionalBands
with eltype
TF
, scaled by scaler
, encomposing the bands needed to completely extend over minimum frequency fstart
and maximum frequency fend
.
AcousticMetrics.ExactThirdOctaveCenterBands
— TypeExactThirdOctaveCenterBands{TF}
Alias for ExactProportionalBands{3,:center,TF}
AcousticMetrics.ExactThirdOctaveLowerBands
— TypeExactThirdOctaveLowerBands{TF}
Alias for ExactProportionalBands{3,:lower,TF}
AcousticMetrics.ExactThirdOctaveUpperBands
— TypeExactThirdOctaveUpperBands{TF}
Alias for ExactProportionalBands{3,:upper,TF}
AcousticMetrics.LazyNBProportionalBandSpectrum
— TypeLazyNBProportionalBandSpectrum{NO,IsTonal,TF,TAmp,TBandsC}
Lazy representation of a proportional band spectrum with octave fraction NO
and eltype
TF
constructed from a narrowband (NB
) spectrum.
IsTonal
indicates how the acoustic energy is distributed through the narrow frequency bands:
IsTonal == false
means the acoustic energy is assumed to be evenly distributed thoughout each bandIsTonal == true
means the acoustic energy is assumed to be concentrated at each band center
AcousticMetrics.LazyNBProportionalBandSpectrum
— MethodLazyNBProportionalBandSpectrum(sm::AbstractNarrowbandSpectrum, cbands::AbstractProportionalBands{NO,:center})
Construct a LazyNBProportionalBandSpectrum
using proportional centerbands cbands
and narrowband spectrum sm
. The proportional band frequencies will be scaled by scaler
.
AcousticMetrics.LazyNBProportionalBandSpectrum
— MethodLazyNBProportionalBandSpectrum(TBands::Type{<:AbstractProportionalBands}, sm::AbstractNarrowbandSpectrum, scaler=1)
Construct a LazyNBProportionalBandSpectrum
using a proportional band TBands
and narrowband spectrum sm
, and optional frequency scaler scaler
. The proportional band frequencies will be scaled by scaler
.
AcousticMetrics.LazyNBProportionalBandSpectrum
— MethodLazyNBProportionalBandSpectrum{NO,IsTonal}(f1_nb, df_nb, msp_amp, cbands::AbstractProportionalBands{NO,:center})
Construct a lazy representation of a proportional band spectrum with proportional center bands cbands
from a narrowband spectrum.
The narrowband frequencies are defined by the first narrowband frequency f1_nb
and the narrowband frequency spacing df_nb
. msp_amp
is the spectrum of narrowband mean squared pressure amplitude.
IsTonal
indicates how the acoustic energy is distributed through the narrow frequency bands:
IsTonal == false
means the acoustic energy is assumed to be evenly distributed thoughout each bandIsTonal == true
means the acoustic energy is assumed to be concentrated at each band center
AcousticMetrics.LazyNBProportionalBandSpectrum
— MethodLazyNBProportionalBandSpectrum(f1_nb, df_nb, msp_amp, cbands::AbstractProportionalBands{NO,:center}, istonal=false)
Construct a lazy representation of a proportional band spectrum with proportional center bands cbands
from a narrowband spectrum.
The narrowband frequencies are defined by the first narrowband frequency f1_nb
and the narrowband frequency spacing df_nb
. msp_amp
is the spectrum of narrowband mean squared pressure amplitude.
istonal
indicates how the acoustic energy is distributed through the narrow frequency bands:
istonal == false
means the acoustic energy is assumed to be evenly distributed thoughout each bandistonal == true
means the acoustic energy is assumed to be concentrated at each band center
AcousticMetrics.LazyNBProportionalBandSpectrum
— MethodLazyNBProportionalBandSpectrum(TBands::Type{<:AbstractProportionalBands}, f1_nb, df_nb, msp_amp, scaler=1, istonal::Bool=false)
Construct a LazyNBProportionalBandSpectrum
using proportional bands TBands
and narrowband mean squared pressure amplitude vector msp_amp
and optional proportional band frequency scaler scaler
.
f1_nb
is the first non-zero narrowband frequency, and df_nb
is the narrowband frequency spacing. The istonal
Bool
argument, if true
, indicates the narrowband spectrum is tonal and thus concentrated at discrete frequencies. If false
, the spectrum is assumed to be constant over each narrow frequency band. The proportional band frequencies will be scaled by scaler
.
AcousticMetrics.LazyNBProportionalBandSpectrum
— MethodLazyNBProportionalBandSpectrum{NO,IsTonal}(TBands::Type{<:AbstractProportionalBands{NO}}, f1_nb, df_nb, msp_amp, scaler=1)
Construct a lazy representation of a proportional band spectrum with proportional band type TBands
from a narrowband spectrum.
The narrowband frequencies are defined by the first narrowband frequency f1_nb
and the narrowband frequency spacing df_nb
. msp_amp
is the spectrum of narrowband mean squared pressure amplitude. The proportional band frequencies will be scaled by scaler
.
IsTonal
is a Bool
indicating how the acoustic energy is distributed through the narrow frequency bands:
IsTonal == false
means the acoustic energy is assumed to be evenly distributed thoughout each bandIsTonal == true
means the acoustic energy is assumed to be concentrated at each band center
AcousticMetrics.LazyPBSProportionalBandSpectrum
— TypeLazyPBSProportionalBandSpectrum{NO,TF} <: AbstractProportionalBandSpectrum{NO,TF}
Lazy representation of a proportional band spectrum with octave fraction NO
and eltype
TF
constructed from a different proportional band spectrum.
AcousticMetrics.MSPSpectrumAmplitude
— TypeMSPSpectrumAmplitude(pth::AbstractPressureTimeHistory, istonal::Bool=false, hc=similar(pressure(pth)))
Construct a narrowband spectrum of the mean-squared pressure amplitude from a pressure time history.
The optional argument hc
will be used to store the discrete Fourier transform of the pressure time history, and should have length of inputlength(pth)
. The istonal
Bool
argument, if true
, indicates the pressure spectrum is tonal and thus concentrated at discrete frequencies. If false
, the spectrum is assumed to be constant over each frequency band.
AcousticMetrics.MSPSpectrumAmplitude
— TypeMSPSpectrumAmplitude{IsEven,IsTonal,Tel} <: AbstractNarrowbandSpectrum{IsEven,IsTonal,Tel}
Representation of mean-squared pressure amplitude as a function of narrowband frequency.
The IsEven
parameter is a Bool
indicating if the length of the spectrum is even or not, affecting how the Nyquist frequency is calculated. The IsTonal
Bool
parameter, if true
, indicates the mean-squared pressure spectrum is tonal and thus concentrated at discrete frequencies. If false
, the pressure spectrum is assumed to be constant over each frequency band.
AcousticMetrics.MSPSpectrumAmplitude
— TypeMSPSpectrumAmplitude(hc, dt, t0=zero(dt), istonal::Bool=false)
Construct a narrowband spectrum of the mean-squared pressure amplitude from the discrete Fourier transform in half-complex format hc
, time step size dt
, and initial time t0
. The istonal
Bool
argument, if true
, indicates the pressure spectrum is tonal and thus concentrated at discrete frequencies. If false
, the spectrum is assumed to be constant over each frequency band.
AcousticMetrics.MSPSpectrumAmplitude
— MethodMSPSpectrumAmplitude(sm::AbstractNarrowbandSpectrum)
Construct a narrowband spectrum of the mean-squared pressure amplitude from another narrowband spectrum.
AcousticMetrics.MSPSpectrumPhase
— TypeMSPSpectrumPhase
Alias for PressureSpectrumPhase
.
AcousticMetrics.PowerSpectralDensityAmplitude
— TypePowerSpectralDensityAmplitude(hc, dt, t0=zero(dt))
Construct a narrowband spectrum of the power spectral density amplitude from the discrete Fourier transform in half-complex format hc
, time step size dt
, and initial time t0
.
AcousticMetrics.PowerSpectralDensityAmplitude
— TypePowerSpectralDensityAmplitude(pth::AbstractPressureTimeHistory, hc=similar(pressure(pth)))
Construct a narrowband spectrum of the power spectral density amplitude from a pressure time history.
The optional argument hc
will be used to store the discrete Fourier transform of the pressure time history, and should have length of inputlength(pth)
.
AcousticMetrics.PowerSpectralDensityAmplitude
— TypePowerSpectralDensityAmplitude{IsEven,Tel} <: AbstractNarrowbandSpectrum{IsEven,false,Tel}
Representation of acoustic power spectral density amplitude as a function of narrowband frequency.
The IsEven
parameter is a Bool
indicating if the length of the spectrum is even or not, affecting how the Nyquist frequency is calculated. As the power spectral density is not well-defined for tones, the IsTonal
parameter is always false
.
AcousticMetrics.PowerSpectralDensityAmplitude
— MethodPowerSpectralDensityAmplitude(sm::AbstractNarrowbandSpectrum)
Construct a narrowband spectrum of the power spectral density amplitude from another narrowband spectrum.
AcousticMetrics.PowerSpectralDensityPhase
— TypePowerSpectralDensityPhase
Alias for PressureSpectrumPhase
.
AcousticMetrics.PressureSpectrumAmplitude
— TypePressureSpectrumAmplitude(pth::AbstractPressureTimeHistory, istonal::Bool=false, hc=similar(pressure(pth)))
Construct a narrowband spectrum of the pressure amplitude from a pressure time history.
The optional argument hc
will be used to store the discrete Fourier transform of the pressure time history, and should have length of inputlength(pth)
. The istonal
Bool
argument, if true
, indicates the pressure spectrum is tonal and thus concentrated at discrete frequencies. If false
, the spectrum is assumed to be constant over each frequency band.
AcousticMetrics.PressureSpectrumAmplitude
— TypePressureSpectrumAmplitude{IsEven,IsTonal,Tel} <: AbstractNarrowbandSpectrum{IsEven,IsTonal,Tel}
Representation of acoustic pressure amplitude as a function of narrowband frequency.
The IsEven
parameter is a Bool
indicating if the length of the spectrum is even or not, affecting how the Nyquist frequency is calculated. The IsTonal
Bool
parameter, if true
, indicates the pressure spectrum is tonal and thus concentrated at discrete frequencies. If false
, the spectrum is assumed to be constant over each frequency band.
AcousticMetrics.PressureSpectrumAmplitude
— TypePressureSpectrumAmplitude(hc, dt, t0=zero(dt), istonal::Bool=false)
Construct a narrowband spectrum of the pressure amplitude from the discrete Fourier transform in half-complex format hc
, time step size dt
, and initial time t0
. The istonal
Bool
argument, if true
, indicates the pressure spectrum is tonal and thus concentrated at discrete frequencies. If false
, the spectrum is assumed to be constant over each frequency band.
AcousticMetrics.PressureSpectrumAmplitude
— MethodPressureSpectrumAmplitude(sm::AbstractNarrowbandSpectrum)
Construct a narrowband spectrum of the pressure amplitude from another narrowband spectrum.
AcousticMetrics.PressureSpectrumPhase
— TypePressureSpectrumPhase(pth::AbstractPressureTimeHistory, istonal::Bool=false, hc=similar(pressure(pth)))
Construct a narrowband spectrum of the pressure phase from a pressure time history.
The optional argument hc
will be used to store the discrete Fourier transform of the pressure time history, and should have length of inputlength(pth)
. The istonal
Bool
argument, if true
, indicates the pressure spectrum is tonal and thus concentrated at discrete frequencies. If false
, the spectrum is assumed to be constant over each frequency band.
AcousticMetrics.PressureSpectrumPhase
— TypePressureSpectrumPhase{IsEven,IsTonal,Tel} <: AbstractNarrowbandSpectrum{IsEven,IsTonal,Tel}
Representation of acoustic pressure phase as a function of narrowband frequency.
The IsEven
parameter is a Bool
indicating if the length of the spectrum is even or not, affecting how the Nyquist frequency is calculated. The IsTonal
Bool
parameter, if true
, indicates the phase spectrum is tonal and thus concentrated at discrete frequencies. If false
, the spectrum is assumed to be constant over each frequency band.
AcousticMetrics.PressureSpectrumPhase
— TypePressureSpectrumPhase(hc, dt, t0=zero(dt), istonal::Bool=false)
Construct a narrowband spectrum of the pressure phase from the discrete Fourier transform in half-complex format hc
, time step size dt
, and initial time t0
.
AcousticMetrics.PressureSpectrumPhase
— MethodPressureSpectrumPhase(sm::AbstractNarrowbandSpectrum)
Construct a narrowband spectrum of the pressure phase from another narrowband spectrum.
AcousticMetrics.PressureTimeHistory
— TypePressureTimeHistory(p, dt, t0=zero(dt))
Construct a PressureTimeHistory
from a vector of pressures p
, time spacing dt
, and initial time t0
.
AcousticMetrics.PressureTimeHistory
— TypePressureTimeHistory(sm::AbstractNarrowbandSpectrum, p=similar(halfcomplex(sm)))
Construct a pressure time history from a narrowband spectrum sm
.
The optional p
argument will be used to store the pressure vector of the pressure time history, and should have length inputlength(sm)
.
AcousticMetrics.PressureTimeHistory
— TypePressureTimeHistory{IsEven} <: AbstractPressureTimeHistory{IsEven}
Pressure as a function of time defined on evenly-spaced time samples.
The IsEven
parameter is a Bool
indicating if the length of the pressure time history is even or not.
AcousticMetrics.ProportionalBandSpectrum
— TypeProportionalBandSpectrum{NO,TF,TPBS,TBandsL,TBandsC,TBandsU}
Representation of a proportional band spectrum with octave fraction NO
and eltype
TF
.
AcousticMetrics.ProportionalBandSpectrum
— MethodProportionalBandSpectrum(TBandsC, cfreq_start, pbs, scaler=1)
Construct a ProportionalBandSpectrum
from an array of proportional band amplitudes and proportional band type TBandsC
.
cfreq_start
is the centerband frequency corresponding to the first entry of pbs
. The proportional band frequencies indicated by TBandsC
are multiplied by scaler
.
AcousticMetrics.ProportionalBandSpectrumWithTime
— TypeProportionalBandSpectrumWithTime{NO,TF,TPBS,TBandsC,TTime,TDTime}
Representation of a proportional band spectrum with octave fraction NO
and eltype
TF
, but with an observer time.
AcousticMetrics.ProportionalBandSpectrumWithTime
— MethodProportionalBandSpectrumWithTime(pbs, cbands::AbstractProportionalBands{NO,:center}, dt, t)
Construct a proportional band spectrum from mean-squared pressure amplitudes pbs
and centerband frequencies cbands
, defined to exist over time range dt
and at observer time t
.
AcousticMetrics.OASPL
— MethodOASPL(ap::AbstractNarrowbandSpectrum)
Return the overall sound pressure level of a narrowband spectrum.
AcousticMetrics.OASPL
— MethodOASPL(ap::AbstractPressureTimeHistory)
Return the overall sound pressure level of a pressure time history.
AcousticMetrics.W_A
— MethodW_A(f::AbstractFloat)
Calculate the A-weighting factor for a frequency f
in Hertz.
Taken from the ANOPP2 Acoustics Analysis API Reference Manual.
AcousticMetrics.amplitude
— Methodamplitude(pbs::AbstractProportionalBandSpectrum)
Return the underlying Vector
containing the proportional band spectrum amplitudes contained in pbs
.
AcousticMetrics.band_end
— Methodband_end(bands::AbstractProportionalBands)
Return the standard band index number for the last band in bands
.
For example, it happens that the approximate octave center bands includes 1000 Hz, and that particular band is numbered 10
. So if the last band contained in bands
happens to be 1000 Hz (and freq_scaler(bands) == 1.0
), then band_end(bands) == 10
. Not particularly useful to a user.
AcousticMetrics.band_start
— Methodband_start(bands::AbstractProportionalBands)
Return the standard band index number for the first band in bands
.
For example, it happens that the approximate octave center bands includes 1000 Hz, and that particular band is numbered 10
. So if the first band contained in bands
happens to be 1000 Hz (and freq_scaler(bands) == 1.0
), then band_start(bands) == 10
. Not particularly useful to a user.
AcousticMetrics.cband_number
— Methodcband_number(bands::AbstractProportionalBands, fc)
Return the standard band index number of the band with center frequency fc
for proportional bands bands
.
For example, if bands
is a subtype of ApproximateOctaveBands
and freq_scaler(bands) == 1.0
, then cband_number(bands, 1000.0) == 10
.
AcousticMetrics.center_bands
— Methodcenter_bands(pbs::AbstractProportionalBandSpectrum)
Return the centers of the proportional bands associated with the proportional band spectrum pbs
.
AcousticMetrics.center_bands
— Methodcenter_bands(bands::ApproximateOctaveBands{LCU,TF}, scaler=freq_scaler(bands))
Construct and return the centers of the proportional bands bands
scaled by scaler
.
AcousticMetrics.center_bands
— Methodcenterbands(bands::ApproximateThirdOctaveBands{LCU,TF}, scaler=freqscaler(bands)) where {LCU,TF}
Construct and return the centers of the proportional bands bands
scaled by scaler
.
AcousticMetrics.center_bands
— Methodcenterbands(bands::ExactProportionalBands{NO,LCU,TF}, scaler=freqscaler(bands)) where {NO,TF}
Construct and return the centers of the proportional bands bands
scaled by scaler
.
AcousticMetrics.center_bands
— Methodcenter_bands(TBands::Type{<:AbstractProportionalBands{NO}}, fstart::TF, fend::TF, scaler=1) where {NO,TF}
Construct and return the centers of the proportional bands TBands
, scaled by scaler
, that would fully encompass a frequency range beginning with fstart
and ending with fend
.
AcousticMetrics.combine
— Methodcombine(pbs::AbstractArray{<:AbstractProportionalBandSpectrum}, outcbands::AbstractProportionalBands{NO,:center}, time_axis=1) where {NO}
Combine each input proportional band spectrum of pbs
into one output proportional band spectrum using the proportional center bands indicated by outcbands
.
time_axis
is an integer indicating the axis of the pbs
array along which time varies. For example, if time_axis == 1
and pbs
is a three-dimensional array, then apth[:, i, j]
would be proportional band spectrum of source i
, j
for all time. But if time_axis == 3
, then pbs[i, j, :]
would be the proportional band spectrum of source i
, j
for all time.
AcousticMetrics.freq_scaler
— Methodfreq_scaler(pbs::AbstractProportionalBandSpectrum)
Return the factor each "standard" frequency band associated with the proportional band spectrum pbs
is scaled by.
For example, the approximate octave center bands include 1000 Hz, 2000 Hz, and 4000 Hz. If freq_scaler(pbs) == 1.0
, then these frequencies would be unchanged. If freq_scaler(pbs) == 1.5
, then bands
would include 1500 Hz, 3000 Hz, and 6000 Hz instead. If freq_scaler(pbs) == 0.5
, then bands
would include 500 Hz, 1000 Hz, and 2000 Hz in place of 1000 Hz, 2000 Hz, and 4000 Hz.
AcousticMetrics.freq_scaler
— Methodfreq_scaler(bands::AbstractProportionalBands)
Return the factor each "standard" frequency band is scaled by.
For example, the approximate octave center bands include 1000 Hz, 2000 Hz, and 4000 Hz. If freq_scaler(bands) == 1.0
, then these frequencies would be unchanged. If freq_scaler(bands) == 1.5
, then bands
would include 1500 Hz, 3000 Hz, and 6000 Hz instead. If freq_scaler(bands) == 0.5
, then bands
would include 500 Hz, 1000 Hz, and 2000 Hz in place of 1000 Hz, 2000 Hz, and 4000 Hz.
AcousticMetrics.frequency
— Methodfrequency(sm::AbstractNarrowbandSpectrum)
Return a vector of frequencies associated with the narrowband spectrum.
The frequencies are calculated using the rfftfreq
function in the FFTW.jl package.
AcousticMetrics.frequency_nb
— Methodfrequency_nb(pbs::LazyNBProportionalBandSpectrum)
Return the narrowband frequencies associated with the underlying narrowband spectrum contained in pbs
.
AcousticMetrics.frequencystep
— Methodfrequencystep(sm::AbstractNarrowbandSpectrum)
Return the frequency step size Δf
associated with the narrowband spectrum.
AcousticMetrics.halfcomplex
— Methodhalfcomplex(sm::AbstractNarrowbandSpectrum)
Return a vector of the discrete Fourier transform of the pressure time history in half-complex format.
See the FFTW docs for the definition of the halfcomplex format.
AcousticMetrics.has_observer_time
— Methodhas_observer_time(pbs::AbstractProportionalBandSpectrum)
Return true
if the proportional band spectrum is defined to exist over a limited time, false
otherwise.
AcousticMetrics.inputlength
— Methodinputlength(sm::AbstractNarrowbandSpectrum)
Return a number of pressure time samples associated with a narrowband spectrum.
This is also the length of the discrete Fourier transform associated with the spectrum in half-complex format.
AcousticMetrics.inputlength
— Methodinputlength(pth::AbstractPressureTimeHistory)
Return a number of pressure samples associated with a pressure time history.
AcousticMetrics.irfft!
— Functionirfft!(y, x, cache=nothing)
Calculate the inverse FFT of `x` and store the result in in `y`, where `x` is in the half-complex format.
Just a wrapper of `FFTW.r2r!(y, FFTW.HC2R)`. The `cache` argument is
optional and not used, and is included to keep the function signiture the
same as the method that takes `Vector`s of `Dual`s.
AcousticMetrics.istonal
— Methodistonal(sm::AbstractNarrowbandSpectrum)
Return true
if the spectrum is tonal, false
otherwise.
AcousticMetrics.lazy_pbs
— Functionlazy_pbs(pbs, cbands::AbstractProportionalBands{NO,:center})
Construct a lazy proportional band spectrum on proportional center bands cbands
using the proportional band spectrum pbs
.
AcousticMetrics.lower_bands
— Methodlower_bands(pbs::AbstractProportionalBandSpectrum)
Return the lower edges of the proportional bands associated with the proportional band spectrum pbs
.
AcousticMetrics.lower_bands
— Methodlower_bands(bands::ApproximateOctaveBands{LCU,TF}, scaler=freq_scaler(bands))
Construct and return the lower edges of the proportional bands bands
scaled by scaler
.
AcousticMetrics.lower_bands
— Methodlowerbands(bands::ApproximateThirdOctaveBands{LCU,TF}, scaler=freqscaler(bands)) where {LCU,TF}
Construct and return the lower edges of the proportional bands bands
scaled by scaler
.
AcousticMetrics.lower_bands
— Methodlowerbands(bands::ExactProportionalBands{NO,LCU,TF}, scaler=freqscaler(bands)) where {NO,TF}
Construct and return the lower edges of the proportional bands bands
scaled by scaler
.
AcousticMetrics.lower_bands
— Methodlower_bands(TBands::Type{<:AbstractProportionalBands{NO}}, fstart::TF, fend::TF, scaler=1) where {NO,TF}
Construct and return the lower edges of the proportional bands TBands
, scaled by scaler
, that would fully encompass a frequency range beginning with fstart
and ending with fend
.
AcousticMetrics.lower_center_upper
— Methodlower_center_upper(bands::AbstractProportionalBands{NO,LCU,TF}) where {NO,LCU,TF}
Return LCU
, which can be either :lower
, :center
, :upper
, indicating if bands
represents the lower edges, centers, or upper edges of proportional bands, respectively.
AcousticMetrics.observer_time
— Methodobserver_time(pbs::AbstractProportionalBandSpectrum)
Return the observer time at which the proportional band spectrum is defined to exist.
AcousticMetrics.octave_fraction
— Methodoctave_fraction(pbs::AbstractProportionalBandSpectrum{NO}) where {NO}
Return NO
, the "octave fraction," e.g. 1
for octave bands, 3
for third-octave, 12
for twelfth-octave.
AcousticMetrics.octave_fraction
— Methodoctave_fraction(bands::AbstractProportionalBands{NO}) where {NO}
Return NO
, the "octave fraction," e.g. 1
for octave bands, 3
for third-octave, 12
for twelfth-octave.
AcousticMetrics.pressure
— Methodpressure(pth::AbstractPressureTimeHistory)
Return a vector of pressures associated with a pressure time history.
AcousticMetrics.rfft!
— Functionrfft!(y, x, cache=nothing)
Calculate the real-input FFT of `x` and store the result in half-complex format in `y`.
Just a wrapper of `FFTW.r2r!(y, FFTW.R2HC)`. The `cache` argument is
optional and not used, and is included to keep the function signiture the
same as the method that takes `Vector`s of `Dual`s.
AcousticMetrics.samplerate
— Methodsamplerate(sm::AbstractNarrowbandSpectrum)
Return the sample rate (aka the inverse of the time step size) associated with a narrowband spectrum.
AcousticMetrics.starttime
— Methodstarttime(sm::AbstractNarrowbandSpectrum)
Return the initial time t0
associated with a pressure time history.
AcousticMetrics.starttime
— Methodstarttime(pth::AbstractPressureTimeHistory)
Return the initial time t0
associated with a pressure time history.
AcousticMetrics.time
— Methodtime(pth::AbstractPressureTimeHistory)
Return a vector of times associated with a pressure time history.
AcousticMetrics.time_period
— Methodtime_period(pbs::AbstractArray{<:AbstractProportionalBandSpectrum})
Find the period of time over which the collection of proportional band spectrum pbs
exists.
AcousticMetrics.time_scaler
— Methodtime_scaler(pbs::AbstractProportionalBandSpectrum{NO,TF}, period)
Find the scaling factor appropriate to multiply the proportional band spectrum pbs
by that accounts for the duration of time the spectrum exists.
This is used when combining multiple proportional band spectra with the combine function.
AcousticMetrics.timestep
— Methodtimestep(sm::AbstractNarrowbandSpectrum)
Return the time step size dt
associated with a narrowband spectrum.
AcousticMetrics.timestep
— Methodtimestep(pth::AbstractPressureTimeHistory)
Return the time step size dt
associated with a pressure time history.
AcousticMetrics.timestep
— Methodtimestep(pbs::AbstractProportionalBandSpectrum)
Return the time range over which the proportional band spectrum is defined to exist.
AcousticMetrics.upper_bands
— Methodupper_bands(pbs::AbstractProportionalBandSpectrum)
Return the upper edges of the proportional bands associated with the proportional band spectrum pbs
.
AcousticMetrics.upper_bands
— Methodupper_bands(bands::ApproximateOctaveBands{LCU,TF}, scaler=freq_scaler(bands))
Construct and return the upper edges of the proportional bands bands
scaled by scaler
.
AcousticMetrics.upper_bands
— Methodupperbands(bands::ApproximateThirdOctaveBands{LCU,TF}, scaler=freqscaler(bands)) where {LCU,TF}
Construct and return the upper edges of the proportional bands bands
scaled by scaler
.
AcousticMetrics.upper_bands
— Methodupperbands(bands::ExactProportionalBands{NO,LCU,TF}, scaler=freqscaler(bands)) where {NO,TF}
Construct and return the upper edges of the proportional bands bands
scaled by scaler
.
AcousticMetrics.upper_bands
— Methodupper_bands(TBands::Type{<:AbstractProportionalBands{NO}}, fstart::TF, fend::TF, scaler=1) where {NO,TF}
Construct and return the upper edges of the proportional bands TBands
, scaled by scaler
, that would fully encompass a frequency range beginning with fstart
and ending with fend
.