From 3424494682e5f49748e775556b07fccfe7fd1af4 Mon Sep 17 00:00:00 2001 From: zeptodoctor <44736852+zeptodoctor@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:40:14 +0000 Subject: [PATCH] build based on b42afcb --- dev/index.html | 2 +- dev/reference/index.html | 6 +++--- dev/search/index.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/index.html b/dev/index.html index 0458503..13deed8 100644 --- a/dev/index.html +++ b/dev/index.html @@ -24,4 +24,4 @@ -0.25 0.25 0.75 - 1.25 + 1.25 diff --git a/dev/reference/index.html b/dev/reference/index.html index 2be060a..dc100ce 100644 --- a/dev/reference/index.html +++ b/dev/reference/index.html @@ -1,11 +1,11 @@ -API Reference · AeroAcoustics.jl

API Reference

General

AeroAcoustics.narrow2octMethod
narrow2oct(x::FreqArray,n,nomial::Bool=true;psd=false)

Sum narrow band spectrum to 1/n octave bands given narrow band frequencies f in x.

source
AeroAcoustics.EnvironmentType
Environment

The Environment struct is required for most methods and defines the geometrical setup, constants, and stores the relevant data together. The microphone array is assumed to be at the center of the coordinate system. The fields are

Arguments

Required:

  • micgeom::Array{T,2}: (x,y,z) coordinates for microhone array.
  • z0::Real: distance to source plane from microphone array.
  • CSM::FreqArray: Cross-spectral matrix, size M x M x Nf, where M is the number of microphones and Nf is the number of frequency bins.

Optional:

  • flim::Tuple=extrema(CSM.fc): Frequency limits (fmin,fmax).
  • Nx::Integer=21: Number of computational gridpoint in x direction.
  • Ny::Integer=21: Number of computational gridpoint in y direction.
  • xlim::Tuple=(-1.,1.): Cartesian x-coordinate limits.
  • ylim::Tuple=(-1.,1.): Cartesian y-coordinate limits.
  • wv=ones(size(micgeom,2)): Microphones on/off.
  • wc::Bool=false: Microphones coherence weighting.
  • dr::Bool=false: Diagonal removal of CSM
  • w=ones(M,Nf): Microphone weights. If wc=true it calculates coherence weighting.
  • shear::Bool = false: Amiet phase correction
  • ampcorr::Bool = shear: Amiet amplitude correction (only applies when shear = true)
  • c::Real=343.: Speed of sound [m/s].
  • Ma::Real=0.0: Mach number (sign determines flow direction)
  • h::Real=0.0: Distance from array center to shear layer (Amiet correction) should be supplied when Ma != 0.
  • multi_thread::Bool = false: Enable multi-threading via the ThreadsX package.
source
AeroAcoustics.coherence_weightsMethod
coherence_weights(CSM)

Calculate microphone weights according to mean mututal-coherence.

Amaral et al. “Slat Noise from an MD30P30N Airfoil at Extreme Angles of Attack,” AIAA Journal, vol. 56, no. 3, pp. 964–978, Mar. 2018.

source
AeroAcoustics.enbwMethod
enbw(fs,win)

Equivalent Noise Band Width. Use to convert power spectrum to power spectral density and reverse. PS = PSD*ENBW

source

Basic methods

AeroAcoustics.beamformingMethod
beamforming(Environment)

Calculate frequency-domain beamforming using cross-spectral matrix csm and steering vector v stored in Environment struct

source
AeroAcoustics.beamformingMethod
beamforming(csm,v)

Calculate frequency-domain beamforming using cross-spectral matrix csm and steering vector v. csm must be a square (Hermitian) matrix optionally with a third (frequency) dimension. First dimension of v and csm must be equal.

source
AeroAcoustics.csmMethod
csm(t;n=1024,noverlap=div(n,2),fs=1,win=DSP.hanning(n),scaling="spectrum")

Calculate cross-spectral matrix from time series t which is S x M dimensional, where S is the number of samples and Mthe number of microphones.

source
AeroAcoustics.psfFunction
psf(Environment[,cent])

Calculate frequency-domain point spread function using the Environment struct to access steeringvectors. Optionally, supply the index where the psf is centered, default is (N/2)+1.

source
AeroAcoustics.SPIMethod
SPI(b::FreqArray,E::Environment,dxdy,limits)

Convenience function to normalize source integration of a beamforming result.

source
AeroAcoustics.sourceintegrationMethod
sourceintegration(x::Vector,env::Environment,limits::Vector{T}) where T
+API Reference · AeroAcoustics.jl

API Reference

General

AeroAcoustics.narrow2octMethod
narrow2oct(x::FreqArray,n,nomial::Bool=true;psd=false)

Sum narrow band spectrum to 1/n octave bands given narrow band frequencies f in x.

source
AeroAcoustics.EnvironmentType
Environment

The Environment struct is required for most methods and defines the geometrical setup, constants, and stores the relevant data together. The microphone array is assumed to be at the center of the coordinate system. The fields are

Arguments

Required:

  • micgeom::Array{T,2}: (x,y,z) coordinates for microhone array.
  • z0::Real: distance to source plane from microphone array.
  • CSM::FreqArray: Cross-spectral matrix, size M x M x Nf, where M is the number of microphones and Nf is the number of frequency bins.

Optional:

  • flim::Tuple=extrema(CSM.fc): Frequency limits (fmin,fmax).
  • Nx::Integer=21: Number of computational gridpoint in x direction.
  • Ny::Integer=21: Number of computational gridpoint in y direction.
  • xlim::Tuple=(-1.,1.): Cartesian x-coordinate limits.
  • ylim::Tuple=(-1.,1.): Cartesian y-coordinate limits.
  • wv=ones(size(micgeom,2)): Microphones on/off.
  • wc::Bool=false: Microphones coherence weighting.
  • dr::Bool=false: Diagonal removal of CSM
  • w=ones(M,Nf): Microphone weights. If wc=true it calculates coherence weighting.
  • shear::Bool = false: Amiet phase correction
  • ampcorr::Bool = shear: Amiet amplitude correction (only applies when shear = true)
  • c::Real=343.: Speed of sound [m/s].
  • Ma::Real=0.0: Mach number (sign determines flow direction)
  • h::Real=0.0: Distance from array center to shear layer (Amiet correction) should be supplied when Ma != 0.
  • multi_thread::Bool = false: Enable multi-threading via the ThreadsX package.
source
AeroAcoustics.coherence_weightsMethod
coherence_weights(CSM)

Calculate microphone weights according to mean mututal-coherence.

Amaral et al. “Slat Noise from an MD30P30N Airfoil at Extreme Angles of Attack,” AIAA Journal, vol. 56, no. 3, pp. 964–978, Mar. 2018.

source
AeroAcoustics.enbwMethod
enbw(fs,win)

Equivalent Noise Band Width. Use to convert power spectrum to power spectral density and reverse. PS = PSD*ENBW

source

Basic methods

AeroAcoustics.beamformingMethod
beamforming(Environment)

Calculate frequency-domain beamforming using cross-spectral matrix csm and steering vector v stored in Environment struct

source
AeroAcoustics.beamformingMethod
beamforming(csm,v)

Calculate frequency-domain beamforming using cross-spectral matrix csm and steering vector v. csm must be a square (Hermitian) matrix optionally with a third (frequency) dimension. First dimension of v and csm must be equal.

source
AeroAcoustics.csmMethod
csm(t;n=1024,noverlap=div(n,2),fs=1,win=DSP.hanning(n),scaling="spectrum")

Calculate cross-spectral matrix from time series t which is S x M dimensional, where S is the number of samples and Mthe number of microphones.

source
AeroAcoustics.psfFunction
psf(Environment[,cent])

Calculate frequency-domain point spread function using the Environment struct to access steeringvectors. Optionally, supply the index where the psf is centered, default is (N/2)+1.

source
AeroAcoustics.SPIMethod
SPI(b::FreqArray,E::Environment,dxdy,limits)

Convenience function to normalize source integration of a beamforming result.

source
AeroAcoustics.sourceintegrationMethod
sourceintegration(x::Vector,env::Environment,limits::Vector{T}) where T
 sourceintegration(x::Vector,env::Environment,limits::Vector{Vector{T}}) where T
 sourceintegration(x::FreqArray,env::Environment,limits::Vector{T}) where T
 sourceintegration(x::FreqArray,env::Environment,limits::Vector{Vector{T}}) where T

Source integration of x from limits given in cartesian coordinates [xmin,xmax,ymin,ymax].

src1 = [-0.1,0.1,-0.1,0.1]
 src2 = [-0.2,0.0,-0.1,0.1]
 limits = [src1,src2]
-srcint = sourceintegration(x,env,limits)

Optionally supply keyword int_thres to set a threshold on source integration. Default is set to Inf which sum all values within integration region.

source
AeroAcoustics.csm_slowMethod
csm_slow(t;n=1024,noverlap=div(n,2),fs=1,win=DSP.hanning(n),scaling="spectrum")

Calculate cross-spectral matrix from time series t which is S x M dimensional, where S is the number of samples and Mthe number of microphones. This version is slower than csm but allocates much less (in some cases), therefore csm_slow could be used for long time signals.

source
AeroAcoustics.point_to_regionMethod
point_to_region(src,dxdy)

Helper function to get integration limits from src coordinates and size of area dxdy

sources = [(0.1,0.1),(-0.1,0.1),(-0.1,-0.1),(0.1,-0.1)]
+srcint = sourceintegration(x,env,limits)

Optionally supply keyword int_thres to set a threshold on source integration. Default is set to Inf which sum all values within integration region.

source
AeroAcoustics.csm_slowMethod
csm_slow(t;n=1024,noverlap=div(n,2),fs=1,win=DSP.hanning(n),scaling="spectrum")

Calculate cross-spectral matrix from time series t which is S x M dimensional, where S is the number of samples and Mthe number of microphones. This version is slower than csm but allocates much less (in some cases), therefore csm_slow could be used for long time signals.

source
AeroAcoustics.point_to_regionMethod
point_to_region(src,dxdy)

Helper function to get integration limits from src coordinates and size of area dxdy

sources = [(0.1,0.1),(-0.1,0.1),(-0.1,-0.1),(0.1,-0.1)]
 dxdy = (0.1,0.1)
 limits = point_to_region(sources,dxdy)
-srcint = sourceintegration(x,env,limits)
source
AeroAcoustics.refraction_correctionFunction
r,pc_pm = refraction_correction(E::Environment[,h1=1.5,h2=z0-h1])

Compute propagation time correction and amplitude correction for 2D planar jet.

References: - Glegg, S., & Devenport, W. (2017). Aeroacoustics of low mach number flows: Fundamentals, analysis, and measurement. Chap. 10.

source
AeroAcoustics.refraction_correctionMethod
r,pc_pm = refraction_correction(Δx,Δy,Δz,Ma,h1,h2)

Compute propagation time correction and amplitude correction for 2D planar jet.

References: - Glegg, S., & Devenport, W. (2017). Aeroacoustics of low mach number flows: Fundamentals, analysis, and measurement. Chap. 10.

source

Advanced methods

AeroAcoustics.cleanSCMethod
cleanSC(E[;maxiter=50,ϕ=0.5,stopn=10,peak_removal=false,trust_region=nothing])

CLEAN-SC algorithm for source identification and quantification optionally setting maximum iterations maxiter (default 50), and loop gain ϕ (default 0.5). Additionally, a stopping criterion max_peak[i] > max_peak[i-stopn] can be set with parameter stopn. Subtraction of peak sources in the dirty map is supported by peak_removal=true/false to remove peak sources outside trust_region with limits given as [xmin,xmax,ymin,ymax] e.g. trust_region=[-0.75;1.5;-1.0;1.0].

References:

- Sijtsma, P. (2007). CLEAN based on spatial source coherence. International Journal of Aeroacoustics, 6(4), 357–374.

With inspiration from https://github.com/acoular/acoular/blob/66cba3cffb3bc72602c869f99347be76798f4ac1/acoular/fbeamform.py#L1496

source
AeroAcoustics.damasMethod
damas(env::Environment, b [,f<:AbstractArray, ω::Real]; maxiter=10)

Performs exactly maxiter DAMAS iterations for all frequency bins in env.fn or frequencies in f. f must contain values that match exact a (sub)set of the values in env.fn. Successive Over Relaxation (SOR) can be set with relaxation parameter ω. Default is ω=1 corresponding to no relaxation.

References:

Brooks, T. F. et al. (2006). A deconvolution approach for the mapping of acoustic sources (DAMAS) determined from phased microphone arrays. J.Sound.Vib. 294(4), 856–879. https://doi.org/10.1016/j.jsv.2005.12.046

source
AeroAcoustics.fistaMethod
fista(env::Environment,b ,p [,f<:AbstractArray]; tol=1e-6, maxit=1000)

Performs deconvolution with FISTA with a nonnegativity constraint for all frequency bins in env.fn or frequencies in f. f must contain values that match exact a (sub)set of the values in env.fn.

Arguments

Required:

  • env::Environment: Environment struct
  • b::FreqArray: Beamforming array
  • p::FreqArray: Point spread function array

Optional:

  • tol: Convergence tolerance (default: 1e-6)
  • maxit: Maximum number of iterations (default: 1000)

References:

  • Beck, A., & Teboulle, M. (2009). A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM journal on imaging sciences, 2(1), 183-202.
  • Lylloff, O., Fernández-Grande, E., Agerkvist, F., Hald, J., Tiana Roig, E., & Andersen, M. S. (2015). Improving the efficiency of deconvolution algorithms for sound source localization. The journal of the acoustical society of America, 138(1), 172-180
source
+srcint = sourceintegration(x,env,limits)
source
AeroAcoustics.refraction_correctionFunction
r,pc_pm = refraction_correction(E::Environment[,h1=1.5,h2=z0-h1])

Compute propagation time correction and amplitude correction for 2D planar jet.

References: - Glegg, S., & Devenport, W. (2017). Aeroacoustics of low mach number flows: Fundamentals, analysis, and measurement. Chap. 10.

source
AeroAcoustics.refraction_correctionMethod
r,pc_pm = refraction_correction(Δx,Δy,Δz,Ma,h1,h2)

Compute propagation time correction and amplitude correction for 2D planar jet.

References: - Glegg, S., & Devenport, W. (2017). Aeroacoustics of low mach number flows: Fundamentals, analysis, and measurement. Chap. 10.

source

Advanced methods

AeroAcoustics.cleanSCMethod
cleanSC(E[;maxiter=50,ϕ=0.5,stopn=10,peak_removal=false,trust_region=nothing])

CLEAN-SC algorithm for source identification and quantification optionally setting maximum iterations maxiter (default 50), and loop gain ϕ (default 0.5). Additionally, a stopping criterion max_peak[i] > max_peak[i-stopn] can be set with parameter stopn. Subtraction of peak sources in the dirty map is supported by peak_removal=true/false to remove peak sources outside trust_region with limits given as [xmin,xmax,ymin,ymax] e.g. trust_region=[-0.75;1.5;-1.0;1.0].

References:

- Sijtsma, P. (2007). CLEAN based on spatial source coherence. International Journal of Aeroacoustics, 6(4), 357–374.

With inspiration from https://github.com/acoular/acoular/blob/66cba3cffb3bc72602c869f99347be76798f4ac1/acoular/fbeamform.py#L1496

source
AeroAcoustics.damasMethod
damas(env::Environment, b [,f<:AbstractArray, ω::Real]; maxiter=10)

Performs exactly maxiter DAMAS iterations for all frequency bins in env.fn or frequencies in f. f must contain values that match exact a (sub)set of the values in env.fn. Successive Over Relaxation (SOR) can be set with relaxation parameter ω. Default is ω=1 corresponding to no relaxation.

References:

Brooks, T. F. et al. (2006). A deconvolution approach for the mapping of acoustic sources (DAMAS) determined from phased microphone arrays. J.Sound.Vib. 294(4), 856–879. https://doi.org/10.1016/j.jsv.2005.12.046

source
AeroAcoustics.fistaMethod
fista(env::Environment,b ,p [,f<:AbstractArray]; tol=1e-6, maxit=1000)

Performs deconvolution with FISTA with a nonnegativity constraint for all frequency bins in env.fn or frequencies in f. f must contain values that match exact a (sub)set of the values in env.fn.

Arguments

Required:

  • env::Environment: Environment struct
  • b::FreqArray: Beamforming array
  • p::FreqArray: Point spread function array

Optional:

  • tol: Convergence tolerance (default: 1e-6)
  • maxit: Maximum number of iterations (default: 1000)

References:

  • Beck, A., & Teboulle, M. (2009). A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM journal on imaging sciences, 2(1), 183-202.
  • Lylloff, O., Fernández-Grande, E., Agerkvist, F., Hald, J., Tiana Roig, E., & Andersen, M. S. (2015). Improving the efficiency of deconvolution algorithms for sound source localization. The journal of the acoustical society of America, 138(1), 172-180
source
diff --git a/dev/search/index.html b/dev/search/index.html index f042a67..2c3f125 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · AeroAcoustics.jl

Loading search...

    +Search · AeroAcoustics.jl

    Loading search...