AcousticMetrics.AbstractNarrowbandSpectrumType
AbstractNarrowbandSpectrum{IsEven,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.

AcousticMetrics.AbstractPressureTimeHistoryType
AbstractPressureTimeHistory{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.AbstractProportionalBandsType
AbstractProportionalBands{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: The struct returns the lower edges of each frequency band.
  • :center: The struct returns the center of each frequency band.
  • :upper: The struct returns the upper edges of each frequency band.
AcousticMetrics.ApproximateOctaveBandsType
ApproximateOctaveBands{LCU,TF} <: AbstractProportionalBands{3,LCU,TF}

Representation of the approximate octave proportional frequency bands with eltype TF.

The LCU parameter can take one of three values:

  • :lower: The struct returns the lower edges of each frequency band.
  • :center: The struct returns the center of each frequency band.
  • :upper: The struct returns the upper edges of each frequency band.
AcousticMetrics.ApproximateOctaveBandsMethod
ApproximateOctaveBands{LCU,TF}(bstart::Int, bend::Int)

Construct an ApproximateOctaveBands with eltype TF encomposing band numbers from bstart to bend.

TF defaults to Float64.

AcousticMetrics.ApproximateOctaveBandsMethod
ApproximateOctaveBands{LCU}(fstart::TF, fend::TF)

Construct an ApproximateOctaveBands with eltype TF encomposing the bands needed to completly extend over minimum frequency fstart and maximum frequency fend.

AcousticMetrics.ApproximateThirdOctaveBandsType
ApproximateThirdOctaveBands{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: The struct returns the lower edges of each frequency band.
  • :center: The struct returns the center of each frequency band.
  • :upper: The struct returns the upper edges of each frequency band.
AcousticMetrics.ApproximateThirdOctaveBandsMethod
ApproximateThirdOctaveBands{LCU,TF}(bstart::Int, bend::Int)

Construct an ApproximateThirdOctaveBands with eltype TF encomposing band numbers from bstart to bend.

TF defaults to Float64.

AcousticMetrics.ApproximateThirdOctaveBandsMethod
ApproximateThirdOctaveBands{LCU}(fstart::TF, fend::TF)

Construct an ApproximateThirdOctaveBands with eltype TF encomposing the bands needed to completly extend over minimum frequency fstart and maximum frequency fend.

AcousticMetrics.ExactProportionalBandsType
ExactProportionalBands{NO,LCU}(TF=Float64, bstart::Int, bend::Int)

Construct an ExactProportionalBands with eltype TF encomposing band numbers from bstart to bend.

AcousticMetrics.ExactProportionalBandsMethod
ExactProportionalBands{NO,LCU}(fstart::TF, fend::TF)

Construct an ExactProportionalBands with eltype TF encomposing the bands needed to completly extend over minimum frequency fstart and maximum frequency fend.

AcousticMetrics.MSPSpectrumAmplitudeType
MSPSpectrumAmplitude(hc, dt, t0=zero(dt))

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.

AcousticMetrics.MSPSpectrumAmplitudeType
MSPSpectrumAmplitude{IsEven,Tel} <: AbstractNarrowbandSpectrum{IsEven,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.

AcousticMetrics.MSPSpectrumAmplitudeType
MSPSpectrumAmplitude(pth::AbstractPressureTimeHistory, 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).

AcousticMetrics.MSPSpectrumAmplitudeMethod
MSPSpectrumAmplitude(sm::AbstractNarrowbandSpectrum)

Construct a narrowband spectrum of the mean-squared pressure amplitude from another narrowband spectrum.

AcousticMetrics.PowerSpectralDensityAmplitudeType
PowerSpectralDensityAmplitude(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.PowerSpectralDensityAmplitudeType
PowerSpectralDensityAmplitude{IsEven,Tel} <: AbstractNarrowbandSpectrum{IsEven,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.

AcousticMetrics.PowerSpectralDensityAmplitudeType
PressureSpectrumAmplitude(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.PressureSpectrumAmplitudeType
PressureSpectrumAmplitude(hc, dt, t0=zero(dt))

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.

AcousticMetrics.PressureSpectrumAmplitudeType
PressureSpectrumAmplitude{IsEven,Tel} <: AbstractNarrowbandSpectrum{IsEven,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.

AcousticMetrics.PressureSpectrumAmplitudeType
PressureSpectrumAmplitude(pth::AbstractPressureTimeHistory, 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).

AcousticMetrics.PressureSpectrumPhaseType
PressureSpectrumPhase(hc, dt, t0=zero(dt))

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.PressureSpectrumPhaseType
PressureSpectrumPhase{IsEven,Tel} <: AbstractNarrowbandSpectrum{IsEven,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.

AcousticMetrics.PressureSpectrumPhaseType
PressureSpectrumPhase(pth::AbstractPressureTimeHistory, 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).

AcousticMetrics.PressureSpectrumPhaseMethod
PressureSpectrumPhase(sm::AbstractNarrowbandSpectrum)

Construct a narrowband spectrum of the pressure phase from another narrowband spectrum.

AcousticMetrics.PressureTimeHistoryType
PressureTimeHistory(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.PressureTimeHistoryType
PressureTimeHistory(p, dt, t0=zero(dt))

Construct a PressureTimeHistory from a vector of pressures p, time spacing dt, and initial time t0.

AcousticMetrics.PressureTimeHistoryType
PressureTimeHistory{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.ProportionalBandSpectrumMethod
ProportionalBandSpectrum(TBands::Type{<:AbstractProportionalBands}, sm::AbstractNarrowbandSpectrum)

Construct a ProportionalBandSpectrum using a proportional band TBands and narrowband spectrum sm.

AcousticMetrics.OASPLMethod
OASPL(ap::AbstractPressureTimeHistory)

Return the overall sound pressure level of a pressure time history.

AcousticMetrics.OASPLMethod
OASPL(ap::AbstractNarrowbandSpectrum)

Return the overall sound pressure level of a narrowband spectrum.

AcousticMetrics.W_AMethod
W_A(f::AbstractFloat)

Calculate the A-weighting factor for a frequency f in Hertz.

Taken from the ANOPP2 Acoustics Analysis API Reference Manual.

AcousticMetrics.dft_hc2rMethod
dft_hc2r(x::AbstractVector)

Calculate the inverse discrete Fourier transform of a real-input DFT.

This is the inverse of dft_r2hc, except for a factor of N, where N is the length of the input (and output), since FFTW computes an "unnormalized" FFT.

See http://www.fftw.org/fftw3doc/The-1d-Real002ddata-DFT.html#The-1d-Real002ddata-DFT and http://www.fftw.org/fftw3doc/The-Halfcomplex_002dformat-DFT.html for details.

Only use this for checking the derivatives of the FFT routines (should work fine, just slow).

AcousticMetrics.dft_r2hcMethod
dft_r2hc(x::AbstractVector)

Calculate the real-input discrete Fourier transform, returning the result in the "half-complex" format.

See http://www.fftw.org/fftw3doc/The-1d-Real002ddata-DFT.html#The-1d-Real002ddata-DFT and http://www.fftw.org/fftw3doc/The-Halfcomplex_002dformat-DFT.html for details.

Only use this for checking the derivatives of the FFT routines (should work fine, just slow).

AcousticMetrics.frequencyMethod
frequency(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.halfcomplexMethod
halfcomplex(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.inputlengthMethod
inputlength(pth::AbstractPressureTimeHistory)

Return a number of pressure samples associated with a pressure time history.

AcousticMetrics.inputlengthMethod
inputlength(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.irfft!Function
irfft!(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.pressureMethod
pressure(pth::AbstractPressureTimeHistory)

Return a vector of pressures associated with a pressure time history.

AcousticMetrics.rfft!Function
rfft!(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.samplerateMethod
samplerate(sm::AbstractNarrowbandSpectrum)

Return the sample rate (aka the inverse of the time step size) associated with a narrowband spectrum.

AcousticMetrics.starttimeMethod
starttime(pth::AbstractPressureTimeHistory)

Return the initial time t0 associated with a pressure time history.

AcousticMetrics.starttimeMethod
starttime(sm::AbstractNarrowbandSpectrum)

Return the initial time t0 associated with a pressure time history.

AcousticMetrics.timeMethod
time(pth::AbstractPressureTimeHistory)

Return a vector of times associated with a pressure time history.

AcousticMetrics.timestepMethod
timestep(pth::AbstractPressureTimeHistory)

Return the time step size dt associated with a pressure time history.

AcousticMetrics.timestepMethod
timestep(sm::AbstractNarrowbandSpectrum)

Return the time step size dt associated with a narrowband spectrum.

Base.getindexMethod
Base.getindex(bands::ApproximateOctaveBands{LCU}, i::Int) where {LCU}

Return the lower, center, or upper frequency (depending on the value of LCU) associated with the i-th proportional band frequency covered by bands.

Base.getindexMethod
Base.getindex(bands::ApproximateThirdOctaveBands{LCU}, i::Int) where {LCU}

Return the lower, center, or upper frequency (depending on the value of LCU) associated with the i-th proportional band frequency covered by bands.

Base.getindexMethod
Base.getindex(bands::ExactProportionalBands{NO,LCU}, i::Int) where {NO,LCU}

Return the lower, center, or upper frequency (depending on the value of LCU) associated with the i-th proportional band frequency covered by bands.

Base.getindexMethod
Base.getindex(pbs::ProportionalBandSpectrum, i::Int)

Return the proportional band spectrum amplitude for the ith non-zero band in pbs.