pub struct OscillatorPolicy {
pub frequency_hz: f32,
pub amplitude: f32,
pub waveform: BandlimitedWaveform,
pub bandlimit: BandlimitPolicy,
}Expand description
Explicit oscillator frequency, waveform, level, and bandlimit policy.
Fields§
§frequency_hz: f32Oscillator frequency in hertz.
amplitude: f32Peak linear output level.
waveform: BandlimitedWaveformPeriodic waveform to generate.
bandlimit: BandlimitPolicyAnti-aliasing behavior for discontinuous waveforms.
Implementations§
Source§impl OscillatorPolicy
impl OscillatorPolicy
Sourcepub fn new(frequency_hz: f32, waveform: BandlimitedWaveform) -> Self
pub fn new(frequency_hz: f32, waveform: BandlimitedWaveform) -> Self
Creates a policy, sanitizing non-finite values and clamping pulse duty.
Sourcepub fn with_amplitude(self, amplitude: f32) -> Self
pub fn with_amplitude(self, amplitude: f32) -> Self
Returns this policy with a finite linear amplitude.
Sourcepub fn with_bandlimit(self, bandlimit: BandlimitPolicy) -> Self
pub fn with_bandlimit(self, bandlimit: BandlimitPolicy) -> Self
Returns this policy with an explicit anti-aliasing choice.
Trait Implementations§
Source§impl Clone for OscillatorPolicy
impl Clone for OscillatorPolicy
Source§fn clone(&self) -> OscillatorPolicy
fn clone(&self) -> OscillatorPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for OscillatorPolicy
Source§impl Debug for OscillatorPolicy
impl Debug for OscillatorPolicy
Source§impl PartialEq for OscillatorPolicy
impl PartialEq for OscillatorPolicy
impl StructuralPartialEq for OscillatorPolicy
Auto Trait Implementations§
impl Freeze for OscillatorPolicy
impl RefUnwindSafe for OscillatorPolicy
impl Send for OscillatorPolicy
impl Sync for OscillatorPolicy
impl Unpin for OscillatorPolicy
impl UnsafeUnpin for OscillatorPolicy
impl UnwindSafe for OscillatorPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more