Copyright | (c) Marek Materzok 2021 |
---|---|
License | BSD2 |
Safe Haskell | None |
Language | Haskell2010 |
This module defines some useful frequency-domain filters as conduits. It includes convenience wrappers for filters defined in the vocoder package.
Synopsis
- data Filter m
- runFilter :: Filter m -> forall f. Traversable f => FreqStep -> ConduitT (f STFTFrame) (f STFTFrame) m ()
- idFilter :: Monad m => Filter m
- composeFilters :: Monad m => Filter m -> Filter m -> Filter m
- realtimeFilter :: Monad m => Filter m -> Filter m
- amplitudeFilter :: Monad m => (FreqStep -> Moduli -> Moduli) -> Filter m
- linearAmplitudeFilter :: Monad m => (Double -> Double) -> Filter m
- amplify :: Monad m => Double -> Filter m
- lowpassBrickwall :: Monad m => Double -> Filter m
- highpassBrickwall :: Monad m => Double -> Filter m
- bandpassBrickwall :: Monad m => Double -> Double -> Filter m
- bandstopBrickwall :: Monad m => Double -> Double -> Filter m
- lowpassButterworth :: Monad m => Double -> Double -> Filter m
- highpassButterworth :: Monad m => Double -> Double -> Filter m
- bandpassButterworth :: Monad m => Double -> Double -> Double -> Filter m
- bandstopButterworth :: Monad m => Double -> Double -> Double -> Filter m
- pitchShiftInterpolate :: Monad m => Double -> Filter m
- convolutionFilter :: Monad m => Vector Double -> Filter m
- envelopeFilter :: Monad m => Length -> Filter m
- randomPhaseFilter :: MonadIO m => Filter m
- playSpeed :: Monad m => Rational -> Filter m
Documentation
Conduit frequency-domain filter type. A conduit filter extends basic frequency-domain filters by using a conduit instead of a pure function. This enables time transformation filters.
runFilter :: Filter m -> forall f. Traversable f => FreqStep -> ConduitT (f STFTFrame) (f STFTFrame) m () Source #
composeFilters :: Monad m => Filter m -> Filter m -> Filter m Source #
Sequential filter composition.
realtimeFilter :: Monad m => Filter m -> Filter m Source #
Use a basic frequency-domain filter as a conduit filter.
amplitudeFilter :: Monad m => (FreqStep -> Moduli -> Moduli) -> Filter m Source #
Creates a conduit filter which transforms only amplitudes, leaving phase increments unchanged.
linearAmplitudeFilter :: Monad m => (Double -> Double) -> Filter m Source #
Creates a filter which scales amplitudes depending on frequency.
amplify :: Monad m => Double -> Filter m Source #
Creates an "amplifier" which scales all frequencies.
bandpassBrickwall :: Monad m => Double -> Double -> Filter m Source #
Creates a brickwall bandpass filter.
bandstopBrickwall :: Monad m => Double -> Double -> Filter m Source #
Creates a brickwall bandstop filter.
lowpassButterworth :: Monad m => Double -> Double -> Filter m Source #
Creates an n-th degree Butterworth-style lowpass filter.
highpassButterworth :: Monad m => Double -> Double -> Filter m Source #
Creates an n-th degree Butterworth-style highpass filter.
bandpassButterworth :: Monad m => Double -> Double -> Double -> Filter m Source #
Creates an n-th degree Butterworth-style bandpass filter.
bandstopButterworth :: Monad m => Double -> Double -> Double -> Filter m Source #
Creates an n-th degree Butterworth-style bandstop filter.
pitchShiftInterpolate :: Monad m => Double -> Filter m Source #
Creates an interpolative pitch-shifting filter.
convolutionFilter :: Monad m => Vector Double -> Filter m Source #
Creates a filter which convolves the spectrum using a kernel.
envelopeFilter :: Monad m => Length -> Filter m Source #
Creates a filter which replaces the amplitudes with their envelope.
randomPhaseFilter :: MonadIO m => Filter m Source #
Sets the phase increments so that the bins have horizontal consistency. This erases the phase information, introducing "phasiness".