Hi There,

Sorry it's taken me some time to work through this a bit more thoroughly.

In general if a fast convolution (i.e. FFT based) is used the result is a circular convolution, which can affect the result. Take the following small (MATLAB) example:

- Code: Select all
` a = [1:6]`

b = [1, 2, 1]

ifft(fft(a,6).*fft(b,6)) % zero extend to the length of the input signal (6)

% Result:

% 18 10 8 12 16 20

% Now zeros extend to length(a) + length(b) - 1 (or 8)

ifft(fft(a,8).*fft(b,8))

% Result

%1.0000 4.0000 8.0000 12.0000 16.0000 20.0000 17.0000 6.0000 % Note the difference in the first 2 points - this is because there's no wrapping from the effects of the circular FFT

% now a non-FFT-based convolve

conv(a,b)

% Result

% 1 4 8 12 16 20 17 6 %note that it's the same as the N+h-1 zero padding

After the convolve resulting in a vector of length: N+M-1 - I would normally adjust for the FIR filter transients by removing the extra samples on either side of the sequence.

However with the arrayfire convolve and FIR functions it's not clear:

1. What is the zero extension? (is it just to N, or to N+M-1)

2. Because it results in a sequence of length N, are samples thrown away, or are we only zero extending to N samples?

3. What are the differences between the FIR function and the Convolve function?

4. What alignment is being performed?