pub struct AnalyticField {
pub amplitude: Vec<f32>,
pub phase: Vec<f32>,
pub frequency: Vec<f32>,
pub latency: usize,
}Expand description
The analytic reading of a scalar signal: its envelope and its current position inside that envelope.
FlowField answers which way a signal is heading. This answers how
widely it is swinging and how fast it is swinging, which a slope cannot
separate: a signal oscillating with a growing envelope has a slope that
keeps changing sign while the envelope only rises.
Fields§
§amplitude: Vec<f32>Instantaneous amplitude, the local envelope of the signal.
phase: Vec<f32>Instantaneous phase in (-pi, pi], position within the oscillation.
frequency: Vec<f32>Instantaneous frequency in radians per token, the phase advance.
Unlike the resonator bank’s, this is not prescribed: the bank rotates at the frequency it was tuned to whatever the input, while this is read off the signal and changes with it.
latency: usizeTokens of group delay. Index i reads the signal around i, using
input up to i + latency, so the reading is causal with latency
rather than centered on unseen input.
Implementations§
Source§impl AnalyticField
impl AnalyticField
Sourcepub fn amplitude_at(&self, i: usize) -> f32
pub fn amplitude_at(&self, i: usize) -> f32
Envelope at a token index, or 0.0 past the end.
Sourcepub fn frequency_at(&self, i: usize) -> f32
pub fn frequency_at(&self, i: usize) -> f32
Instantaneous frequency at a token index, or 0.0 past the end.