Skip to content

signal.AdaptiveStft.Function.getSingle_relWindow

Christian d'Heureuse edited this page Jun 7, 2026 · 2 revisions

dsp-collection / signal/AdaptiveStft / getSingle_relWindow

Function: getSingle_relWindow()

function getSingle_relWindow(
   samples, 
   roughFrequency, 
   roughWindowCenterPosition, 
   relWindowWidth, 
   windowFunction): 
  | ComponentResult
  | undefined;

Defined in: signal/AdaptiveStft.ts:45

Computes a short time fourier transform for a single sine wave component, by using a window size that corresponds to a fixed number of oscillation cycles.

The window is defined by its center position, the number of oscillation cycles and the frequency.

Parameters

samples

Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>

The input signal.

roughFrequency

number

The rough frequency of the sine wave component to be computed. The specified value is adjusted to the nearest value that allows a computation without subsampling. The unit of the specified frequency value is 1/samples (normalized frequency).

roughWindowCenterPosition

number

The rough center position of the window (in sample positions).

relWindowWidth

number

Window width relative the the wavelength. An integer specifying the number of oscillation cycles to be used for the window width.

windowFunction

| WindowFunction | undefined

A window function or undefined for no windowing (i.e. for using a rectangular window).

Returns

| ComponentResult | undefined

The result structure, or undefined if the result cannot be computed.

Clone this wiki locally