2
$\begingroup$

Fourier transformation is used to split a periodic signal into frequencies, and calculate the phase and shift for each frequency. But what if we would like to record an audio, which is changing, for example, because someone starts to play with a new instrument?

I know that if the recording is 44100 Hz, then we record 44100 samples in each second. But how is it Fourier transformed? The only way I can think of is that one second is divided into 25 segments, and we do the transformation to get the phase and shift for each frequency in each segment.

$\endgroup$
2
$\begingroup$

You are correct that it is often broken up into chunks. There are multiple ways to combine those chunks (Google: fft overlap save).

It is often important to window the data (again Google: hamming window fft). One critical reason to do this that gets to the heart of your question: the fft assumes the chunk you fed it continues infinitely forward and backward in time. Obviously an audio file does not have this property.

For your example you might want to chunk your audio file into groups of powers of 2 like, 1024,2048, or 4096.

$\endgroup$
  • $\begingroup$ What is the usual length of a chunk during sound processing? $\endgroup$ – Iter Ator Oct 28 '17 at 9:54
  • $\begingroup$ The usual length is not guaranteed to be a good length for your specific needs, due to time locality vs. frequency resolution trade-offs. The best segment length or window for certain wants/needs/requirements may even change within one signal. Overlap is another option. $\endgroup$ – hotpaw2 Oct 28 '17 at 17:59
  • $\begingroup$ Hotpaw is right that it's hard to give a good length without knowing more (for example music vs speech vs tones would all want different fft sizes). That being said try 1024 and read this post: stackoverflow.com/questions/5570355/… $\endgroup$ – user3741627 Oct 28 '17 at 19:11
1
$\begingroup$

Warning. The Fourier Transform will also transform non-periodic signals into spectral frequencies. It will do the same even if the input is changing, by adding sidebands to the result.

$\endgroup$
1
$\begingroup$

The Fourier transform is a theoretical construct. It does not bother about periodicity. If you have a changing signal, you can view its sinuidal components as "carrier" and the envelope as "signal", and the Fourier transform will be the convolution of the transform of the carrier (usually just a pair of dirac pulses at the carrier's frequency) and the Fourier transform of the envelope.

Now the envelope usually is significant more as a time sequence than in frequency space. Its changes are also at a much lower speed than the carrier oscillation.

So it usually makes sense to do analysis using short-term Fourier transforms. Those are good at detecting the carriers at a transitory envelope value under the assumption that the envelope changes are few compared to the window length. A limited time window also limits your frequency resolution: overlaps and windowing are used for getting the most of your data.

Now high frequency carriers can reflect envelope changes a lot better than low frequency carriers (or rather: frequency differences can be a lot larger, requiring smaller times to tell different frequencies apart): that makes multi-scale analysis attractive, and then we are no longer talking about short-term Fourier transforms for the time-frequency analysis needed to pick apart frequencies and envelopes.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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