```>Is there a way

Key words: oversampled filter banks.

http://electronix.ru/forum/index.php?s=&showtopic=23652&view=findpost&p=929325
```
```Alessandro

RBJ is correct that you need to limit the length of your effective FIR. But when he speaks of the FIR, he means that you first design some FIR filter (with length less than the size of the FFT) that gives a particular desired frequency response, and then take the fft of that FIR, and then use those coefficients to multiply your signal spectrum.

Reading your original post, it sounds like you are trying to directly manipulate quantities in the frequency domain, almost like you had a  graphic equalizer with a lot of knobs. So you are looking for some simple rules to follow in the frequency domain to make sure you don't get aliasing.

I think your intuition about making only gentle changes is probably correct, but one way to enforce the correct rule would be to dial in your desired "spectral modification array", inverse transform it into the time domain, truncate the time-domain buffer to "obey the law", and then transform back. This should the give you a new array that you can use to multiply with the signal fft frames. If you have made gentle changes then the desired and modified responses shouldn't look too different.

I think one reason the "gentle change" rule sort of works is that for any particular frequency, there will be energy across several bins (depending on your window function), and in order for alias cancellation to work those bins need to have certain amplitude/phase relationships relative to each other, and if you simply dial in some zero-phase frequency-domain modifications you are violating those required relationships. By only making gentle changes, the relative amplitudes between bins that all contribute to a particular frequency are pretty close to their correct alias-canceling condition.

I'm sure there are more elegant mathematical ways to construct a spectral modification array that will not cause aliasing, but my guess is that they will be more complicated than the steps of inverse transform, truncate, and re- transform that I mentioned above.

Note that I am not 100% confident about my answer, so someone please correct me if I got it wrong.

Bob
```
```robert bristow-johnson <rbj@audioimagination.com> wrote:
> On 3/1/13 2:04 PM, ale.saccoia wrote:

>> The impulse response of such a filter has a finite length
>> (even if it's not, a window function can be applied), so the
>> result of the frequency domain multiplication is going to be
>> the same as the convolution in time domain, as long as I
>> zero-pad by at least the length of the impulse response of the
>> filter, to avoid circular convolution and time domain aliasing.

> well, you *are* doing circular convolution in any case when using the
> FFT to do it.  if overlapping is avoided, then time-domain aliasing is
> avoided.  the way to avoid that particular overlapping with circular
> convolution is to limit the impulse response length and the frame hop
> distance (which sets how many new samples to process in each frame).

Or use DCT, which doesn't have the periodic boundary conditions
that the FFT has.

-- glen
```
```On 3/1/13 2:04 PM, ale.saccoia wrote:

...
> The impulse response of such a filter has a finite length
> (even if it's not, a window function can be applied), so the
> result of the frequency domain multiplication is going to be
> the same as the convolution in time domain, as long as I
> zero-pad by at least the length of the impulse response of the
> filter, to avoid circular convolution and time domain aliasing.

well, you *are* doing circular convolution in any case when using the
FFT to do it.  if overlapping is avoided, then time-domain aliasing is
avoided.  the way to avoid that particular overlapping with circular
convolution is to limit the impulse response length and the frame hop
distance (which sets how many new samples to process in each frame).

if N is the FFT size (usually a power of 2), L is the length of the FIR
and less than N, then the frame hop distance is N-L+1.  that's how many
samples you can process per frame with fast convolution.

...
>
> Is there a way / is it a common thing to limit the "depth" of
> spectral transformation so that the impulse response of the
> transform fits within the length of the window + chosen zero-padding?

limit the length of the FIR.  whatever filter you can get with an FIR of
a limited length.

--

r b-j                  rbj@audioimagination.com

"Imagination is more important than knowledge."

```
```Hi list,