Class FFT

This private class visualizes spectrum.

Hierarchy (view full)

Constructors

Properties

canvas: null | HTMLCanvasElement = null
channel: ChannelNumber
context: null | CanvasRenderingContext2D = null
graphics: GraphicsApi = ''
interval: number = 1000
isActive: boolean = false
sampleRate: number
styles: GraphicsStyles = ...
svg: null | SVGSVGElement = null
SVG_LINEAR_GRADIENT_ID_FFT: string = 'svg-linear-gradient-fft'
SVG_LINEAR_GRADIENT_ID_TIME: string = 'svg-linear-gradient-time'
SVG_LINEAR_GRADIENT_ID_TIME_OVERVIEW: string = 'svg-linear-gradient-time-overview'
XLINK: "http://www.w3.org/1999/xlink" = ...
XMLNS: "http://www.w3.org/2000/svg" = ...

Methods

  • This method creates elements for SVG linear gradient.

    Parameters

    • linearGradientId: string

      This argument is id attribute for SVGLinearGradientElement.

    Returns null | SVGDefsElement

    This value is as instance of SVGDefsElement.

  • This method gets or sets parameters for visualizing spectrum. This method is overloaded for type interface and type check.

    Parameters

    • params: "interval"

      This argument is string if getter. Otherwise, setter.

    Returns number

    Return value is parameter for visualizing spectrum if getter. Otherwise, return value is for method chain.

  • This method gets or sets parameters for visualization. This method is overloaded for type interface and type check.

    Parameters

    • params: "styles"

      This argument is string if getter. Otherwise, setter.

    Returns GraphicsStyles

    Return value is parameter for visualization if getter.

  • This method gets or sets parameters for visualization. This method is overloaded for type interface and type check.

    Parameters

    • params: "type"

      This argument is string if getter. Otherwise, setter.

    Returns DataType

    Return value is parameter for visualization if getter.

  • This method gets or sets parameters for visualization. This method is overloaded for type interface and type check.

    Parameters

    • params: "size"

      This argument is string if getter. Otherwise, setter.

    Returns number

    Return value is parameter for visualization if getter.

  • This method gets or sets parameters for visualization. This method is overloaded for type interface and type check.

    Parameters

    • params: "textInterval"

      This argument is string if getter. Otherwise, setter.

    Returns number

    Return value is parameter for visualization if getter.

  • This method gets or sets parameters for visualization. This method is overloaded for type interface and type check.

    Parameters

    • params: "scale"

      This argument is string if getter. Otherwise, setter.

    Returns SpectrumScale

    Return value is parameter for visualization if getter.

  • This method gets or sets parameters for visualization. This method is overloaded for type interface and type check.

    Parameters

    • params: "minFrequency"

      This argument is string if getter. Otherwise, setter.

    Returns number

    Return value is parameter for visualization if getter.

  • This method gets or sets parameters for visualization. This method is overloaded for type interface and type check.

    Parameters

    • params: "maxFrequency"

      This argument is string if getter. Otherwise, setter.

    Returns number

    Return value is parameter for visualization if getter.

  • This method gets or sets parameters for visualization. This method is overloaded for type interface and type check.

    Parameters

    • params: FFTParams

      This argument is string if getter. Otherwise, setter.

    Returns FFT

    Return value is parameter for visualization if getter.

  • This method visualizes sound wave to Canvas or SVG. This method conceals difference of API for visualization.

    Parameters

    • data: Float32Array | Uint8Array

      This argument is sound data for visualization.

    • OptionalminDecibels: number

      This argument is parameter for spectrum. The default value is -100 dB.

    • OptionalmaxDecibels: number

      This argument is parameter for spectrum. The default value is -30 dB.

    Returns Visualizer

    Return value is for method chain.

  • This method visualizes spectrum to SVG.

    Parameters

    • data: Float32Array | Uint8Array

      This argument is frequency domain data for spectrum.

    • OptionalminDecibels: number

      This argument is in order to determine dB range of spectrum. Default value is -100 dB.

    • OptionalmaxDecibels: number

      This argument is in order to determine db range of spectrum. Default value is -30 dB.

    Returns void

  • This method visualizes spectrum to Canvas.

    Parameters

    • data: Float32Array | Uint8Array

      This argument is frequency domain data for spectrum.

    • OptionalminDecibels: number

      This argument is in order to determine dB range of spectrum. The default value is -100 dB.

    • OptionalmaxDecibels: number

      This argument is in order to determine db range of spectrum. The default value is -30 dB.

    Returns void

  • This method visualizes time domain data (Float32Array) to SVG.

    Parameters

    • data: Float32Array

      This argument is time domain data.

    • innerWidth: number

      This argument is width of visualization area.

    • innerHeight: number

      This argument is height of visualization area.

    • middle: number

      This argument is middle of visualization area.

    • numberOfPlots: number

      This argument is interval for visualization.

    • linearGradientId: string

      This argument is id attribute for SVGLinearGradientElement.

    Returns null | SVGPathElement | SVGGElement

    This value is instance of SVGPathElement or SVGGElement.

  • This method visualizes time domain data (Float32Array) to Canvas.

    Parameters

    • context: CanvasRenderingContext2D

      This argument is instance of CanvasRenderingContext2D.

    • data: Float32Array

      This argument is time domain data.

    • innerWidth: number

      This argument is width of visualization area.

    • innerHeight: number

      This argument is height of visualization area.

    • middle: number

      This argument is middle of visualization area.

    • OptionalnumberOfPlots: number

      This argument is interval for visualization.

    Returns void