Struct CableModel
pub struct CableModel { /* private fields */ }Expand description
Guitar cable model — RC low-pass filter.
Guitar cables act as a low-pass filter due to their distributed capacitance. A typical cable has 30-40 pF/ft (100-130 pF/m). Combined with the guitar pickup’s inductance and resistance, this creates a resonant peak followed by rolloff.
This is why true-bypass pedals can sound darker than buffered ones with long cable runs — the cable capacitance loads the pickup directly.
Simplified model: first-order RC low-pass where:
- R = source impedance (pickup or buffer output)
- C = cable capacitance (length * pF/ft)
Implementations§
§impl CableModel
impl CableModel
pub fn new(
length_feet: f64,
pf_per_foot: f64,
source_resistance: f64,
sample_rate: f64,
) -> CableModel
pub fn new( length_feet: f64, pf_per_foot: f64, source_resistance: f64, sample_rate: f64, ) -> CableModel
Create a cable model.
length_feet: Cable length in feet.pf_per_foot: Cable capacitance in pF/foot (typical: 30-40).source_resistance: Output impedance of the driving source.sample_rate: Audio sample rate.
pub fn standard_10ft(source_resistance: f64, sample_rate: f64) -> CableModel
pub fn standard_10ft(source_resistance: f64, sample_rate: f64) -> CableModel
Standard 10-foot guitar cable (~30 pF/ft).
pub fn long_20ft(source_resistance: f64, sample_rate: f64) -> CableModel
pub fn long_20ft(source_resistance: f64, sample_rate: f64) -> CableModel
Long 20-foot guitar cable (~30 pF/ft). Noticeable treble rolloff.
pub fn cheap_20ft(source_resistance: f64, sample_rate: f64) -> CableModel
pub fn cheap_20ft(source_resistance: f64, sample_rate: f64) -> CableModel
Cheap cable with higher capacitance (~40 pF/ft).
pub fn set_sample_rate(&mut self, sample_rate: f64)
pub fn set_sample_rate(&mut self, sample_rate: f64)
Update sample rate.
pub fn reset(&mut self)
pub fn reset(&mut self)
Reset filter state.
Trait Implementations§
§impl Clone for CableModel
impl Clone for CableModel
§fn clone(&self) -> CableModel
fn clone(&self) -> CableModel
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 moreAuto Trait Implementations§
impl Freeze for CableModel
impl RefUnwindSafe for CableModel
impl Send for CableModel
impl Sync for CableModel
impl Unpin for CableModel
impl UnsafeUnpin for CableModel
impl UnwindSafe for CableModel
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