MelWeightMatrix¶
MelWeightMatrix - 17¶
版本¶
域:
main
起始版本:
17
函数:
False
支持级别:
SupportType.COMMON
形状推断:
True
此版本的运算符自 版本 17 起可用。
摘要¶
生成一个 MelWeightMatrix,可用于将包含线性采样频率谱(来自 DFT 或 STFT)的张量,根据梅尔尺度上的 [lower_edge_hertz, upper_edge_hertz] 范围,重新加权为 num_mel_bins 频率信息。此函数根据以下公式定义赫兹频率的梅尔尺度
mel(f) = 2595 * log10(1 + f/700)
在返回的矩阵中,所有三角形(滤波器组)的峰值均为 1.0。
返回的 MelWeightMatrix 可用于右乘形状为 [frames, num_spectrogram_bins] 的线性尺度频谱值(例如 STFT 幅度)的频谱图 S,以生成形状为 [frames, num_mel_bins] 的“梅尔频谱图”M。
属性¶
输出数据类型 - INT(默认值为
'1'
)输出张量的数据类型。必须严格是 TensorProto 中 DataType 枚举的值之一,其值对应于 T3。默认值为 1 = FLOAT。
输入¶
num_mel_bins (异构) - T1
梅尔频谱中的频带数。
dft_length (异构) - T1
原始 DFT 的大小。原始 DFT 的大小用于推断单侧 DFT 的大小,其理解为 floor(dft_length/2) + 1,即频谱图只包含非冗余的 DFT 频段。
sample_rate (异构) - T1
用于创建频谱图的输入信号的每秒采样数。用于确定与每个频谱图频段对应的频率,这决定了它们如何映射到梅尔尺度。
lower_edge_hertz (异构) - T2
梅尔频谱中包含的频率的下限。这对应于最低三角形频带的下边缘。
upper_edge_hertz (异构) - T2
最高频带的所需上边缘。
输出¶
输出 (异构) - T3
梅尔权重矩阵。输出的形状为:[floor(dft_length/2) + 1][num_mel_bins]。
类型约束¶
T1 在 (
tensor(int32)
,tensor(int64)
) 中限制为整数张量。
T2 在 (
tensor(bfloat16)
,tensor(double)
,tensor(float)
,tensor(float16)
)限制为浮点张量
T3 在 (
tensor(bfloat16)
,tensor(double)
,tensor(float)
,tensor(float16)
,tensor(int16)
,tensor(int32)
,tensor(int64)
,tensor(int8)
,tensor(uint16)
,tensor(uint32)
,tensor(uint64)
,tensor(uint8)
)限制为任何数值类型。