Struct BbdModel
pub struct BbdModel {
pub num_stages: usize,
pub clock_min: f64,
pub clock_max: f64,
pub bandwidth_ratio: f64,
pub noise_floor: f64,
pub leakage_per_stage: f64,
pub clock_feedthrough: f64,
pub compander_error: f64,
}Expand description
BBD delay line model parameters.
Bucket-brigade devices (MN3007, MN3207, MN3005) are analog delay lines used in classic chorus, flanger, and delay pedals. Each device has a fixed number of stages and a clock frequency range that determines the delay time.
The BBD introduces characteristic artifacts:
- Clock noise: high-frequency switching artifacts (filtered by LPF)
- Bandwidth limiting: Nyquist limit at half the clock frequency
- Companding noise: from the compander used to improve S/N ratio
- Aliasing: soft HF rolloff from the sample-and-hold nature
We model these as a delay buffer with a variable-rate reader, anti-aliasing LPF, and subtle noise/distortion.
Fields§
§num_stages: usizeNumber of BBD stages. MN3207=1024, MN3007=1024, MN3005=4096.
clock_min: f64Minimum clock frequency (Hz). Determines maximum delay time.
clock_max: f64Maximum clock frequency (Hz). Determines minimum delay time.
bandwidth_ratio: f64Signal bandwidth limit as fraction of clock (Nyquist ≈ 0.45 * fclk).
noise_floor: f64Noise floor (linear amplitude). BBDs are noisy devices.
leakage_per_stage: f64Per-stage charge leakage rate (fraction lost per stage per clock period). Real BBDs lose charge through substrate leakage and junction capacitance. Typical: 0.0001–0.001 per stage, causing progressive HF loss at longer delays.
clock_feedthrough: f64Clock feedthrough amplitude (normalized). The switching clock couples into the analog signal path through parasitic capacitance in the MOSFET switches. Audible as a high-pitched whine. Typical: -60 to -80 dB below signal = 0.001–0.0001.
compander_error: f64Compander tracking error. Real BBD circuits use NE571/SA571 compander ICs to expand dynamic range. The compressor (input) and expander (output) don’t track perfectly — the rectifier time constants differ, causing “breathing” and pumping artifacts. 0.0 = perfect tracking, 1.0 = maximum error.
Implementations§
§impl BbdModel
impl BbdModel
pub fn mn3207() -> BbdModel
pub fn mn3207() -> BbdModel
MN3207 — 1024-stage BBD, used in Boss CE-2 chorus.
Clock range: 10kHz – 200kHz Delay range: 1024/(2*fclk) = 2.56ms – 51.2ms Relatively high leakage and clock feedthrough (consumer-grade).
pub fn mn3007() -> BbdModel
pub fn mn3007() -> BbdModel
MN3007 — 1024-stage BBD, used in Boss DM-2 delay.
Lower noise version of MN3207, same stage count. Better charge retention and lower clock feedthrough. Clock range: 10kHz – 100kHz Delay range: 5.12ms – 51.2ms
pub fn mn3005() -> BbdModel
pub fn mn3005() -> BbdModel
MN3005 — 4096-stage BBD, used in Boss DM-2 (long delay mode), Electro-Harmonix Memory Man.
4x more stages means leakage accumulates more, causing darker repeats at long delay times — the “warm decay” Memory Man sound. Clock range: 10kHz – 100kHz Delay range: 20.48ms – 204.8ms
pub fn delay_at_clock(&self, clock_hz: f64) -> f64
pub fn delay_at_clock(&self, clock_hz: f64) -> f64
Delay time in seconds for a given clock frequency.
BBD delay = num_stages / (2 * fclk) The factor of 2 is because samples advance one stage per half-clock.