Mercurial > hg > may
diff yetilab/signal/window.yeti @ 266:46d2923a04ab
Further tests and fixes
author | Chris Cannam |
---|---|
date | Thu, 23 May 2013 13:34:27 +0100 |
parents | c7efd12c27c5 |
children | 197d23954a4e |
line wrap: on
line diff
--- a/yetilab/signal/window.yeti Thu May 23 13:21:05 2013 +0100 +++ b/yetilab/signal/window.yeti Thu May 23 13:34:27 2013 +0100 @@ -24,10 +24,13 @@ done [0..n-1])); cosineWindow a0 a1 a2 a3 sampling n = - case sampling of - Symmetric (): cosineWindowSymmetric; - Periodic (): cosineWindowPeriodic; - esac a0 a1 a2 a3 n; + if n < 2 then vec.ones n + else + case sampling of + Symmetric (): cosineWindowSymmetric; + Periodic (): cosineWindowPeriodic; + esac a0 a1 a2 a3 n; + fi; bartlettSymmetric n = if n < 2 then vec.ones n @@ -64,7 +67,7 @@ blackmanNuttall = cosineWindow 0.3635819 0.4891775 0.1365995 0.0106411; blackmanHarris = cosineWindow 0.35875 0.48829 0.14128 0.01168; -boxcar = vec.consts 0.5; +boxcar n = if n < 2 then vec.ones n else vec.consts 0.5 n fi; windowFunction type options = (var sampling = Periodic ();