File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11'use strict'
22
33var wfunc = require ( './' )
4+ var applyWindow = require ( './apply' )
5+ var generateWindow = require ( './generate' )
46var t = require ( 'tape' )
57
68
@@ -42,21 +44,21 @@ t('window functions return a finite number',function(t) {
4244
4345t ( 'applies a window to a signal' , function ( t ) {
4446 var x = [ 1 , 1 , 1 , 1 , 1 ]
45- var y = wfunc . apply ( x , wfunc . hamming )
47+ var y = applyWindow ( x , wfunc . hamming )
4648 t . equal ( y . length , x . length )
4749 t . end ( )
4850} )
4951
5052t ( 'passes extra arguments to a window function' , function ( t ) {
5153 var x = [ 1 , 1 , 1 , 1 , 1 ]
52- wfunc . apply ( x , wfunc . gaussian , 0.1 )
54+ applyWindow ( x , wfunc . gaussian , 0.1 )
5355 t . ok ( isFinite ( x [ 0 ] ) , 'samples are finite' )
5456 t . ok ( x [ 0 ] < 1e-8 , 'samples have been windowed' )
5557 t . end ( )
5658} )
5759
5860t ( 'constructs an window function array' , function ( t ) {
59- var x = wfunc . generate ( wfunc . hamming , 100 )
61+ var x = generateWindow ( wfunc . hamming , 100 )
6062 t . ok ( Array . isArray ( x ) )
6163 t . equal ( x . length , 100 )
6264 t . ok ( isFinite ( x [ 50 ] ) )
You can’t perform that action at this time.
0 commit comments