# Equalization : using the spectral or the temporal signal?

I'm trying to equalize a sound signal - using a JAVA program - and I'm using this process : 1/ Conversion of the temporal signal to a spectral signal, using a FFT

2/ Applying a coefficient to each frame of the spectral signal to equalize it

3/ Conversion of the spectral signal modified to a temporal signal

4/ Reading of that temporal signal

If I'm applying that process to a "pure" signal (ex : a 400 Hz sinusoïdal signal generated "on the fly" by a java class), it seems to work. But if I'm applying it to a "real" wav signal (a song, for example), the result is unsusable. I hear a kind of "sliced" sound, even if all the equalization coefficients are equal to "1" (=no modification).

So, to equalize a sound, does the process I describe above is the right solution ? Or shall I avoid that double conversion and applying a convolution product on the temporal signal ?

If I have to do apply a convolution product, how to do it ? I have no clue about calculating it with "random" signals.

Thank you for all your answers.

• if you equalize in frequency, maintaining phase continuity is a challenge which is why you are likely hearing the "sliced" results. To do this with multiple frames you would want to do an overlap-add approach with windowing but I suspect a time domain convolution would be simpler (depending on what exactly you are trying to equalize). Can you elaborate on what result you are hoping to achieve by equalizing? Oct 12, 2018 at 11:24
• Yes, my aim is to realize an equalizer like the analogic ones : you enter some music, you "sculpt" the signal and then, you let the signal going out... And each "band" is acting like a bell filter or a low / high cut filter. Oct 12, 2018 at 13:53
• An FFT approach would be perfect as the FFT is a filter bank, you would want to set it up as a streaming FFT approach. You can try shifting the input signal by just one sample and compute each output while you shift and sum the resulting IFFT's by one sample accordingly. You can also look into "overlap-add" approaches to do this more efficiently. Another option is to implement linear phase bandpass filters in the time domain with identical delay in each filter, arrange the filters in parallel and then sum the outputs. I am not confident in my answers so only giving as thoughts/ideas. Oct 12, 2018 at 14:01

## 1 Answer

If you are trying to make a proper filter, you would want to use FFT convolution, which is like OLA, but not the same. OLA is more of a synthesis technique for reducing noise between frames caused by incoherent phase mangling from directly manipulating frequency data. You also need to resolve the phase of the bins for your filter. You are only defining the magnitudes and phase at those discrete frequencies, not the frequencies in between, which can be radically different then what you have in your head. The easiest thing to do is to use linear phase to center the impulse of the filter in the window. This can be done by multiplying each bin magnitude by e^jpik. If you are trying to realize an analog prototype, this is a bad way to do it. Your frequency bins are linearly spaced, but analog filters are logarithmic. The effect will be that your lower bands have a lower “Q” and vice versa. You can still do it, but it may not do what you wanted.