Signal Processing
25 nodes
On this page 25
Apply Filter
FunctionRuns a clip through a filter, once, forward - the way any real-time filter would.
ApplyFilter -> AudioBuffer
audio: AudioBuffer
filter: Digital FilterAudioBuffer ApplyFilter(AudioBuffer audio, DigitalFilter filter)
Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip. |
| filter | Digital Filter | — | A filter designed at the clip's sample rate. |
Returns
| Audio | AudioBuffer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Apply Zero-Phase Filter
FunctionRuns 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.
ApplyZeroPhaseFilter -> AudioBuffer
audio: AudioBuffer
filter: Digital FilterAudioBuffer ApplyZeroPhaseFilter(
AudioBuffer audio,
DigitalFilter filter)Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip. |
| filter | Digital Filter | — | A filter designed at the clip's sample rate. |
Returns
| Audio | AudioBuffer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Audio Features
FunctionA 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.
AudioFeatures -> Table
audio: AudioBuffer
frameSize: Integer
hop: Integer
coefficients: IntegerTable AudioFeatures(
AudioBuffer audio,
int frameSize = 2048,
int hop = 512,
int coefficients = 13)Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip; several channels are averaged. |
| frameSize | Integer | 2048 | Samples per frame, a power of two. |
| hop | Integer | 512 | Samples between frames. |
| coefficients | Integer | 13 | How many MFCC columns to add; 0 for none. |
Returns
| Features | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Cross Correlate
FunctionHow alike two clips are at every relative shift - their cross-correlation - MATLAB's xcorr.
CrossCorrelate(a: AudioBuffer, b: AudioBuffer) -> Table
Table CrossCorrelate(AudioBuffer a, AudioBuffer b)
Parameters
| name | type | default | description |
|---|---|---|---|
| a | AudioBuffer | — | The first clip; several channels are averaged. |
| b | AudioBuffer | — | The second clip, at the first's sample rate. |
Returns
| Correlation | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Design Filter
FunctionDesigns 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.
DesignFilter -> Digital Filter
family: FilterFamily
band: FilterBand
order: Integer
edge: Number
upperEdge: Number
sampleRate: Integer
ripple: Number
attenuation: NumberDigitalFilter 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)Parameters
| name | type | default | description |
|---|---|---|---|
| family | FilterFamily | Butterworth | Butterworth 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. |
| band | FilterBand | Low pass | What it keeps. |
| order | Integer | 4 | 1 to 24; band-pass and band-stop filters have twice as many poles. |
| edge | Number | 1000 | The 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. |
| upperEdge | Number | 0 | The band's upper edge, in Hz, for band-pass and band-stop. |
| sampleRate | Integer | 44100 | The rate of the audio it will filter. |
| ripple | Number | 1 | Chebyshev I's and elliptic's passband ripple, in dB, up to 300. |
| attenuation | Number | 40 | Chebyshev II's and elliptic's stopband attenuation, in dB, up to 300. |
Returns
| Filter | Digital Filter |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Design FIR Filter
FunctionDesigns 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.
DesignFirFilter -> Digital Filter
band: FilterBand
edge: Number
upperEdge: Number
transitionWidth: Number
attenuation: Number
sampleRate: IntegerDigitalFilter DesignFirFilter(
FilterBand band = FilterBand.LowPass,
double edge = 1000,
double upperEdge = 0,
double transitionWidth = 200,
double attenuation = 60,
int sampleRate = 44100)Parameters
| name | type | default | description |
|---|---|---|---|
| band | FilterBand | Low pass | What it keeps. |
| edge | Number | 1000 | The cutoff, or the band's lower edge, in Hz: the -6 dB point. |
| upperEdge | Number | 0 | The band's upper edge, in Hz. |
| transitionWidth | Number | 200 | How wide the edges may be, in Hz; narrower needs more taps. |
| attenuation | Number | 60 | The stopband attenuation, in dB. |
| sampleRate | Integer | 44100 | The rate of the audio it will filter. |
Returns
| Filter | Digital Filter |
Remarks
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.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Draw Constant-Q Spectrogram
FunctionA 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.
DrawConstantQSpectrogram -> Pixel Image
audio: AudioBuffer
binsPerOctave: Integer
lowest: Number
width: Integer
height: IntegerPixelImage DrawConstantQSpectrogram(
AudioBuffer audio,
int binsPerOctave = 12,
double lowest = 32.703,
int width = 800,
int height = 256)Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip; several channels are averaged. |
| binsPerOctave | Integer | 12 | 12 is a semitone a row, 24 a quarter-tone. |
| lowest | Number | 32.703 | The lowest frequency, Hz: C1 by default. |
| width | Integer | 800 | Picture width, in pixels. |
| height | Integer | 256 | Picture height, in pixels. |
Returns
| Image | Pixel Image |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Draw Frequency Response
FunctionA 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.
DrawFrequencyResponse -> Pixel Image
filter: Digital Filter
width: Integer
height: IntegerPixelImage DrawFrequencyResponse(
DigitalFilter filter,
int width = 640,
int height = 240)Parameters
| name | type | default | description |
|---|---|---|---|
| filter | Digital Filter | — | The filter. |
| width | Integer | 640 | Picture width, in pixels. |
| height | Integer | 240 | Picture height, in pixels. |
Returns
| Image | Pixel Image |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Draw Mel Spectrogram
FunctionA 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.
DrawMelSpectrogram -> Pixel Image
audio: AudioBuffer
bands: Integer
width: Integer
height: IntegerPixelImage DrawMelSpectrogram(
AudioBuffer audio,
int bands = 128,
int width = 800,
int height = 256)Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip; several channels are averaged. |
| bands | Integer | 128 | Mel bands, one row of pixels band each before scaling. |
| width | Integer | 800 | Picture width, in pixels. |
| height | Integer | 256 | Picture height, in pixels. |
Returns
| Image | Pixel Image |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Envelope
FunctionA clip's amplitude envelope: the magnitude of its analytic signal (the Hilbert transform), channel by channel.
Envelope(audio: AudioBuffer) -> AudioBuffer
AudioBuffer Envelope(AudioBuffer audio)
Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip. |
Returns
| Envelope | AudioBuffer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Estimate Delay
FunctionHow far one clip runs behind another - where their cross-correlation peaks - for lining up two recordings of the same thing, MATLAB's finddelay.
EstimateDelay -> Number
reference: AudioBuffer
delayed: AudioBufferdouble EstimateDelay(AudioBuffer reference, AudioBuffer delayed)
Parameters
| name | type | default | description |
|---|---|---|---|
| reference | AudioBuffer | — | The clip to measure from. |
| delayed | AudioBuffer | — | The clip that may run behind it, at the same sample rate. |
Returns
| Delay | Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Frequency Response
FunctionA 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.
FrequencyResponse -> Table
filter: Digital Filter
points: IntegerTable FrequencyResponse(DigitalFilter filter, int points = 512)
Parameters
| name | type | default | description |
|---|---|---|---|
| filter | Digital Filter | — | The filter. |
| points | Integer | 512 | How many frequencies. |
Returns
| Response | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Impulse Response
FunctionA filter's response to a single click: how it rings - MATLAB's impz, as a clip at the filter's rate.
ImpulseResponse -> AudioBuffer
filter: Digital Filter
length: IntegerAudioBuffer ImpulseResponse(
DigitalFilter filter,
int length = 1024)Parameters
| name | type | default | description |
|---|---|---|---|
| filter | Digital Filter | — | The filter. |
| length | Integer | 1024 | How many samples. |
Returns
| Audio | AudioBuffer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Instantaneous Frequency
FunctionThe 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.
InstantaneousFrequency(audio: AudioBuffer) -> Number Array
double[] InstantaneousFrequency(AudioBuffer audio)
Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip; several channels are averaged. |
Returns
| Frequency | Number Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Linear Prediction
FunctionThe 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.
LinearPredictionCoefficients -> Number Array
audio: AudioBuffer
order: Integerdouble[] LinearPredictionCoefficients(
AudioBuffer audio,
int order = 12)Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip; several channels are averaged. A short stretch - tens of milliseconds - for one set of formants. |
| order | Integer | 12 | How many past samples; about the sample rate in kHz plus 2 for speech. |
Returns
| Coefficients | Number Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
MFCC
FunctionMel-frequency cepstral coefficients frame by frame, as librosa computes them by default - the timbre features speech and music classifiers start from.
Mfcc -> Table
audio: AudioBuffer
coefficients: Integer
bands: Integer
frameSize: Integer
hop: IntegerTable Mfcc(
AudioBuffer audio,
int coefficients = 13,
int bands = 128,
int frameSize = 2048,
int hop = 512)Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip; several channels are averaged. |
| coefficients | Integer | 13 | How many coefficients, usually 13 or 20. |
| bands | Integer | 128 | Mel bands the coefficients are taken across. |
| frameSize | Integer | 2048 | Samples per frame, a power of two. |
| hop | Integer | 512 | Samples between frames. |
Returns
| Mfcc | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Octave Band Levels
FunctionA 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.
OctaveBandLevels -> Table
audio: AudioBuffer
bandsPerOctave: Integer
lowest: Number
highest: NumberTable OctaveBandLevels(
AudioBuffer audio,
int bandsPerOctave = 1,
double lowest = 31.5,
double highest = 16000)Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip; several channels are averaged. |
| bandsPerOctave | Integer | 1 | 1 for octaves, 3 for third-octaves. |
| lowest | Number | 31.5 | The lowest band's centre to include, Hz. |
| highest | Number | 16000 | The highest band's centre to include, Hz. |
Returns
| Bands | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Power Spectral Density
FunctionA clip's power spectral density by Welch's method - Hann segments overlapping by half, averaged - in dB per hertz, MATLAB's pwelch.
PowerSpectralDensity -> Table
audio: AudioBuffer
segmentLength: IntegerTable PowerSpectralDensity(
AudioBuffer audio,
int segmentLength = 1024)Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip; several channels are averaged. |
| segmentLength | Integer | 1024 | Samples per segment, a power of two: longer is finer in frequency and noisier. |
Returns
| Density | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Prediction Envelope
FunctionA linear-prediction model as a filter: its all-pole resonances, whose frequency response is the spectral envelope - the formants.
PredictionEnvelope -> Digital Filter
audio: AudioBuffer
order: IntegerDigitalFilter PredictionEnvelope(
AudioBuffer audio,
int order = 12)Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The stretch of audio to model. |
| order | Integer | 12 | The model's order. |
Returns
| Filter | Digital Filter |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Real Cepstrum
FunctionThe 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.
RealCepstrum(audio: AudioBuffer) -> Number Array
double[] RealCepstrum(AudioBuffer audio)
Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip; several channels are averaged. A short stretch, for one pitch. |
Returns
| Cepstrum | Number Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Spectral Descriptors
FunctionThe 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.
SpectralDescriptorsTable -> Table
audio: AudioBuffer
frameSize: Integer
hop: IntegerTable SpectralDescriptorsTable(
AudioBuffer audio,
int frameSize = 1024,
int hop = 512)Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip; several channels are averaged. |
| frameSize | Integer | 1024 | Samples per frame, a power of two. |
| hop | Integer | 512 | Samples between frames. |
Returns
| Descriptors | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Transfer Function
FunctionThe 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.
TransferFunction -> Table
input: AudioBuffer
output: AudioBuffer
segmentLength: IntegerTable TransferFunction(
AudioBuffer input,
AudioBuffer output,
int segmentLength = 1024)Parameters
| name | type | default | description |
|---|---|---|---|
| input | AudioBuffer | — | What went in. |
| output | AudioBuffer | — | What came out; resampled to the input's rate if it differs. |
| segmentLength | Integer | 1024 | Samples per Welch segment, a power of two. |
Returns
| Transfer | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Weighted Level
FunctionA 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.
WeightedLevel -> Number
audio: AudioBuffer
weighting: FrequencyWeightingdouble WeightedLevel(
AudioBuffer audio,
FrequencyWeighting weighting = FrequencyWeighting.A)Parameters
| name | type | default | description |
|---|---|---|---|
| audio | AudioBuffer | — | The clip; several channels are averaged. |
| weighting | FrequencyWeighting | A | The weighting. |
Returns
| Level | Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Weighting Filter
FunctionThe A or C frequency weighting of IEC 61672 as a filter, 0 dB at 1 kHz - MATLAB's weightingFilter.
WeightingFilter -> Digital Filter
weighting: FrequencyWeighting
sampleRate: IntegerDigitalFilter WeightingFilter(
FrequencyWeighting weighting = FrequencyWeighting.A,
int sampleRate = 44100)Parameters
| name | type | default | description |
|---|---|---|---|
| weighting | FrequencyWeighting | A | A for the ear at moderate levels, C at high levels, Z for none. |
| sampleRate | Integer | 44100 | The rate of the audio it will filter; 8 kHz or more. |
Returns
| Filter | Digital Filter |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing
Zeros And Poles
FunctionA 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.
ZerosAndPoles(filter: Digital Filter) -> Table
Table ZerosAndPoles(DigitalFilter filter)
Parameters
| name | type | default | description |
|---|---|---|---|
| filter | Digital Filter | — | An IIR filter. |
Returns
| Roots | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Signal Processing
- Package
- Audio Processing