pub struct QDFT<T, F>{ /* private fields */ }Expand description
Constant-Q Sliding Discrete Fourier Transform (QDFT).
§Arguments
T- Time domain data type.F- Frequency domain data type.
Both T and F must be f32 or f64 respectively.
Implementations§
Source§impl<T, F> QDFT<T, F>
impl<T, F> QDFT<T, F>
Sourcepub fn new(
samplerate: f64,
bandwidth: (f64, f64),
resolution: f64,
latency: f64,
window: Option<(f64, f64)>,
) -> Self
pub fn new( samplerate: f64, bandwidth: (f64, f64), resolution: f64, latency: f64, window: Option<(f64, f64)>, ) -> Self
Returns a new QDFT plan instance for the specified parameters.
§Arguments
samplerate- Sample rate in hertz.bandwidth- Lowest and highest frequency in hertz to be resolved.resolution- Octave resolution, e.g. number of DFT bins per octave.latency- Analysis latency adjustment between -1 and +1.window- Cosine family window coeffs, e.g. (+0.5,-0.5) in case of hann window.
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Returns the number of DFT bins derived from the bandwidth and resolution.
Sourcepub fn samplerate(&self) -> f64
pub fn samplerate(&self) -> f64
Returns the sample rate in hertz.
Sourcepub fn bandwidth(&self) -> (f64, f64)
pub fn bandwidth(&self) -> (f64, f64)
Returns the lowest and highest frequency in hertz to be resolved.
Sourcepub fn resolution(&self) -> f64
pub fn resolution(&self) -> f64
Returns the octave resolution, e.g. number of DFT bins per octave.
Sourcepub fn frequencies(&self) -> &[f64]
pub fn frequencies(&self) -> &[f64]
Returns frequency values in hertz of the individual DFT bins.
Sourcepub fn window(&self) -> Option<(f64, f64)>
pub fn window(&self) -> Option<(f64, f64)>
Returns the cosine family window coeffs, e.g. (+0.5,-0.5) in case of hann window.
Sourcepub fn qdft_scalar(&mut self, sample: &T, dft: &mut [Complex<F>])
pub fn qdft_scalar(&mut self, sample: &T, dft: &mut [Complex<F>])
Estimate the DFT vector for the given sample.
Sourcepub fn iqdft_scalar(&mut self, dft: &[Complex<F>], sample: &mut T)
pub fn iqdft_scalar(&mut self, dft: &[Complex<F>], sample: &mut T)
Synthesize the sample from the given DFT vector.
Sourcepub fn qdft_vector(&mut self, samples: &[T], dfts: &mut [Complex<F>])
pub fn qdft_vector(&mut self, samples: &[T], dfts: &mut [Complex<F>])
Estimate the DFT matrix for the given sample array.
Sourcepub fn iqdft_vector(&mut self, dfts: &[Complex<F>], samples: &mut [T])
pub fn iqdft_vector(&mut self, dfts: &[Complex<F>], samples: &mut [T])
Synthesize the sample array from the given DFT matrix.
Auto Trait Implementations§
impl<T, F> Freeze for QDFT<T, F>
impl<T, F> RefUnwindSafe for QDFT<T, F>where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, F> Send for QDFT<T, F>
impl<T, F> Sync for QDFT<T, F>
impl<T, F> Unpin for QDFT<T, F>
impl<T, F> UnwindSafe for QDFT<T, F>where
F: UnwindSafe,
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