Audio Utils#

namespace trt_edgellm
namespace rt
namespace audioUtils#

Variables

float kParakeetZScoreEps = 1e-5f#

Per-feature z-score epsilon for the parakeet log-mel normalise (HF ParakeetFeatureExtractor norm_eps == 1e-5). Matches the CPU MelExtractor’s per-feature epsilon (runtime/melSpectrogram.cpp).

struct ChunkInfo#
#include <audioUtils.h>

Chunk metadata for Qwen3-Omni audio preprocessing.

Public Members

int64_t numChunks#
std::vector<int64_t> chunkLengths#
std::vector<int64_t> chunkOffsets#
int64_t maxChunkLength#
struct FbankResourcesParakeet#
#include <audioUtils.h>

Persistent parakeet fbank resources, built once by NemotronOmniAudioRunner::initFbankResources and reused across clips. Every device tensor is allocated exactly once — the weight/table tensors at their natural shapes, the workspace below at the engine kMAX bound; per-clip steady state performs no device allocation — only a capacity-checked reshape of the workspace.

The scalar STFT/mel params are populated from the bound CPU MelExtractor’s MelExtractorConfig (single source of truth), except normEps, which is not a MelExtractorConfig field and comes from kParakeetZScoreEps above. initFbankResources validates the config is parakeet-spec before filling these.

Public Members

rt::Tensor melFilterFp16Kmajor#

[nMel, round_up(nFreq,16)] Half — Slaney weights, K-padded

rt::Tensor windowF32#

[nFft] Float — symmetric Hann (win_length) centered in nFft

rt::Tensor fftTwiddle#

[nFft, 2] Float — outer-stage W_512^k table

rt::Tensor framedF32#

[T_out, nFft] Float

rt::Tensor magFp16#

[N_pad, K_pad] Half — GEMM B-matrix

rt::Tensor melPowerF32#

[nMel, N_pad] Float — GEMM C-matrix (FP32, not FP16)

rt::Tensor mean#

[nMel] Float — per-feature ln mean

rt::Tensor invDenom#

[nMel] Float — per-feature 1/(std + eps)

int32_t nFft = {0}#

STFT size (== MelExtractorConfig::nFFT; kernels require 512)

int32_t hopLength = {0}#

STFT hop (== MelExtractorConfig::hopLength == 160)

int32_t centerPad = {0}#

center zero-pad each side (== nFft / 2 == 256)

int32_t nMel = {0}#

mel bins (== MelExtractorConfig::nMel == 128)

int32_t nFreq = {0}#

FFT bins == nFft / 2 + 1 == 257 (active K-window before K-pad)

int32_t maxFrames = {0}#

workspace capacity in mel frames (engine input_features kMAX bound)

float preemph = {0.0f}#

preemphasis coefficient (== 0.97)

float logGuard = {0.0f}#

natural-log input floor (== 2^-24)

float normEps = {0.0f}#

per-feature std epsilon (== kParakeetZScoreEps)