Background - Create context
I am trying to synthesise some impulse responses to simulate an active noise control system. I have already formulated the problem in the frequency domain so now I want to move to the time-domain formulation.
The transfer functions I have used in the frequency domain are those of point/monopole sources given by
$$ p \left( \omega, r \right) = \frac{j \omega \rho}{4 \pi r} e^{-j k r} \tag{1} \label{1} $$
where $r$ is the distance between two points (source and receiver), $\rho$ is the density of the medium of propagation (air for my case), $\omega = 2 \pi f$ is the radial frequency with $f$ the temporal frequency, $k = \frac{\omega}{c} = \frac{2 \pi}{\lambda}$ is the wavenumber with $c$ the speed of propagation and $\lambda$ the wavelength and $j = \sqrt{-1}$ is the imaginary unit.
Since I have the transfer function for each frequency of interest from one source to one receiver I would like now to get an impulse response (IR) from this frequency domain representation.
Implementation
To transition to the time domain, I define the following parameters:
- Sampling frequency: This can be arbitrary based on the needed bandwidth (and possibly other factors).
- Length of the IR: This will have an impact on the chosen frequencies of interest as it dictates the frequency resolution.
- Frequencies of interest: These are defined as the frequencies corresponding to the frequency bins in the range of interest (can be a single frequency, a range or discrete frequencies in the range).
To generate the single-sided spectrum I assign the values calculated with equation \eqref{1} in the appropriate bins (whose frequencies are used in the equation to get the transfer functions). Next, I generate the two-sided spectrum by mirroring the first half (except for the DC component) and conjugating. The result for a signal with frequencies from about $10 \, \textrm{Hz}$ to about $80 \, \textrm{Hz}$ can be seen in the image below. The sampling frequency is $300 \, \textrm{Hz}$ and the length of the (double-sided) spectrum vector is $201$ samples. The distance $r$ corresponds to $0.5 \, m$.
All trends expected from equation \eqref{1} can be seen (linear phase and the amplitude increases with frequency). Now, when I take the inverse Fourier transform to acquire the IR of this spectrum I end up with what can be seen in the next figure.
The second plot, termed “Centred” has moved the second half of the IR to the first in a cyclic manner (implementation is performed in MATLAB and uses the ifftshift
function). I believe in the second plot, the time axis has to be changed to go from negative half the duration to positive half the duration but this is not done in the figure.
Question
The first, and possibly the most important question here is, whether the second plot of the last figure above, showing the impulse responses, is the correct one. My intuition says that, since the synthesis is performed entirely in the frequency domain, there is no causality constraint and some kind of “time domain aliasing” takes place here but I am not sure I understand it completely.
Furthermore, an additional question is related to the energy spread in time manifesting as ripples in the impulse response. Is there any way to avoid this and concentrate the energy towards the “main part” of the IR?