Calculation of inverse impulse response in the frequency domain I want to calculate the inverse impulse response of a LTI system in the frequency domain. I generate a simple impulse response $g$. For this I generate a vector of 100 zeros. I set the value of the 20th sample to 0.5.

I calculate the frequency response function by calculating the Fourier-Transformation $h=\mathcal F(g)$.
I invert every single frequency bin in $h$ where $h_{inv}[k]=\frac{h[k]^*}{|h[k]|^2}$ (This is the formula for the inverse of a complex number)
I do a inverse Fourier-Transformation $g_{inv}=\mathcal F^{-1}(h_{inv })$
I plot $g$ (blue) and the calulated inverse $g_{inv}$ (red)


Question: Why is the impulse of $g_{inv}$ at 82 samples? Is $g_{inv}$ my inverse impulse response?
Matlab code:
g=[zeros(1,19) 0.5 zeros(1,80)];
h=fft(g);

h_inv=conj(h)./(abs(h).^2);
g_inv=ifft(h_inv);

figure
plot(g)
hold on
plot(g_inv)
Your result is correct, even if it seems a bit counterintuitive. Note that you don't compute the Fourier transform but the discrete Fourier transform (DFT). The system you want to invert has the impulse response
$$g[n]=\frac12\delta[n-19]\tag{1}$$
Obviously, the inverse system must advance the incoming signal by $19$ samples:
$$g_{inv}[n]=2\delta[n+19]\tag{2}$$
Clearly, that system is non-causal. Taking into account the implicit periodicity of the DFT (and IDFT) with length $N=100$, the signal $g_{inv}[n]$ cannot be distinguished from a signal $g_{k,inv}[n]=g_{inv}[n+kN]$, $k\in\mathbb{Z}$. Your result is just $g_{-1,inv}[n]$:
$$g_{-1,inv}=2\delta[n+19-N]=2\delta[n-81]\tag{3}$$