5
$\begingroup$

I'm studying the power spectrum.

Right now, I am making a program to try to make sure that the "Fourier transform of the multiplication of some data and window function" and the "convolution of the Fourier transform of some data and window function respectively" match.

$\mathcal{F}[f(t) w(t)]= F(\omega)*W(\omega)$

Since the left-hand side is just a Fourier transform, we could easily get the correct result. However, the right hand side is not calculated properly and does not match the result of the left hand side. The beginning and the end of the data are greatly inflated compared to the results obtained from the left side.

The right-hand side of the convolution theorem (which is actually discrete) is an expression like this

$\int_{0}^{N-1} F\left(\omega^{\prime}\right) W\left(\omega-\omega^{\prime}\right) \mathrm{d} \omega^{\prime}$.

If we consider the case where $\omega=0$, then $(- \omega ^\prime)$ will be 0, or negative.

In this case, how should we define $W(\omega ^\prime)$ in a case like this?

If $\omega ^\prime$= 0, or a negative value, should it be $W(\omega ^\prime)=0$ since there is only data between 0 and N-1? (I tried that, but it didn't give me the right result.)

sorry for my bad English, thank you!


It looks like this image.

Blue is the correct form of the left side, and red is the power spectrum obtained from the convolution in the frequency domain of the right side.

Perhaps the integration range of the convolution integral is wrong...

enter image description here

$\endgroup$
2
  • $\begingroup$ Could what you describe be caused by the Gibbs phenomenon? $\endgroup$
    – fibonatic
    Dec 22, 2021 at 1:41
  • $\begingroup$ If it is a Gibbs phenomenon, the power spectrum obtained from the left side should have the same shape, but it only looks like the power spectrum obtained from the right side. $\endgroup$
    – arcTomato
    Dec 22, 2021 at 1:50

1 Answer 1

4
$\begingroup$

If you look at the questions dealing with the other side (Convolution on time domain and element wise multiplication of frequency domain) you'd see that in order to have proper equality one must pay attention to the borders and type of convolution.

For example, have a look at Applying a 2D Convolution Using 2D FFT which aggregates many other answers.

Specifically in your case, assuming the atoms of: FFT Conversion, Convolution and Element Wise Complex Multiplication are implemented correctly you must pay attention to the properties of the DFT.

Just like in links above you must remember that element wise multiplication in the time domain is equivalent of circular convolution in the DFT domain. So one thing to remember is to apply a circular convolution.
The other one is remembering that the FFT is usually not implemented as a unitary transform.
Hence we need to factor $ \mathcal{F} \left[ f \left( t \right) w \left( t \right) \right] $ by the number of samples.

A simple MATLAB code:

numSamples = 10;
vA = randn(numSamples, 1);
vB = randn(numSamples, 1);

vC = numSamples * fft(vA .* vB);
vCC = cconv(fft(vA), fft(vB), numSamples); %<! Circular convolution

norm(vC - vCC, 1)

The error is 5.1341e-14.

Update

Just to make things clearer. When dealing with discrete signals in the context of the Convolution Theorem the linear convolution becomes circular / periodic convolution.
Moreover, the convolution theorem works in symmetry, namely element wise multiplication in one domain is equivalent to circular convolution in the other domain (Assuming proportion constants are defined correctly).

$\endgroup$
5
  • $\begingroup$ The problem of convolution in the time domain is often talked about, but I don't understand much about convolution in the frequency domain. Is circular convolution effective for convolution in the frequency domain as well? A further question is the consistency with the properties of DFT. Depending on the definition of DFT, when the wavenumber of the resulting Fourier transform is zero, it should simply be a sum of time domain functions. Is this also valid for frequency domain convolution? I.e. $F(0)W(0)+F(1)W(-1)+.... = \Sigma f(t)w(t)$ is valid? (I find this hard to convince myself...) $\endgroup$
    – arcTomato
    Dec 22, 2021 at 5:42
  • $\begingroup$ When you multiply element wise in one domain it is equivalent, for discrete signals, to circular convolution in the other domain. You may have a look at the code. $\endgroup$
    – Royi
    Dec 22, 2021 at 6:00
  • $\begingroup$ Sorry for the delayed response, thanks for the advice. $\endgroup$
    – arcTomato
    Dec 22, 2021 at 11:56
  • $\begingroup$ What are the proportion constants you are referring to? Do you mean the numbers in front of the integral when defining the Fourier transform? $\endgroup$
    – arcTomato
    Dec 23, 2021 at 1:57
  • $\begingroup$ Yes. For instance, in my code, for the classic fft(), it is numSamples. $\endgroup$
    – Royi
    Dec 23, 2021 at 3:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.