Internals

Functions here are not exported.

DSP.os_fft_complexityFunction

Estimate the number of floating point multiplications per output sample for an overlap-save algorithm with fft size nfft, and filter size nb.

source
DSP.os_prepare_convFunction

Prepare buffers and FFTW plans for convolution. The two buffers, tdbuff and fdbuff may be an alias of each other, because complex convolution only requires one buffer. The plans are mutating where possible, and the inverse plan is unnormalized.

source
DSP.os_conv_block!Function

Take a block of data, and convolve it with the smaller convolution input. This may modify the contents of tdbuff and fdbuff, and the result will be in tdbuff.

source

Like the real version, but only operates on one buffer

source
DSP.os_filter_transform!Function

Transform the smaller convolution input to frequency domain, and return it in a new array. However, the contents of buff may be modified.

source
DSP.Windows.makewindowFunction
makewindow(winfunc::Function, n::Integer, padding::Integer, zerophase::Bool)

Generate a discrete window vector of the given length with padding zeros. winfunc should be a function giving the window value in the range of [-0.5, 0.5]. The function is assumed to be 0 outside of this range.

If zerophase is false (the default) the window is centered around index (n+1)/2, which is commonly used for FIR filter design. These are often used for FIR filter design, and usually odd-length. Note that for even-length windows this will cause the window center to be located between samples.

If zerophase is true the window is centered around index 1 (with the negative half wrapped to the end of the vector). Additionally this creates a "periodic" window, which means that if there is no padding then the left and right endpoints of the window wrap around to the same sample, so the window length is the same as an n+1-length non-zerophase window. Alternatively you can think of the continuous zerophase window being of width n and the non-zerophase window being of length n-1. zerophase windows are often used in FFT processing, and are usually even-length.

Example:

function hanning(n::Integer; padding::Integer=0, zerophase::Bool=false)
    makewindow(n, padding, zerophase) do x
        0.5*(1+cos(2pi*x))
    end
end
source
DSP.Windows.padplotFunction
padplot(plotstr)

Takes a multiline string and pre-pads it so that it shows up as preformatted code when included in a docstring.

source
DSP._zeropadFunction
_zeropad(u, padded_size, [data_dest, data_region])

Creates and returns a new base-1 index array of size padded_size, with the section of u specified by data_region copied into the region of the new array as specified by data_dest. All other values will be initialized to zero.

If either data_dest or data_region is not specified, then the defaults described in _zeropad! will be used.

source
DSP._zeropad!Function
_zeropad!(padded::AbstractVector,
          u::AbstractVector,
          padded_axes = axes(padded),
          data_dest::Tuple = (1,),
          data_region = CartesianIndices(u))

Place the portion of u specified by data_region into padded, starting at location data_dest. Sets the rest of padded to zero. This will mutate padded. padded_axes must correspond to the axes of padded.

source
DSP.Filters._polyprepFunction
_polyprep(D::Symbol, x::Union{T,Vector{T}}, ::Type) where {T<:Number}

Converts x to polynomial form. If x is a Number, it has to be converted into a Vector, otherwise LaurentPolynomial dispatch goes into stack overflow trying to collect a 0-d array into a Vector.

Warning

The DSP convention for Laplace domain is highest power first.

The Polynomials.jl convention is lowest power first.

source
DSP.Filters.freq_evalFunction
function freq_eval(xf, x::AbstractVector, y::AbstractVector, ad::AbstractVector)

FUNCTION: freq_eval (gee) FUNCTION TO EVALUATE THE FREQUENCY RESPONSE USING THE LAGRANGE INTERPOLATION FORMULA IN THE BARYCENTRIC FORM


source
DSP.Filters.lagrange_interpFunction
lagrange_interp(k::Integer, n::Integer, m::Integer, x::AbstractVector)

CALCULATE THE LAGRANGE INTERPOLATION COEFFICIENTS

source
DSP.Periodograms.coherence_from_cs!Function
coherence_from_cs!(output::AbstractArray, cs_matrix)

Compute the pairwise channel coherences from a cross spectral matrix, storing the result in output.

source
DSP.optimalfftfiltlengthFunction

Determine the length of FFT that minimizes the number of multiplications per output sample for an overlap-save convolution of vectors of size nb and nx.

source