元编程参考文档

信号处理

25 个节点

本页内容 25

应用滤波器

函数

Runs a clip through a filter, once, forward - the way any real-time filter would.

签名
应用滤波器 -> AudioBuffer
    音频: AudioBuffer
    滤波器: Digital Filter
AudioBuffer ApplyFilter(AudioBuffer audio, DigitalFilter filter)

参数

名称类型默认值说明
音频AudioBuffer—The clip.
滤波器Digital Filter—A filter designed at the clip's sample rate.

返回

音频AudioBuffer
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

应用零相位滤波器

函数

Runs a clip through a filter forward and then backward, so nothing is delayed or phase-shifted and the magnitude response is squared - MATLAB's filtfilt.

签名
应用零相位滤波器 -> AudioBuffer
    音频: AudioBuffer
    滤波器: Digital Filter
AudioBuffer ApplyZeroPhaseFilter(
    AudioBuffer audio,
    DigitalFilter filter)

参数

名称类型默认值说明
音频AudioBuffer—The clip.
滤波器Digital Filter—A filter designed at the clip's sample rate.

返回

音频AudioBuffer
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

音频特征

函数

A table of the features audio analysis starts from, one row per frame: level, zero-crossing rate, spectral centroid, spread, rolloff, flatness and flux, and the MFCCs - ready for statistics, plotting or a classifier.

签名
音频特征 -> Table
    音频: AudioBuffer
    帧大小: 整数
    跳步: 整数
    系数数: 整数
Table AudioFeatures(
    AudioBuffer audio,
    int frameSize = 2048,
    int hop = 512,
    int coefficients = 13)

参数

名称类型默认值说明
音频AudioBuffer—The clip; several channels are averaged.
帧大小整数2048Samples per frame, a power of two.
跳步整数512Samples between frames.
系数数整数13How many MFCC columns to add; 0 for none.

返回

特征Table
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

互相关

函数

How alike two clips are at every relative shift - their cross-correlation - MATLAB's xcorr.

签名
互相关(A: AudioBuffer, B: AudioBuffer) -> Table
Table CrossCorrelate(AudioBuffer a, AudioBuffer b)

参数

名称类型默认值说明
AAudioBuffer—The first clip; several channels are averaged.
BAudioBuffer—The second clip, at the first's sample rate.

返回

相关Table
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

设计滤波器

函数

Designs an IIR filter - Butterworth, Chebyshev I or II, elliptic or Bessel - as a cascade of second-order sections, by the bilinear transform with prewarped edges.

签名
设计滤波器 -> Digital Filter
    类型: FilterFamily
    频带: FilterBand
    阶数: 整数
    边缘频率: 数字
    上边缘频率: 数字
    采样率: 整数
    纹波: 数字
    衰减: 数字
DigitalFilter DesignFilter(
    FilterFamily family = FilterFamily.Butterworth,
    FilterBand band = FilterBand.LowPass,
    int order = 4,
    double edge = 1000,
    double upperEdge = 0,
    int sampleRate = 44100,
    double ripple = 1,
    double attenuation = 40)

参数

名称类型默认值说明
类型FilterFamilyButterworthButterworth is flat; Chebyshev I trades passband ripple for steepness; Chebyshev II is flat with ripple in the stopband; elliptic ripples in both for the steepest edge of all; Bessel keeps a waveform's shape with the gentlest edge.
频带FilterBandLow passWhat it keeps.
阶数整数41 to 24; band-pass and band-stop filters have twice as many poles.
边缘频率数字1000The cutoff, or the band's lower edge, in Hz. For Chebyshev II, where the stopband attenuation is first reached; for Bessel, the frequency its phase is normalized to, as SciPy's norm='phase', which is above the -3 dB point at every order past 1: at order 4 the edge is 7.6 dB down and -3 dB falls at two thirds of it, at order 8 12.6 dB and about half.
上边缘频率数字0The band's upper edge, in Hz, for band-pass and band-stop.
采样率整数44100The rate of the audio it will filter.
纹波数字1Chebyshev I's and elliptic's passband ripple, in dB, up to 300.
衰减数字40Chebyshev II's and elliptic's stopband attenuation, in dB, up to 300.

返回

滤波器Digital Filter
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

设计 FIR 滤波器

函数

Designs a linear-phase FIR filter by the Kaiser window method, long enough to reach the attenuation over the transition width - MATLAB's kaiserord and fir1.

签名
设计 FIR 滤波器 -> Digital Filter
    频带: FilterBand
    边缘频率: 数字
    上边缘频率: 数字
    过渡带宽: 数字
    衰减: 数字
    采样率: 整数
DigitalFilter DesignFirFilter(
    FilterBand band = FilterBand.LowPass,
    double edge = 1000,
    double upperEdge = 0,
    double transitionWidth = 200,
    double attenuation = 60,
    int sampleRate = 44100)

参数

名称类型默认值说明
频带FilterBandLow passWhat it keeps.
边缘频率数字1000The cutoff, or the band's lower edge, in Hz: the -6 dB point.
上边缘频率数字0The band's upper edge, in Hz.
过渡带宽数字200How wide the edges may be, in Hz; narrower needs more taps.
衰减数字60The stopband attenuation, in dB.
采样率整数44100The rate of the audio it will filter.

返回

滤波器Digital Filter

备注

A linear-phase FIR filter delays every frequency by the same (taps - 1) / 2 samples, so it changes the tone without smearing transients, and Apply Filter takes that delay back out so its output lines up with its input.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

绘制常数 Q 频谱图

函数

A picture of a clip's constant-Q spectrogram: time left to right, pitch bottom to top with the same number of rows every octave, so notes sit on evenly spaced lines - the musician's spectrogram.

签名
绘制常数 Q 频谱图 -> Pixel Image
    音频: AudioBuffer
    每倍频程频点数: 整数
    最低: 数字
    宽度: 整数
    高度: 整数
PixelImage DrawConstantQSpectrogram(
    AudioBuffer audio,
    int binsPerOctave = 12,
    double lowest = 32.703,
    int width = 800,
    int height = 256)

参数

名称类型默认值说明
音频AudioBuffer—The clip; several channels are averaged.
每倍频程频点数整数1212 is a semitone a row, 24 a quarter-tone.
最低数字32.703The lowest frequency, Hz: C1 by default.
宽度整数800Picture width, in pixels.
高度整数256Picture height, in pixels.

返回

图像Pixel Image
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

绘制频率响应

函数

A picture of a filter's magnitude response on a logarithmic frequency axis from 20 Hz to Nyquist, 0 dB at the top and -100 dB at the bottom.

签名
绘制频率响应 -> Pixel Image
    滤波器: Digital Filter
    宽度: 整数
    高度: 整数
PixelImage DrawFrequencyResponse(
    DigitalFilter filter,
    int width = 640,
    int height = 240)

参数

名称类型默认值说明
滤波器Digital Filter—The filter.
宽度整数640Picture width, in pixels.
高度整数240Picture height, in pixels.

返回

图像Pixel Image
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

绘制梅尔频谱图

函数

A picture of a clip's mel spectrogram: time left to right, mel bands bottom to top, level as brightness over the top 80 dB - the picture a speech or music model sees.

签名
绘制梅尔频谱图 -> Pixel Image
    音频: AudioBuffer
    频带数: 整数
    宽度: 整数
    高度: 整数
PixelImage DrawMelSpectrogram(
    AudioBuffer audio,
    int bands = 128,
    int width = 800,
    int height = 256)

参数

名称类型默认值说明
音频AudioBuffer—The clip; several channels are averaged.
频带数整数128Mel bands, one row of pixels band each before scaling.
宽度整数800Picture width, in pixels.
高度整数256Picture height, in pixels.

返回

图像Pixel Image
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

包络

函数

A clip's amplitude envelope: the magnitude of its analytic signal (the Hilbert transform), channel by channel.

签名
包络(音频: AudioBuffer) -> AudioBuffer
AudioBuffer Envelope(AudioBuffer audio)

参数

名称类型默认值说明
音频AudioBuffer—The clip.

返回

包络AudioBuffer
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

估计延迟

函数

How far one clip runs behind another - where their cross-correlation peaks - for lining up two recordings of the same thing, MATLAB's finddelay.

签名
估计延迟(参考: AudioBuffer, 延迟信号: AudioBuffer) -> 数字
double EstimateDelay(AudioBuffer reference, AudioBuffer delayed)

参数

名称类型默认值说明
参考AudioBuffer—The clip to measure from.
延迟信号AudioBuffer—The clip that may run behind it, at the same sample rate.

返回

延迟数字
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

频率响应

函数

A filter's frequency response: magnitude in dB, phase in degrees and group delay in milliseconds, at frequencies spaced evenly from 0 to Nyquist - MATLAB's freqz and grpdelay.

签名
频率响应(滤波器: Digital Filter, 点数: 整数) -> Table
Table FrequencyResponse(DigitalFilter filter, int points = 512)

参数

名称类型默认值说明
滤波器Digital Filter—The filter.
点数整数512How many frequencies.

返回

响应Table
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

冲激响应

函数

A filter's response to a single click: how it rings - MATLAB's impz, as a clip at the filter's rate.

签名
冲激响应(滤波器: Digital Filter, 长度: 整数) -> AudioBuffer
AudioBuffer ImpulseResponse(
    DigitalFilter filter,
    int length = 1024)

参数

名称类型默认值说明
滤波器Digital Filter—The filter.
长度整数1024How many samples.

返回

音频AudioBuffer
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

瞬时频率

函数

The frequency a clip has from moment to moment, from the rate its analytic signal's phase turns - meaningful for one tone, a sweep or an FM sound.

签名
瞬时频率(音频: AudioBuffer) -> 数字数组
double[] InstantaneousFrequency(AudioBuffer audio)

参数

名称类型默认值说明
音频AudioBuffer—The clip; several channels are averaged.

返回

频率数字数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

线性预测

函数

The all-pole model that predicts each sample from the ones before it - the vocal tract's resonances in speech - by the autocorrelation method, MATLAB's lpc.

签名
线性预测(音频: AudioBuffer, 阶数: 整数) -> 数字数组
double[] LinearPredictionCoefficients(
    AudioBuffer audio,
    int order = 12)

参数

名称类型默认值说明
音频AudioBuffer—The clip; several channels are averaged. A short stretch - tens of milliseconds - for one set of formants.
阶数整数12How many past samples; about the sample rate in kHz plus 2 for speech.

返回

系数数字数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

MFCC

函数

Mel-frequency cepstral coefficients frame by frame, as librosa computes them by default - the timbre features speech and music classifiers start from.

签名
MFCC -> Table
    音频: AudioBuffer
    系数数: 整数
    频带数: 整数
    帧大小: 整数
    跳步: 整数
Table Mfcc(
    AudioBuffer audio,
    int coefficients = 13,
    int bands = 128,
    int frameSize = 2048,
    int hop = 512)

参数

名称类型默认值说明
音频AudioBuffer—The clip; several channels are averaged.
系数数整数13How many coefficients, usually 13 or 20.
频带数整数128Mel bands the coefficients are taken across.
帧大小整数2048Samples per frame, a power of two.
跳步整数512Samples between frames.

返回

MFCCTable
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

倍频程声级

函数

A clip's level in each octave or fractional-octave band of ANSI S1.11 and IEC 61260, through sixth-order Butterworth band filters - MATLAB's octaveFilterBank, as a table.

签名
倍频程声级 -> Table
    音频: AudioBuffer
    每倍频程频带数: 整数
    最低: 数字
    最高: 数字
Table OctaveBandLevels(
    AudioBuffer audio,
    int bandsPerOctave = 1,
    double lowest = 31.5,
    double highest = 16000)

参数

名称类型默认值说明
音频AudioBuffer—The clip; several channels are averaged.
每倍频程频带数整数11 for octaves, 3 for third-octaves.
最低数字31.5The lowest band's centre to include, Hz.
最高数字16000The highest band's centre to include, Hz.

返回

频带Table
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

功率谱密度

函数

A clip's power spectral density by Welch's method - Hann segments overlapping by half, averaged - in dB per hertz, MATLAB's pwelch.

签名
功率谱密度(音频: AudioBuffer, 分段长度: 整数) -> Table
Table PowerSpectralDensity(
    AudioBuffer audio,
    int segmentLength = 1024)

参数

名称类型默认值说明
音频AudioBuffer—The clip; several channels are averaged.
分段长度整数1024Samples per segment, a power of two: longer is finer in frequency and noisier.

返回

密度Table
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

预测包络

函数

A linear-prediction model as a filter: its all-pole resonances, whose frequency response is the spectral envelope - the formants.

签名
预测包络(音频: AudioBuffer, 阶数: 整数) -> Digital Filter
DigitalFilter PredictionEnvelope(
    AudioBuffer audio,
    int order = 12)

参数

名称类型默认值说明
音频AudioBuffer—The stretch of audio to model.
阶数整数12The model's order.

返回

滤波器Digital Filter
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

实倒谱

函数

The real cepstrum - the spectrum of the log spectrum - whose peaks are periodicities in the spectrum: a voice's pitch period, an echo's delay. MATLAB's rceps.

签名
实倒谱(音频: AudioBuffer) -> 数字数组
double[] RealCepstrum(AudioBuffer audio)

参数

名称类型默认值说明
音频AudioBuffer—The clip; several channels are averaged. A short stretch, for one pitch.

返回

倒谱数字数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

频谱描述符

函数

The eleven spectral descriptors of MATLAB's Audio Toolbox, one row per frame of the power spectrum: centroid, spread, skewness, kurtosis, entropy, flatness, crest, flux, slope, decrease and rolloff.

签名
频谱描述符(音频: AudioBuffer, 帧大小: 整数, 跳步: 整数) -> Table
Table SpectralDescriptorsTable(
    AudioBuffer audio,
    int frameSize = 1024,
    int hop = 512)

参数

名称类型默认值说明
音频AudioBuffer—The clip; several channels are averaged.
帧大小整数1024Samples per frame, a power of two.
跳步整数512Samples between frames.

返回

描述符Table
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

传递函数

函数

The transfer function from one clip to another and how linearly they are related at each frequency - measuring a room, a speaker or an effect from what went in and what came out. MATLAB's tfestimate and mscohere.

签名
传递函数 -> Table
    输入: AudioBuffer
    输出: AudioBuffer
    分段长度: 整数
Table TransferFunction(
    AudioBuffer input,
    AudioBuffer output,
    int segmentLength = 1024)

参数

名称类型默认值说明
输入AudioBuffer—What went in.
输出AudioBuffer—What came out; resampled to the input's rate if it differs.
分段长度整数1024Samples per Welch segment, a power of two.

返回

传递Table
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

计权声级

函数

A clip's equivalent continuous level through a frequency weighting, in dB relative to a full-scale sine's RMS - the dB(A) or dB(C) of a sound level meter, uncalibrated: digital full scale stands for whatever level the recording chain puts there.

签名
计权声级(音频: AudioBuffer, 计权: FrequencyWeighting) -> 数字
double WeightedLevel(
    AudioBuffer audio,
    FrequencyWeighting weighting = FrequencyWeighting.A)

参数

名称类型默认值说明
音频AudioBuffer—The clip; several channels are averaged.
计权FrequencyWeightingAThe weighting.

返回

声级数字
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

计权滤波器

函数

The A or C frequency weighting of IEC 61672 as a filter, 0 dB at 1 kHz - MATLAB's weightingFilter.

签名
计权滤波器 -> Digital Filter
    计权: FrequencyWeighting
    采样率: 整数
DigitalFilter WeightingFilter(
    FrequencyWeighting weighting = FrequencyWeighting.A,
    int sampleRate = 44100)

参数

名称类型默认值说明
计权FrequencyWeightingAA for the ear at moderate levels, C at high levels, Z for none.
采样率整数44100The rate of the audio it will filter; 8 kHz or more.

返回

滤波器Digital Filter
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理

零极点

函数

A filter's zeros and poles in the z-plane - MATLAB's zplane as a table: a filter is stable when every pole lies inside the unit circle.

签名
零极点(滤波器: Digital Filter) -> Table
Table ZerosAndPoles(DigitalFilter filter)

参数

名称类型默认值说明
滤波器Digital Filter—An IIR filter.

返回

根Table
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
信号处理
所属包
音频处理