pub struct GoertzelDetectorQ15 { /* private fields */ }Expand description
Q15 Goertzel detector: same two-pole recurrence as GoertzelDetector, with
Q2.14 2 cos(ω) and i32 delays so a typical block (N ≲ 256) does not wrap.
Implementations§
Source§impl GoertzelDetectorQ15
impl GoertzelDetectorQ15
Sourcepub fn new(target_freq_hz: f32, sample_rate_hz: f32) -> Self
pub fn new(target_freq_hz: f32, sample_rate_hz: f32) -> Self
Creates a detector tuned to target_freq_hz at the given sample_rate_hz.
Sourcepub fn process_sample(&mut self, x: q15)
pub fn process_sample(&mut self, x: q15)
Feeds one Q15 input sample into the detector.
Sourcepub fn magnitude(&self) -> q15
pub fn magnitude(&self) -> q15
Magnitude of the target bin, normalized by N/2 like GoertzelDetector::magnitude.
Trait Implementations§
Source§impl Clone for GoertzelDetectorQ15
impl Clone for GoertzelDetectorQ15
Source§fn clone(&self) -> GoertzelDetectorQ15
fn clone(&self) -> GoertzelDetectorQ15
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 GoertzelDetectorQ15
Source§impl Debug for GoertzelDetectorQ15
impl Debug for GoertzelDetectorQ15
Source§impl Default for GoertzelDetectorQ15
impl Default for GoertzelDetectorQ15
Source§fn default() -> GoertzelDetectorQ15
fn default() -> GoertzelDetectorQ15
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GoertzelDetectorQ15
impl RefUnwindSafe for GoertzelDetectorQ15
impl Send for GoertzelDetectorQ15
impl Sync for GoertzelDetectorQ15
impl Unpin for GoertzelDetectorQ15
impl UnsafeUnpin for GoertzelDetectorQ15
impl UnwindSafe for GoertzelDetectorQ15
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