Frequency response creates non-causal impulse response I have frequency response data. It is output from an acoustic simulator.

I convert this into an impulse response, and get:



In that picture the blue line is the impulse response. Mostly it is hiding behind the green line (which is the impulse response if I halve the frequency resolution).

I'm sorry for an unclear picture. I will replace it in due course.

Anyway, the thing I notice of interest is that if the impulse response is regarded as a loop, the ends appear to match up.

Is there any mathematical basis for this?

It seems strange to me that the impulse response is somehow non-causal.  Because what it is modelling is a single pressure wave hitting a microphone.  Commonsense suggests to me that it should have a very sharp attack as the main wave hits followed by diminishing ripples corresponding to echoes.

So I'm quite surprised to see ripples before the main spike, let alone before t=0, as it were.

Is this some artefact of the FFT due to the fact that it is forced to sample at discrete intervals, therefore the spike cannot be completely accurate, and maybe the preceding wobbles are compensating for this.

In which case would I do better to reposition the start of the impulse response 100 samples in from the end, and have it wrap round?
I am familiar with similar phenomena. During measurements with usage of sweep-sine, when you convolve your signal with inverse filter you are obtaining your IR. Although if you consider perfect case of convolving your original sweep $x(t)$ with the inverse filter $f(t)$, then you should get perfect Kronecker delta. Unfortunately what you will get is an impulse with pre and post-ringing:

One way to minimise this effect is to use so called Kirkeby Algorithm, described here by A.Farina (my guru of acoustic measurements): Advancements in Impulse Response Measurements by Sine Sweeps. I am sure will find it quite fascinating.

One last tittle-tattle:


  Commonsense suggests to me that it should have a very sharp attack as the main wave hits followed by diminishing ripples corresponding to echoes.


You are definitely right, although in real world measurements it is possible to have preceding spike before main impulse in some cases. For example if you place your source close to the wall, then wave from speaker will excite mechanical wave in a wall and wave will propagate in the material with speed of sound much higher than in case of air. Nextly wall will emit acoustic wave that will be captured by your microphone.