Mercurial > hg > may
changeset 592:e7c5b55aab9a
Add mixedTo option to framer
author | Chris Cannam |
---|---|
date | Thu, 11 Sep 2014 15:05:34 +0100 |
parents | eb27901664cd |
children | 386c29180184 |
files | src/may/stream/framer.yeti |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/may/stream/framer.yeti Thu Sep 11 11:25:50 2014 +0100 +++ b/src/may/stream/framer.yeti Thu Sep 11 15:05:34 2014 +0100 @@ -82,6 +82,7 @@ var padded = true; var windower = id; var transform = id; + var mixer = id; for options \case of Hop h: hop := h; Padded p: padded := p; @@ -92,10 +93,13 @@ if f then transform := mat.mapRows (fft.realForwardMagnitude framesize); fi; + MixedTo c: + mixer := manip.mixedTo c; esac; map transform (map windower - (frames' framesize hop padded stream))); + (frames' framesize hop padded + (mixer stream)))); complexFrames framesize options stream = (var hop = framesize; @@ -103,6 +107,7 @@ var windower = id; var rowTransform = do r: complex.complexArray r (vec.zeros (vec.length r)) done; + var mixer = id; for options \case of Hop h: hop := h; Padded p: padded := p; @@ -114,12 +119,15 @@ if f then rowTransform := fft.realForward framesize; fi; + MixedTo c: + mixer := manip.mixedTo c; esac; map do m: cm.fromRows (map rowTransform (mat.asRows m)) done (map windower - (frames' framesize hop padded stream))); + (frames' framesize hop padded + (mixer stream)))); streamContiguous rate framesize frames = (var remaining = frames;