//! Quadrature Mirror Filter used in various audio codecs like MPEG Audio.
-///! 32-band QMF.
+/// 32-band QMF.
pub struct QMF {
hist: [f32; 1024],
pos: usize,
}
impl QMF {
- ///! Constructs a new `QMF` context.
+ /// Constructs a new `QMF` context.
pub fn new() -> Self {
Self {
hist: [0.0; 1024],
pos: 0,
}
}
- ///! Performs reconstruction of audio from provided sub-band samples.
+ /// Performs reconstruction of audio from provided sub-band samples.
pub fn synth(&mut self, src: &[f32; 32], dst: &mut [f32]) {
self.pos = self.pos.wrapping_sub(32) & 0x1FF;
dct32(src, &mut self.hist[self.pos..][..32]);
dst[i] = acc;
}
}
- ///! Resets internal filter state.
+ /// Resets internal filter state.
pub fn reset(&mut self) {
self.hist = [0.0; 1024];
self.pos = 0;