Friday 7 October 2016

signal analysis - Why do we need to normalize a WAV file before calculating the FFT?


I am trying to calculate the FFT of a signal stored in a WAV file using SciPy. I found a solution here, but it seems like we need to perform this step before the FFT:


b=[(ele/2**8.)*2-1 for ele in a] # this is 8-bit track, b is now normalized on [-1,1)


where the signal samples are stored in array a. Can someone explain the significance of this step?


Thanks.



Answer



It seems that the WAV file used in that example has samples with values between 0 and 255 (likely stored as unsigned chars). The normalization step just changes the samples to floating point values in the range [-1,1). This is, strictly speaking, not necessary to perform the FFT, but it is a good idea. For instance, it removes the large DC component that results from interpreting the unsigned char values as actual signal amplitudes.


No comments:

Post a Comment

readings - Appending 内 to a company name is read ない or うち?

For example, if I say マイクロソフト内のパートナーシップは強いです, is the 内 here read as うち or ない? Answer 「内」 in the form: 「Proper Noun + 内」 is always read 「ない...