I have an array of bytes representing data from a .wav file. I want to convert it to an array of doubles, so that I can do operations such as FFT on it to determine whe开发者_如何学Pythonther one file is contained in the other.
Right now, I simply cast the bytes to doubles, which gives me decent results, but not as precise as I would like. I know this is improper conversion, and I feel like it is causing me to miss data, because of the difference in what bytes and doubles represent.
How can I convert the byte array to a double array properly before doing the FFT correlation?
If each byte actually represents a signed 8-bit sample value, then the data has been lost when the sample was recorded, and there is nothing improper or imprecise about casting to double
(which can accurately represent all values that byte
can) - there isn't really anything else you can do.
精彩评论