# Manipulating with frequencies through fftw

I'm using portaudio for I/O audio streaming, and I wanted to apply some equalization on audio input from microphone. I found that most people refer to fft for task like that, so I use FFTW library in my project. My first idea was to select frequency bins in some range, from fft resulting complex array, and increase their amplitudes by scaling them with some factors. But this resulting only in noise, there is no sign of any equalization. So my question is, is it possible to increase volume at specified frequencies, through fft, and if so, how to do that. My experience so far makes me think that any change of those values in fft complex array just destroys the sound. Is there a proper way to manipulate with that complex data from fft resulting array?
Any tips for equalization other than fft are also welcome.

• Does your code work (not result in noise) if you do the fft/ifft, and don't change any bins in the fft? If not, debug. If so, please show the code for your fft bin modifications. Feb 17, 2014 at 17:05
• "apply some equalization on audio input from microphone. I found that most people refer to fft for task like that" It's easier to just do time-domain filters. Jul 31, 2014 at 21:09

## 2 Answers

You applied the FFT to the full signal? Then modification of the amplitudes will likely destroy any time locality.

Use the so-called STFT, short term Fourier transform, or overlap-add method to get a time-localized frequency analysis.

• What do you mean by 'full signal?' I capture and process input in small blocks Feb 17, 2014 at 19:56
• This was not entirely clear from your question. So the first condition is met. Do you also use windowing in such a form that overlapping segments add to one, i.e., that the shifted window functions form a partition on one? Feb 17, 2014 at 21:45

If you want a real result, then the full array given the IFFT has to be complex conjugate symmetric. But you are modifying only half of the array (below index 513) and not the other, rendering a symmetric array non-symmetric.

In addition, a brick wall transition may produce ringing artifacts. In addition, if you are processing blocks of a longer signal, then overlap-add or overlap-save using longer FFTs is required to avoid circular convolution artifacts.

• In the Documentation you can see that all the arrays are sized correctly. And I 've got the real result. Feb 18, 2014 at 10:49
• The real result isn't the complete result if your input (all 1024 bins) to the ifft isn't conjugate symmetric. Test this. Feb 18, 2014 at 16:32