Utilities
ContinuousWavelets.getMeanFreq — Function
getMeanFreq(Ŵ, fsample=2000) -> arrayOfFreqsCalculate each of the mean frequencies of a collection of analytic or real wavelets Ŵ, using the power spectral density. The default sampling rate fsample=2kHz, so the maximum frequency is 1kHz.
getMeanFreq(sc::stFlux{1}, δt=1000)Get a list of the mean frequencies for the filter bank in each layer. The averaging filter is last, and gives the mean frequency of the positive frequency only. Note that δt gives the sampling rate for the input only, and that it decreases at each subsequent layer at the rate implied by the subsampling in sc.
julia> using ScatteringTransform
julia> St = scatteringTransform((1024,1,1),2)
stFlux{2, Nd=1, filters=[15], σ = abs, batchSize = 1, normalize = true}
julia> f1, f2, f3 = getMeanFreq(St);
julia> f1'
1×16 adjoint(::Vector{Float64}) with eltype Float64:
7.70368 54.4302 78.7967 … 315.712 338.416 18.6697
julia> f2'
1×15 adjoint(::Vector{Float64}) with eltype Float64:
10.8253 64.1205 89.7788 … 296.729 317.265 22.1889ScatteringTransform.getWavelets — Function
getWavelets(sc::stFlux; spaceDomain=false) -> wave1, wave2, wave3, ...Get the wavelets used in each layer. If spaceDomain is true, then it will also convert the filters from the stored positive Fourier representation to a space version.
ScatteringTransform.depth — Function
depth(s::scatteringTransform{Dim,Depth})given a scattering transform, return the number of layers Depth.
Base.ndims — Function
ndims(A::AbstractArray) -> IntegerReturn the number of dimensions of A.
Examples
julia> A = fill(1, (3,4,5));
julia> ndims(A)
3ndims(::AbstractDataFrame)
ndims(::Type{<:AbstractDataFrame})Return the number of dimensions of a data frame, which is always 2.
ndims(::DataFrameRow)
ndims(::Type{<:DataFrameRow})Return the number of dimensions of a data frame row, which is always 1.
ndims(s::scatteringTransform{D})given a scattering transform s, return the number of layers Depth.
ndims(sct::Scattered)return the input dimension size (also given by sct.k)
ndims(r::MaxPool{N,M})
ndims(r::MeanPool{N,M})return the dimension N of the input signal
Internal Utilities
ScatteringTransform.batchOff — Function
batchOff(stack, x, batchSize)transform x using stack, but where x and stack may have different batch sizes (the final dimension).
ScatteringTransform.normalize — Function
normalize(x, Nd) -> normedXnormalize x over the dimensions Nd through ndims(x)-1. For example, if Nd=2, and x is 4D, then norm(normedX[:,:,:,j], 2) ≈ size(normedX,3).
ScatteringTransform.processArgs — Function
processArgs(m, varargs) -> listVargsGo from arguments given to the scattering transform constructor to those for the wavelet or frame transform. listVargs is a list of length m of one argument from each of vargs, with insufficiently long entries filled in by repeating the last value. For a list of these arguments, see the documentation for stFlux.
Examples
julia> using ContinuousWavelets, ScatteringTransform
julia> varargs = ( :boundary => PerBoundary(), :frameBound => [1, 1], :normalization => (Inf, Inf))
(:boundary => PerBoundary(), :frameBound => [1, 1], :normalization => (Inf, Inf))
julia> varargs
(:boundary => PerBoundary(), :frameBound => [1, 1], :normalization => (Inf, Inf))
julia> listVargs = ScatteringTransform.processArgs(3,varargs)
(Base.Pairs{Int64, Pair{Symbol}, Base.OneTo{Int64}, Tuple{Pair{Symbol, ContinuousWavelets.PerBoundary}, Pair{Symbol, Vector{Int64}}, Pair{Symbol, Tuple{Float64, Float64}}}}(1 => (:boundary => PerBoundary()), 2 => (:frameBound => [1, 1]), 3 => (:normalization => (Inf, Inf))), Base.Pairs{Int64, Pair{Symbol}, Base.OneTo{Int64}, Tuple{Pair{Symbol, ContinuousWavelets.PerBoundary}, Pair{Symbol, Vector{Int64}}, Pair{Symbol, Tuple{Float64, Float64}}}}(1 => (:boundary => PerBoundary()), 2 => (:frameBound => [1, 1]), 3 => (:normalization => (Inf, Inf))), Base.Pairs{Int64, Pair{Symbol}, Base.OneTo{Int64}, Tuple{Pair{Symbol, ContinuousWavelets.PerBoundary}, Pair{Symbol, Vector{Int64}}, Pair{Symbol, Tuple{Float64, Float64}}}}(1 => (:boundary => PerBoundary()), 2 => (:frameBound => [1, 1]), 3 => (:normalization => (Inf, Inf))))
julia> listVargs[1]
pairs(::Tuple{Pair{Symbol, ContinuousWavelets.PerBoundary}, Pair{Symbol, Vector{Int64}}, Pair{Symbol, Tuple{Float64, Float64}}}) with 3 entries:
1 => :boundary=>PerBoundary()
2 => :frameBound=>[1, 1]
3 => :normalization=>(Inf, Inf)
julia> listVargs[2]
pairs(::Tuple{Pair{Symbol, ContinuousWavelets.PerBoundary}, Pair{Symbol, Vector{Int64}}, Pair{Symbol, Tuple{Float64, Float64}}}) with 3 entries:
1 => :boundary=>PerBoundary()
2 => :frameBound=>[1, 1]
3 => :normalization=>(Inf, Inf)
julia> listVargs[3]
pairs(::Tuple{Pair{Symbol, ContinuousWavelets.PerBoundary}, Pair{Symbol, Vector{Int64}}, Pair{Symbol, Tuple{Float64, Float64}}}) with 3 entries:
1 => :boundary=>PerBoundary()
2 => :frameBound=>[1, 1]
3 => :normalization=>(Inf, Inf)
ScatteringTransform.getParameters — Function
getParameters(st, s)given a scatteringTransform object and a symbol s representing a possible keyword, e.g. :Q, or :β, return the value for this transform. It may be in st.settings, or, if it is a default value, it is looked up.
ScatteringTransform.extractAddPadding — Function
extractAddPadding(x, adr, chunkSize, N)From x, extract the examples adr in the last dimension, and make sure that it has a size of chunkSize, padding if there are too few examples (this is to make sure the batch size matches).