Changes in / [4368223:e86676b]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/python/fft.py

    r4368223 re86676b  
    8383      for channel in range(1, channels):
    8484        self.assertEqual(0., cvec_read_norm(fftgrain, channel, index))
    85         self.assertEqual(0., cvec_read_phas(fftgrain, channel, index))
    86 
    8785    # check norm and phase == 0 in first first and last bin of first channel
    88     # check unwrap2pi(phas) ~= pi everywhere but in first and last bin
     86    self.assertCloseEnough((buf_size-1)*some_constant, cvec_read_norm(fftgrain, 0, 0))
    8987    self.assertCloseEnough(0., cvec_read_phas(fftgrain, 0, 0))
    90     for index in range(1,buf_size/2):
     88    self.assertCloseEnough(0., cvec_read_norm(fftgrain, 0, buf_size/2+1))
     89    self.assertCloseEnough(0., cvec_read_phas(fftgrain, 0, buf_size/2+1))
     90    # check unwrap2pi(phas) ~= pi everywhere but in first bin
     91    for index in range(1,buf_size/2+1):
    9192       self.assertCloseEnough(math.pi, aubio_unwrap2pi(cvec_read_phas(fftgrain, 0, index)))
    92     self.assertCloseEnough(0., cvec_read_phas(fftgrain, 0, buf_size/2))
    93     self.assertCloseEnough(0., cvec_read_phas(fftgrain, 0, buf_size/2+1))
    94 
    95     self.assertCloseEnough((buf_size-1)*some_constant, cvec_read_norm(fftgrain, 0, 0))
    96     for index in range(1,buf_size/2+1):
    97        self.assertCloseEnough(some_constant, abs(cvec_read_norm(fftgrain, 0, index)))
    98     self.assertCloseEnough(0., cvec_read_norm(fftgrain, 0, buf_size/2+1))
    99 
     93       self.assertCloseEnough(some_constant, cvec_read_norm(fftgrain, 0, index))
    10094    del fftgrain
    10195    del input
Note: See TracChangeset for help on using the changeset viewer.