chirp

Function chirp 

Source
pub fn chirp<T: SignalType>(
    length: usize,
    start_freq: f64,
    end_freq: f64,
    sample_rate: f64,
    amplitude: f64,
) -> Signal<T>
Expand description

Create a chirp signal (linearly swept frequency)

Generates a sinusoidal signal with frequency that changes linearly from start_freq to end_freq over the duration of the signal.

The instantaneous frequency at time t is: f(t) = start_freq + (end_freq - start_freq) * t / duration The phase is the integral of the instantaneous frequency: φ(t) = 2π * (start_freq * t + (end_freq - start_freq) * t² / (2 * duration))