Convolution and Deconvolution in C
Convolution, using FFT, is much faster for very long sequences. Circular convolution is based on FFT and Matlab's fftfilt() uses FFT on convolution step. It is explained very well when it is faster on its documentation.

Example code for convolution:

L = length(x)+length(y)-1;
c = ifft(fft(x, L) .* fft(y, L));




Deconvolution can be calculated using FFT as well. However, element-wise division may result NaN outputs when both elements are equal to zero. You either can use isnan() function, or add a very small number on both elements to fix this issue.

Example code for deconvolution:

epsilon = 2e-17;
y = ifft((epsilon+fft(c))./(epsilon+fft(x, length(c))));


Here c is the convolution of x and y. Leftover elements can be cut as; y(1:length(c)-length(x)+1).



Results from Matlab:

a = 1:3; b = 4:7; c1 = conv(a,b)   %Matlab's convolution

c1 =

     4    13    28    34    32    21

d1 = deconv(c1,b)   %Matlab's deconvolution

d1 =

     1     2     3

d2 = ifft((eps + fft(c1)./(eps + fft(b, length(c1)))))

d2 =

    1.0000    2.0000    3.0000   -0.0000         0   -0.0000


First 3 elements will be a value where you can cut after length(c1)-length(b)+1. You can implent it in C language easily.