频谱
8 个节点
本页内容 8
绘制短时频谱
函数Draws a spectrogram: time across, frequency up, and how strong each frequency is at each moment as brightness.
绘制短时频谱 -> Pixel Image
频谱: Audio Spectrogram
宽度: 整数
高度: 整数PixelImage DrawTransform(
AudioSpectrogram spectrogram,
int width = 800,
int height = 300)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 频谱 | Audio Spectrogram | — | The transform. |
| 宽度 | 整数 | 800 | Pixels across. |
| 高度 | 整数 | 300 | Pixels up. |
返回
| 图像 | Pixel Image |
备注
Several channels are drawn as their average. Levels run from -100 dB, black, to 0 dB, white, through the same colours as Draw Spectrogram, so a band taken out shows as a dark stripe.
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 频谱
- 所属包
- 音频处理
逆变换
函数Puts a clip back together from its frequencies: the inverse short-time Fourier transform.
逆变换(频谱: Audio Spectrogram) -> AudioBuffer
AudioBuffer Inverse(AudioSpectrogram spectrogram)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 频谱 | Audio Spectrogram | — | The transform, changed or not. |
返回
| 音频 | AudioBuffer |
备注
Each frame is turned back into samples, windowed again and overlap-added, and the sum divided by how much window covers each sample. A spectrogram nothing has changed comes back as the clip it was taken from, to within float rounding.
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 频谱
- 所属包
- 音频处理
保留频段
函数Keeps only the frequencies from Low up to High.
保留频段 -> Audio Spectrogram
频谱: Audio Spectrogram
下限: 数字
上限: 数字AudioSpectrogram KeepBand(
AudioSpectrogram spectrogram,
double low = 300,
double high = 3000)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 频谱 | Audio Spectrogram | — | The transform. |
| 下限 | 数字 | 300 | The band's lower edge, in hertz. |
| 上限 | 数字 | 3000 | The band's upper edge, in hertz; above half the sample rate means everything from the lower edge up. |
返回
| 频谱 | Audio Spectrogram |
备注
A frequency is kept when its bin's centre lies in the band, low end included and high end not, and the rest are set to nothing. Keep Band and Remove Band with the same edges are exact complements: the two inverses add up to the clip.
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 频谱
- 所属包
- 音频处理
去除频段
函数Takes out the frequencies from Low up to High and keeps the rest.
去除频段 -> Audio Spectrogram
频谱: Audio Spectrogram
下限: 数字
上限: 数字AudioSpectrogram RemoveBand(
AudioSpectrogram spectrogram,
double low = 300,
double high = 3000)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 频谱 | Audio Spectrogram | — | The transform. |
| 下限 | 数字 | 300 | The band's lower edge, in hertz. |
| 上限 | 数字 | 3000 | The band's upper edge, in hertz. |
返回
| 频谱 | Audio Spectrogram |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 频谱
- 所属包
- 音频处理
分离谐波与打击
函数Divides a clip into what holds steady - notes, chords, sustained voices - and what is brief and broad - drums, clicks, consonants.
分离谐波与打击 -> (谐波: AudioBuffer, 打击: AudioBuffer)
音频: AudioBuffer
中值窗: 整数
幂次: 数字
帧长: 整数
帧移: 整数void SeparateHarmonicPercussive(
AudioBuffer audio,
out AudioBuffer harmonic,
out AudioBuffer percussive,
int kernel = 31,
double power = 2,
int frameSize = 2048,
int hop = 512)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 音频 | AudioBuffer | — | The clip. |
| 中值窗 | 整数 | 31 | How many frames, and frequencies, each median spans; odd. Wider separates more firmly and smears more. |
| 幂次 | 数字 | 2 | How firmly each frequency is given to one side: 1 shares in proportion, 2 is librosa's default, higher approaches all or nothing. |
| 帧长 | 整数 | 2048 | Samples per frame, as Short-Time Transform takes it. |
| 帧移 | 整数 | 512 | Samples between frames, as Short-Time Transform takes it. |
返回
| 谐波 | AudioBuffer |
| 打击 | AudioBuffer |
备注
Fitzgerald's median-filtering method, as librosa's decompose.hpss computes it: across time the steady parts stand out, across frequency the sharp ones do, and each frequency at each moment is shared between the two in proportion. The shares add to one everywhere, so the two parts mixed together are the clip.
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 频谱
- 所属包
- 音频处理
拆分频段
函数Divides a clip into frequency bands - lows, mids, highs, or as many as the edges make - which add back up to the clip.
拆分频段 -> AudioBuffer 数组
音频: AudioBuffer
分界: 数字数组
帧长: 整数
帧移: 整数AudioBuffer[] SplitIntoBands(
AudioBuffer audio,
double[] edges,
int frameSize = 2048,
int hop = 512)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 音频 | AudioBuffer | — | The clip. |
| 分界 | 数字数组 | — | Where one band ends and the next begins, in hertz, rising. |
| 帧长 | 整数 | 2048 | Samples per frame, as Short-Time Transform takes it. |
| 帧移 | 整数 | 512 | Samples between frames, as Short-Time Transform takes it. |
返回
| 频段 | AudioBuffer 数组 |
备注
Edges at 250 and 4000 Hz give three clips: everything below 250 Hz, 250 to 4000 Hz, and everything above. Every frequency lands in exactly one band, so Mix All of the bands is the clip again.
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 频谱
- 所属包
- 音频处理
最强频率
函数The frequencies a clip holds most of - its constituents, strongest first, each with its level and the note nearest it.
最强频率(音频: AudioBuffer, 数量: 整数) -> Table
Table StrongestFrequencies(AudioBuffer audio, int count = 10)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 音频 | AudioBuffer | — | The clip. |
| 数量 | 整数 | 10 | How many to list. |
返回
| 频率 | Table |
备注
Peaks of the clip's averaged spectrum, each placed between bins by fitting a parabola to it and its neighbours. A peak within a semitone of a stronger one is the same constituent's skirt and is left out.
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 频谱
- 所属包
- 音频处理
短时傅里叶变换
函数Takes a clip apart into its frequencies over time: the short-time Fourier transform.
短时傅里叶变换 -> Audio Spectrogram
音频: AudioBuffer
帧长: 整数
帧移: 整数AudioSpectrogram Transform(
AudioBuffer audio,
int frameSize = 2048,
int hop = 512)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 音频 | AudioBuffer | — | The clip. |
| 帧长 | 整数 | 2048 | Samples per frame, a power of two from 64 to 32768: larger tells close frequencies apart, smaller places changes more exactly in time. |
| 帧移 | 整数 | 512 | Samples from one frame to the next, at most a quarter of the frame so the frames overlap enough to rebuild the clip. |
返回
| 频谱 | Audio Spectrogram |
备注
Each channel is cut into Hann-windowed frames of Frame Size samples, one every Hop, and each frame becomes the amplitude and phase of every frequency in it. The clip is padded with half a frame of silence at each end, as librosa and SciPy do, so its first and last moments come back too.
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 频谱
- 所属包
- 音频处理