Changeset 2d8880d5


Ignore:
Timestamp:
Nov 3, 2007, 5:38:45 PM (12 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
ac5f22c, c721874
Parents:
5c0662a
Message:

add test fft back and forth

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/python/fft.py

    r5c0662a r2d8880d5  
    1515    del_aubio_mfft(self.o)
    1616
    17   def test_aubio_mfft(self):
    18     """ create and delete mfft """
     17  def test_create(self):
     18    """ test creation and deletion of fft object """
    1919    pass
    2020
     
    103103    del output
    104104
     105  def test_aubio_mfft_do_back_and_forth(self):
     106    """ test aubio_mfft_rdo on a constant """
     107    input    = new_fvec(buf_size, channels)
     108    output   = new_fvec(buf_size, channels)
     109    fftgrain = new_cvec(buf_size, channels)
     110    for index in range(buf_size/2+1):
     111      for channel in range(channels):
     112        fvec_write_sample(input, 0.67, channel, index)
     113    aubio_mfft_do(self.o, input, fftgrain)
     114    aubio_mfft_rdo(self.o, fftgrain, output)
     115    for index in range(buf_size/2+1):
     116      for channel in range(channels):
     117        self.assertAlmostEqual(fvec_read_sample(output, channel, index), 0.67, 7)
     118    del fftgrain
     119    del output
     120
    105121if __name__ == '__main__': unittest.main()
Note: See TracChangeset for help on using the changeset viewer.