It is necessary to calculate the spectrum of the WAV file. File read function scipy.io.wavfile.read . And the spectrum is calculated by the function scipy.fftpack.fft . As you know, semals in the WAV file have a little-endian representation, that is, the low byte goes first, then the high byte. The question is: scipy.fftpack.fft function take this into account, or do you first need to convert the data representation to big-endian?
- Are you sure that there are strictly two bytes? Moreover, there may be not one channel, but two. - KoVadim
- Yes. All WAV files processed have one channel, the frame size is 16 bits and the sampling rate is 44.1 kHz - Alexey Voronov
- I think scipy.io.wavfile.read provides data that scipy.fftpack.fft understands. But it's easy to check - take any audio editor and generate this spectrum and compare. - KoVadim
- Do you propose to plot the spectrum obtained (say, using Matplotlib) and compare it with the spectrum obtained in the editor? - Alexey Voronov
- if you trust Matplotlib, then take it. I would personally generate a signal whose spectrum I can predict (for example, the sum of several sinusoids). - KoVadim
|