Package

breeze

signal

Permalink

package signal

This package provides digital signal processing functions.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. signal
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract class OptDesignMethod extends Opt

    Permalink
  2. abstract class OptFilterTaps extends Opt

    Permalink
  3. abstract class OptMethod extends Opt

    Permalink

    Option values: how to deal with convolution and filter padding.

  4. abstract class OptOverhang extends Opt

    Permalink

    Option values: how to deal with convolution overhangs.

  5. abstract class OptPadding extends Opt

    Permalink

    Option values: how to deal with convolution and filter padding.

  6. abstract class OptRange extends Opt

    Permalink

    slices specific result ranges out of results for convolve, etc

  7. abstract class OptWindowFunction extends Opt

    Permalink

    Option values: window function for filter design.

Value Members

  1. object JavaCompatible

    Permalink

    This class is a converter for using breeze.signal functions on Arrays of Double and Complex, from Java/Matlab/Mathematica.

  2. object OptDesignMethod

    Permalink
  3. object OptFilterTaps

    Permalink
  4. object OptMethod

    Permalink
  5. object OptOverhang

    Permalink
  6. object OptPadding

    Permalink
  7. object OptRange

    Permalink
  8. object OptWindowFunction

    Permalink
  9. def convolve[Input, KernelType, Output](data: Input, kernel: KernelType, range: OptRange = OptRange.All, overhang: OptOverhang = OptOverhang.None, padding: OptPadding = OptPadding.Zero, method: OptMethod = OptMethod.Automatic)(implicit canConvolve: CanConvolve[Input, KernelType, Output]): Output

    Permalink

    Convolves DenseVectors.

    Convolves DenseVectors. Implementation is via the implicit trait CanConvolve[ InputType, OutputType ], which is found in breeze.signal.support.CanConvolve.scala.

    data

    DenseVector or DenseMatrix to be convolved

    kernel

    DenseVector or DenseMatrix kernel

    canConvolve

    implicit delegate which is used for implementation. End-users should not use this argument.

  10. def correlate[Input, KernelType, Output](data: Input, kernel: KernelType, range: OptRange = OptRange.All, overhang: OptOverhang = OptOverhang.None, padding: OptPadding = OptPadding.Zero, method: OptMethod = OptMethod.Automatic)(implicit canConvolve: CanConvolve[Input, KernelType, Output]): Output

    Permalink

    Correlates DenseVectors.

    Correlates DenseVectors. Implementation is via the implicit trait CanConvolve[ InputType, OutputType ], which is found in breeze.signal.support.CanConvolve.scala. See breeze.signal.convolve for options and other information.

  11. def designFilterDecimation[Output](factor: Int, multiplier: Double = 1d, optDesignMethod: OptDesignMethod = OptDesignMethod.Firwin, optWindow: OptWindowFunction = OptWindowFunction.Hamming(), optFilterOrder: OptFilterTaps = OptFilterTaps.Automatic)(implicit canDesignFilterDecimation: CanDesignFilterDecimation[Output]): Output

    Permalink
  12. def designFilterFirwin[Output](taps: Int, omegas: DenseVector[Double], nyquist: Double = 1d, zeroPass: Boolean = true, scale: Boolean = true, multiplier: Double = 1d, optWindow: OptWindowFunction = OptWindowFunction.Hamming())(implicit canFirwin: CanFirwin[Output]): FIRKernel1D[Output]

    Permalink

    FIR filter design using the window method.

    FIR filter design using the window method.

    This function computes the coefficients of a finite impulse response filter. The filter will have linear phase; it will be Type I if numtaps is odd and Type II if numtaps is even.

    Type II filters always have zero response at the Nyquist rate, so a ValueError exception is raised if firwin is called with numtaps even and having a passband whose right end is at the Nyquist rate.

    Portions of the code are translated from scipy (scipy.org) based on provisions of the BSD license.

    omegas

    Cutoff frequencies of the filter, specified in units of "nyquist." The frequencies should all be positive and monotonically increasing. The frequencies must lie between (0, nyquist). 0 and nyquist should not be included in this array.

    nyquist

    The nyquist frequency, default is 1.

    zeroPass

    If true (default), the gain at frequency 0 (ie the "DC gain") is 1, if false, 0.

    scale

    Whether to scale the coefficiency so that frequency response is unity at either (A) 0 if zeroPass is true or (B) at nyquist if the first passband ends at nyquist, or (C) the center of the first passband. Default is true.

    optWindow

    Currently supports a hamming window breeze.signal.OptWindowFunction.Hamming, a specified window breeze.signal.OptWindowFunction.User, or no window breeze.signal.OptWindowFunction.None.

  13. def filter[Input, Kernel, Output](data: Input, kernel: Kernel, overhang: OptOverhang = OptOverhang.PreserveLength, padding: OptPadding = OptPadding.Zero)(implicit canFilter: CanFilter[Input, Kernel, Output]): Output

    Permalink

    Filter input data with the specified kernel and options.

    Filter input data with the specified kernel and options.

    data

    data to be filtered

    kernel

    filter kernel (argument of DenseVector[Double] will specify a FIR kernel with specified values).

    overhang

    whether to have overhanging values. See breeze.signal.OptOverhang

    padding

    how to pad the values. See breeze.signal.OptPadding

    canFilter

    (implicit delegate to perform filtering on specific Input data types)

  14. def filterBP[Input, Output](data: Input, omegas: (Double, Double), sampleRate: Double = 2d, taps: Int = 512, kernelDesign: OptDesignMethod = OptDesignMethod.Firwin, overhang: OptOverhang = OptOverhang.None, padding: OptPadding = OptPadding.Boundary)(implicit canFilterBPBS: CanFilterBPBS[Input, Output]): Output

    Permalink

    Bandpass filter the input data.

    Bandpass filter the input data.

    data

    data to be filtered

    omegas

    sequence of two filter band parameters, in units of the Nyquist frequency, or in Hz if the sampleRate is set to a specific value other than 2d.

    sampleRate

    default of 2.0 means that the Nyquist frequency is 1.0

    taps

    number of taps to use (default = 512)

    kernelDesign

    currently only supports OptKernelType.Firwin. See breeze.signal.OptDesignMethod

    overhang

    whether to have overhanging values when filtering. See breeze.signal.OptOverhang

    padding

    how to pad the values when filtering. See breeze.signal.OptPadding

    canFilterBPBS

    (implicit delegate to perform filtering on specific Input data types)

  15. def filterBS[Input, Output](data: Input, omegas: (Double, Double), sampleRate: Double = 2d, taps: Int = 512, kernelDesign: OptDesignMethod = OptDesignMethod.Firwin, overhang: OptOverhang = OptOverhang.None, padding: OptPadding = OptPadding.Boundary)(implicit canFilterBPBS: CanFilterBPBS[Input, Output]): Output

    Permalink

    Bandstop filter the input data.

    Bandstop filter the input data.

    data

    data to be filtered

    omegas

    sequence of two filter band parameters, in units of the Nyquist frequency, or in Hz if the sampleRate is set to a specific value other than 2d.

    sampleRate

    default of 2.0 means that the Nyquist frequency is 1.0

    taps

    number of taps to use (default = 512)

    kernelDesign

    currently only supports OptKernelType.Firwin. See breeze.signal.OptDesignMethod

    overhang

    whether to have overhanging values when filtering. See breeze.signal.OptOverhang

    padding

    how to pad the values when filtering. See breeze.signal.OptPadding

    canFilterBPBS

    (implicit delegate to perform filtering on specific Input data types)

  16. def filterHP[Input, Output](data: Input, omega: Double, sampleRate: Double = 2d, taps: Int = 512, kernelDesign: OptDesignMethod = OptDesignMethod.Firwin, overhang: OptOverhang = OptOverhang.None, padding: OptPadding = OptPadding.Boundary)(implicit canFilterLPHP: CanFilterLPHP[Input, Output]): Output

    Permalink

    Highpass filter the input data.

    Highpass filter the input data.

    data

    data to be filtered

    omega

    cutoff frequency, in units of the Nyquist frequency, or in Hz if the sampleRate is set to a specific value other than 2d.

    sampleRate

    default of 2.0 means that the Nyquist frequency is 1.0

    taps

    number of taps to use (default = 512)

    kernelDesign

    currently only supports OptKernelType.Firwin. See breeze.signal.OptDesignMethod

    overhang

    whether to have overhanging values when filtering. See breeze.signal.OptOverhang

    padding

    how to pad the values when filtering. See breeze.signal.OptPadding

    canFilterLPHP

    (implicit delegate to perform filtering on specific Input data types)

  17. def filterLP[Input, Output](data: Input, omega: Double, sampleRate: Double = 2d, taps: Int = 512, kernelDesign: OptDesignMethod = OptDesignMethod.Firwin, overhang: OptOverhang = OptOverhang.None, padding: OptPadding = OptPadding.Boundary)(implicit canFilterLPHP: CanFilterLPHP[Input, Output]): Output

    Permalink

    Lowpass filter the input data.

    Lowpass filter the input data.

    data

    data to be filtered

    omega

    cutoff frequency, in units of the Nyquist frequency, or in Hz if the sampleRate is set to a specific value other than 2d.

    sampleRate

    default of 2.0 means that the Nyquist frequency is 1.0

    taps

    number of taps to use (default = 512)

    kernelDesign

    currently only supports OptKernelType.Firwin. See breeze.signal.OptDesignMethod

    overhang

    whether to have overhanging valueswhen filtering. See breeze.signal.OptOverhang

    padding

    how to pad the values when filtering. See breeze.signal.OptPadding

    canFilterLPHP

    (implicit delegate to perform filtering on specific Input data types)

  18. def filterMedian[Input](data: DenseVector[Input], windowLength: Int)(implicit canFilterMedian: CanFilterMedian[Input]): DenseVector[Input]

    Permalink
  19. def filterMedian[Input](data: DenseVector[Input], windowLength: Int, overhang: OptOverhang = OptOverhang.PreserveLength)(implicit canFilterMedian: CanFilterMedian[Input]): DenseVector[Input]

    Permalink

    Median filter the input data.

    Median filter the input data.

    windowLength

    only supports odd windowLength values, since even values would cause half-frame time shifts in one or the other direction, and would also lead to floating point values even for integer input

    overhang

    specify OptOverhang.PreserveLength (default) or OptOverhang.None (result will be (windowLength -1) shorter) for OptOverhang.PreserveLength, the edges will feature symmetrical odd windows of increasing size, ie ( median( {0} ), median( {0, 1, 2} ), median( {0, 1, 2, 3, 4} )... )

  20. def fourierFreq(windowLength: Int, fs: Double = 1, dt: Double = 1, shifted: Boolean = false): DenseVector[Double]

    Permalink

    Returns the frequencies for each tap in a discrete Fourier transform, useful for plotting.

    Returns the frequencies for each tap in a discrete Fourier transform, useful for plotting. You must specify either an fs or a dt argument. If you specify both, which is redundant, fs == 1.0/dt must be true.

    f = [0, 1, ..., n/2-1, -n/2, ..., -1] / (dt*n) if n is even f = [0, 1, ..., (n-1)/2, -(n-1)/2, ..., -1] / (dt*n) if n is odd

    windowLength

    window length of discrete Fourier transform

    fs

    sampling frequency (1.0/dt; specify default of -1 if using dt)

    dt

    time step (CAUTION: 1.0/fs; specify default of -1 if using fs)

    shifted

    whether to return fourierShift'ed frequencies, default=false

  21. object fourierShift extends UFunc

    Permalink

    Shift the zero-frequency component to the center of the spectrum.

    Shift the zero-frequency component to the center of the spectrum. This function swaps half-spaces for all axes listed (defaults to all). Note that y[0] is the Nyquist component only if len(x) is even.

  22. object fourierTr extends UFunc

    Permalink

    Returns the discrete fourier transform of a DenseVector or DenseMatrix.

    Returns the discrete fourier transform of a DenseVector or DenseMatrix. Currently, DenseVector/DenseMatrix types of Double and Complex are supported. Scaling follows the common signal processing convention, i.e. no scaling on forward DFT, and 1/n scaling for the inverse DFT. Of note, fft(x: DenseMatrix[Double]) will perform the 2D fft in both row and column dimensions, as opposed to the MatLab toolbox syntax, which performs column-wise 1D fft. Implementation is via the implicit trait fft.Impl[ InputType, OutputType ], which is found in breeze.signal.support.fft.Impl.scala.

  23. def haarTr[Input, Output](v: Input)(implicit canHaarTransform: CanHaarTr[Input, Output]): Output

    Permalink

    Return the padded fast haar transformation of a DenseVector or DenseMatrix.

    Return the padded fast haar transformation of a DenseVector or DenseMatrix. Note that the output will always be padded to a power of 2. A matrix will cause a 2D fht. The 2D haar transformation is defined for squared power of 2 matrices. A new matrix will thus be created and the old matrix will be placed in the upper-left part of the new matrix. Avoid calling this method with a matrix that has few cols / many rows or many cols / few rows (e.g. 1000000 x 3) as this will cause a very high memory consumption.

    v

    DenseVector or DenseMatrix to be transformed.

    canHaarTransform

    implicit delegate which is used for implementation. End-users should not use this argument.

    returns

    DenseVector or DenseMatrix

    See also

    https://en.wikipedia.org/wiki/Haar_wavelet

  24. object iFourierShift extends UFunc

    Permalink

    Inverse shift the zero-frequency component to the center of the spectrum.

    Inverse shift the zero-frequency component to the center of the spectrum. For odd sequences, this is not equivalent to breeze.signal.fourierShift

  25. object iFourierTr extends UFunc

    Permalink

    Returns the inverse fast fourier transform of a DenseVector or DenseMatrix.

    Returns the inverse fast fourier transform of a DenseVector or DenseMatrix. Currently, DenseVector/DenseMatrix types of Double and Complex are supported. Scaling follows the common signal processing convention, i.e. no scaling on forward DFT, and 1/n scaling for the inverse DFT. Of note, ifft(x: DenseMatrix[Double]) will perform the 2D ifft in both row and column dimensions, as opposed to the MatLab toolbox syntax, which performs column-wise 1D ifft. Implementation is via the implicit trait CanIFFT[ InputType, OutputType ], which is found in breeze.signal.support.CanIFFT.scala.

  26. def iHaarTr[Input, Output](v: Input)(implicit canInverseHaarTransform: CanIHaarTr[Input, Output]): Output

    Permalink

    Returns the inverse fast haar transform for a DenseVector or DenseMatrix.

  27. object rootMeanSquare extends UFunc

    Permalink

    Root mean square of a vector.

  28. package support

    Permalink

Deprecated Value Members

  1. val fft: fourierTr.type

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version v.0.6) use fourierTr

  2. val fourierTransform: fourierTr.type

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version v.0.6) use fourierTr

  3. def haarTransform[Input, Output](v: Input)(implicit canHaarTransform: CanHaarTr[Input, Output]): Output

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version v.0.6) use haarTr

  4. val ifft: iFourierTr.type

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version v.0.6) use iFourierTr

  5. val inverseFourierTransform: iFourierTr.type

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version v.0.6) use iFourierTr

  6. def inverseHaarTransform[Input, Output](v: Input)(implicit canInverseHaarTransform: CanIHaarTr[Input, Output]): Output

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version v.0.6) use iHaarTr

Inherited from AnyRef

Inherited from Any

Ungrouped