1
$\begingroup$

I am trying to extract harmonic motion from series of images. One approach ist to simply take the (discrete) fft:

tmp = fft(imageSeries, [], 3);

where imageSeries is a stack of black and white images with the third dimension being the image number. I can then select the bin I expect my motion in (the 3rd bin as it happens) and extract my result.

The other option is to compute the optical flow between consecutive images and extract the harmonic motion again using the third bin of the fft.

As I am very unfamiliar with signal processing, I'm now unsure what the units in my (now complex) motion fields should be. I know that the optical flow algorithm should return in units of pixels per step, but what happens when I use the fourier transform on this? And what units do I get when I simply fouriertransfrom along the stack? Any explanation or resources are very appreciated, thank you for your time

$\endgroup$
1
  • $\begingroup$ The frequency difference between successive coefficients, $\Delta f$, will be equal to the the inverse of the time covered by the time series $1 / T$. That should allow you to calculate the frequency associated with the third bin. $\endgroup$
    – FTT
    Commented Nov 2, 2022 at 11:51

1 Answer 1

0
$\begingroup$

The discrete fft (or DFT) has same unit as the argument. No matter what dimensionality the DFT has. This is different from the continuous FT of f(x) where the result has unit U*V when the original f(x) has unit U and x has unit V.

The "x-axis" of the DFT result is just a counter and has unit 1. Whether you transform a signal of scalars or a sequence of images does not matter. For the latter each pixel will be transformed independently. As the DFT of a finite sequence results in the same length sequence the dimensionality of your data will not change. It will become complex numbers though and the old "time axis" will now be the "frequency axis".

I write time and frequency axis in quotes as these axises are really counters and so do not have time and frequency as unit.

To convert the frequency bins to real frequencies one needs to consider that the the first bin after the DC part $j=1$ corresponds to the frequency, where one period covers the full data length.

So if the data vector has length $N$ and the x-axis of the i-th sample is $i \Delta x$ (i.e we have a spacing of $\Delta x$ of the source data) the frequency of the j-th frequency bin is at frequency

$f_j = j / (N \Delta x)$.

$\endgroup$
1
  • $\begingroup$ ahhh, I had it completly wrong then. Thank you so much! I dont have enough reputation to upvote, but I have marked your answer as correct. Thank you again! $\endgroup$ Commented Nov 2, 2022 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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