元編程參考文件

訊號處理

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
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
訊號處理
所屬包
音訊處理