# Filtering in time domain vs filtering in frequency domain

The signal is an impulse repsonse. I am filtering the signal using a windowed sinc filter in both frequency and time domain. I am interested in knowing the differences between the two methods and artefacts present in the filtered signal.

FILTERING IN FREQUENCY DOMAIN:

I am multiplying a signal with a windowed sinc filter in the frequency domain. Both the signal and the windowed sinc filter have the same length (524288). When I perform inverse fourier transform, the filtered signal is shifted by a number of samples as shown in figure below. The shift in the number of samples is equal to the length of the signal.

QUESTION : Why is the output signal shifted in time domain? Is this because multiplication in frequency domain corresponds to convolution in time domain?

FILTERING IN TIME DOMAIN:

The signal and windowed sinc filter are now in time domain. I am filtering the signal in the time domain, i.e., I am performing convolution in time domain. The filtered signal is time shifted and there are artefacts present after the signal has decayed as shown in figure below.

QUESTION : Why is the filtered signal shifted in time domain? What is the cause of the artefacts after the signal has decayed? Is it some portion of IR which is showing in the filtered signal?

In the last case, I set the window size of the windowed sinc filter to 512 samples, the length of the impulse response is the same as before 524288. When I filtering the impulse reponse in the time domain, there are no time shifted samples but there are artefacts at the end.

QUESTION : Why is the output signal not shifted in time domain? Are the artefacts at the end of signal are the first few samples of the impulse response?

QUESTION : Why is the output signal shifted in time domain? Is this because multiplication in frequency domain corresponds to convolution in time domain?

A windowed sync is non-causal. In order to be able to implement the filter it has to made causal by adding bulk delay. That delay is half of the filter length and this is exactly the time shift that you got here.

Frequency domain multiplication without proper zero-padding will also result in time domain aliasing. This isn't visible here since your filter and data appear to have already been zero padded or they are sufficiently small.

QUESTION : Why is the filtered signal shifted in time domain?

Again, bulk delay is needed to make the filter causal.

What is the cause of the artefacts after the signal has decayed?

That's most likely a bug in your code. The result is clearly wrong.

QUESTION : Why is the output signal not shifted in time domain? Are the artefacts at the end of signal are the first few samples of the impulse response?

Here apparently you used a non-causal filter: there is no time shift but you end up with time domain aliasing.

It would help a lot of you post your code how you generated these graphs. I'm guessing most of it is wrong, but without seeing it, we can't tell.

• Is bulk delay same as the group delay? I will post the codes. Nov 15, 2023 at 15:44
• Could you recommend any references where the basics of time domain convolution or frequency domain convolution can be found in detail? Nov 15, 2023 at 15:51
• Bulk delay is not necessarily the same as group delay, although for a linear phase FIR filter, it is. Convolution is fairly basic, so most university level DSP classes should cover it. I strongly recommend taking a full class that goes over all the fundamentals. The math behind this is quite complicated and you need a good set of fundamentals to get your arms around this topic Nov 16, 2023 at 17:36