pub struct PhaseRotator<T: Float> { /* private fields */ }Expand description
Phase Rotator for applying phase shifts to signals
Implementations§
Source§impl<T: Float + FromPrimitive> PhaseRotator<T>
impl<T: Float + FromPrimitive> PhaseRotator<T>
Sourcepub fn new(frequency: T, sample_rate: T) -> Self
pub fn new(frequency: T, sample_rate: T) -> Self
Create a new phase rotator with specified frequency
§Arguments
frequency- The frequency of the oscillation in Hzsample_rate- The sample rate in Hz
Sourcepub fn process(&mut self, sample: T) -> T
pub fn process(&mut self, sample: T) -> T
Process a sample and apply phase rotation Returns the rotated sample
Sourcepub fn process_quadrature(&mut self, sample: T) -> (T, T)
pub fn process_quadrature(&mut self, sample: T) -> (T, T)
Process a sample with quadrature output (real and imaginary) Returns (in_phase, quadrature)
Sourcepub fn process_block(&mut self, input: &[T]) -> Vec<T>
pub fn process_block(&mut self, input: &[T]) -> Vec<T>
Process a block of samples
Sourcepub fn rotate_by_angle(signal: &[T], angle: T) -> Vec<T>
pub fn rotate_by_angle(signal: &[T], angle: T) -> Vec<T>
Rotate all samples in a vector by a fixed phase angle
Sourcepub fn set_frequency(&mut self, frequency: T, sample_rate: T)
pub fn set_frequency(&mut self, frequency: T, sample_rate: T)
Set frequency
Auto Trait Implementations§
impl<T> Freeze for PhaseRotator<T>where
T: Freeze,
impl<T> RefUnwindSafe for PhaseRotator<T>where
T: RefUnwindSafe,
impl<T> Send for PhaseRotator<T>where
T: Send,
impl<T> Sync for PhaseRotator<T>where
T: Sync,
impl<T> Unpin for PhaseRotator<T>where
T: Unpin,
impl<T> UnwindSafe for PhaseRotator<T>where
T: UnwindSafe,
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