module onnxrt.ops_cpu.op_stft#

Inheritance diagram of mlprodict.onnxrt.ops_cpu.op_stft

Short summary#

module mlprodict.onnxrt.ops_cpu.op_stft

Runtime operator.

source on GitHub

Classes#

class

truncated documentation

STFT

STFT ==== Computes the Short-time Fourier Transform of the signal. Attributes

Functions#

function

truncated documentation

_concat

_istft

Reverses of stft.

_stft

Applies one dimensional FFT with window weights. torch defines the number of frames as: n_frames = 1 + (len - n_fft) / hop_length. …

_switch_axes

_unsqueeze

Properties#

property

truncated documentation

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default_modified

Returns the list of modified parameters.

args_mandatory

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

atts_value

Returns all parameters in a dictionary.

Methods#

method

truncated documentation

__init__

_run

Documentation#

Runtime operator.

source on GitHub

class mlprodict.onnxrt.ops_cpu.op_stft.STFT(onnx_node, desc=None, **options)#

Bases: OpRun

Computes the Short-time Fourier Transform of the signal.

Attributes

  • onesided: If onesided is 1, only values for w in [0, 1, 2, …, floor(n_fft/2) + 1] are returned because the real-to-complex Fourier transform satisfies the conjugate symmetry, i.e., X[m, w] = X[m,w]=X[m,n_fft-w]*. Note if the input or window tensors are complex, then onesided output is not possible. Enabling onesided with real inputs performs a Real-valued fast Fourier transform (RFFT).When invoked with real or complex valued input, the default value is 1. Values can be 0 or 1. Default value is nameonesidedi1typeINT (INT)

Inputs

Between 2 and 4 inputs.

  • signal (heterogeneous)T1: Input tensor representing a real or complex valued signal. For real input, the following shape is expected: [batch_size][signal_length][1]. For complex input, the following shape is expected: [batch_size][signal_length][2], where [batch_size][signal_length][0] represents the real component and [batch_size][signal_length][1] represents the imaginary component of the signal.

  • frame_step (heterogeneous)T2: The number of samples to step between successive DFTs.

  • window (optional, heterogeneous)T1: A tensor representing the window that will be slid over the signal.The window must have rank 1 with shape: [window_shape]. It’s an optional value.

  • frame_length (optional, heterogeneous)T2: A scalar representing the size of the DFT. It’s an optional value.

Outputs

  • output (heterogeneous)T1: The Short-time Fourier Transform of the signals.If onesided is 1, the output has the shape: [batch_size][frames][dft_unique_bins][2], where dft_unique_bins is frame_length // 2 + 1 (the unique components of the DFT) If onesided is 0, the output has the shape: [batch_size][frames][frame_length][2], where frame_length is the length of the DFT.

Type Constraints

  • T1 tensor(float), tensor(float16), tensor(double), tensor(bfloat16): Constrain signal and output to float tensors.

  • T2 tensor(int32), tensor(int64): Constrain scalar length types to int64_t.

Version

Onnx name: STFT

This version of the operator has been available since version 17.

Runtime implementation: STFT

__init__(onnx_node, desc=None, **options)#
_run(x, frame_step, window=None, frame_length=None, attributes=None, verbose=0, fLOG=None)#

Should be overwritten.

source on GitHub

mlprodict.onnxrt.ops_cpu.op_stft._concat(*args, axis=0)#
mlprodict.onnxrt.ops_cpu.op_stft._istft(x, fft_length, hop_length, window, onesided=False)#

Reverses of stft.

source on GitHub

mlprodict.onnxrt.ops_cpu.op_stft._stft(x, fft_length, hop_length, n_frames, window, onesided=False)#

Applies one dimensional FFT with window weights. torch defines the number of frames as: n_frames = 1 + (len - n_fft) / hop_length.

source on GitHub

mlprodict.onnxrt.ops_cpu.op_stft._switch_axes(a, ax1, ax2)#
mlprodict.onnxrt.ops_cpu.op_stft._unsqueeze(a, axis)#