Skip to content

Commit

Permalink
add integer cast converter
Browse files Browse the repository at this point in the history
  • Loading branch information
iizukak committed Nov 4, 2015
1 parent 4ccbae6 commit 760a069
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/fft_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
# FFTValue = numpy.log(numpy.abs(numpy.fft.fft(window).real))
# FFTValue = numpy.abs(numpy.fft.fft(window).real)
# FFTValue = pywt.dwt(currentSegment ,"db1")[0]
FFTValue = numpy.log([numpy.sqrt(c.real ** 2 + c.imag ** 2) for c in numpy.fft.fft(window)][0:(FFT_SEGMENT_SIZE/2)])
# FFTValue = numpy.log([numpy.sqrt(c.real ** 2 + c.imag ** 2) for c in numpy.fft.fft(window)][0:(FFT_SEGMENT_SIZE/2)])
FFTValue = map(lambda x:int(x),
[numpy.sqrt(c.real ** 2 + c.imag ** 2) for c in numpy.fft.fft(window)][0:(FFT_SEGMENT_SIZE/2)])

csvWriter.writerow(FFTValue)
# csvWriter.writerow((date, value, FFTValue))

0 comments on commit 760a069

Please sign in to comment.