To process a .wav audio file with numpy (using fast Fourier transform algorithm). I want to process an audio signal at a particular interval with a sampling frequency 44100hz and sampling rate of 20ms and also want to store the data into a array by using numpy with fft of 1024

Can anyone help me with the code?


1 Answer 1


First of all, sampling frequency and sampling rate are synonymous. You mean sampling frequency of 44.1 kHz with a data length of 20 ms.

Second of all, 20 ms of data at 44.1 kHz will give you 882 points. Not enough for a 1024-point FFT.

You will either need to upsample to 51.2 kHz, that way 20 ms will give you 1024 points. Or you could append 142 zeroes to your data. Or, you could simply compute your FFT with the 882 points that you have. All 3 methods, will give you the same information. I personnaly recommend that you simply compute your FFT on 882 points.

As to the actual syntax, just google it, there are some pretty good examples.

edit : This seems like a good place to start


  • $\begingroup$ please if you can then share some link 🙄 I m apparently new in this domain $\endgroup$
    – user44806
    Commented Sep 8, 2019 at 13:21
  • $\begingroup$ I added a link in my answer $\endgroup$
    – Ben
    Commented Sep 8, 2019 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.