I'm reading a wave-file and would like to apply the fast fourier transformation to it. However I've got a stereo signal and I'm wondering what to do with the left and right channel. Does the FFT need to be applied to both channels separately?
问题:
回答1:
Yes and no.
Certainly the FFT of each channel is independent, so you want separate FFTs for each of them.
However, it is possible to compute two FFTs of real data using one call to a routine for FFTs of complex data and some additional arithmetic. This is described in Numerical Recipes and here. One real signal is used as the real part of a complex signal, and the second real signal is used as the imaginary part. Their transforms can be separated in the result with the additional arithmetic.
This works because the FFT is a linear operation, so the real and imaginary parts of the transform are separable in a sense, and the symmetry in a real-to-complex FFT makes that separation relatively simple.
FFT routines in published libraries are typically highly optimized. Unless the code for the additional arithmetic is also well optimized, it may be faster to make two calls to a real-to-complex FFT routine than to make one call to a complex-to-complex FFT routine supplemented with your own implementation of the additional arithmetic.
A common use of FFTs is to transform a signal, multiply by the transform of a real impulse-reaponse filter, and perform the inverse transform. In this case, it is not necessary to separate the two signals; the multiplication may be performed on the combined data, and the new signals will be separated by the inverse transform.
回答2:
Since stereo channels are independent you need to apply the FFT to each channel. If you want only to process a single channel you would need to convert both stereo channels into a mono channel.