0
$\begingroup$

Well, I am new to DSP so I apologize for the basic question. I am trying to transform audio 16bit PCM (which I store in normalized 0.0-1.0 range) samples into frequency domain using fft.

I understand that FFT transforms N points of time domain into two N sized frequency domain array. My problem is determining the size of N. For example if I have a 5mins PCM signal sampled at 8000 Hz/sec I can't find a way to get the spectrum of the whole signal, and not several arrays of size (e.g. 1024, 2048 etc..).

So my question is:

  • Can I transform the whole signal at once ?
  • If I cannot, is there away to combine the spectrum of different N sized segments?
  • Is it reasonable to study the spectrum of a whole large signal at once ?
$\endgroup$

2 Answers 2

3
$\begingroup$

Can I transform the whole signal at once ?

Yes, this would be a 2400000 points FFT - something that is easy for a modern desktop computer (note that the sample rate is measured in Hz or samples/sec, not in Hz/s).

If I cannot, is there away to combine the spectrum of different N sized segments?

Averaging the spectrum obtained on successive short windows is a common spectral estimation technique - but I'm not sure this is really what you need here.

Is it reasonable to study the spectrum of a whole large signal at once ?

It makes sense if the signal is stationary. I can think of some applications in which this would be the case (for example you record 5 min of continuous hum/noise generated by a machine), but this would be an exception more than a rule - and I can't think of a practical reason why one would have to perform a FFT on such a large chunk of signal.

For signals whose characteristics change with time - such as speech or music - spectral analysis is more commonly performed on short segments. It all depends on what you want to do with the result of the FFT. If it is to extract a property of the signal (such as its pitch, or a metric like spectral centroid), make sure it is reasonable to assume that the property you want to extract is constant over the duration of the signal. If not, break down the signal into short segments during which this property can be considered constant.

$\endgroup$
1
  • $\begingroup$ Thanks for the answer. make sure it is reasonable to assume that the property you want to extract is constant over the duration of the signal. I think that clarified it for me. $\endgroup$
    – concept3d
    Commented Oct 2, 2014 at 18:00
3
$\begingroup$

I completely agree with pichenettes' answer, but one term that I miss there and that is probably useful for you is the Short-time Fourier Transform (STFT), which gives you a time-frequency analysis of your signal. I.e., you get to see the change of the signal's spectrum over time. This time information becomes completely invisible if you just take a Fourier transform of the whole signal. Also from a computational and storage perspective the computation of one long FFT is not very attractive. Since your signal is an audio signal I assume that it is not stationary over the time interval you consider, and for this reason the STFT will give you additional useful information.

$\endgroup$
1
  • $\begingroup$ Thanks for pointing out STFT, seems useful will read more about it. $\endgroup$
    – concept3d
    Commented Oct 2, 2014 at 17:59

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.