4
$\begingroup$

I converted time domain waveform signal to frequency domain using FFT, The bin size was 1 HZ. We saved the data but now for different analysis we need to change the binning to 100Hz. Can I combine all 100 frequencies in each bin by adding them up as sum of magnitudes divided by frequencies ? Do I do this for both the real and imaginary parts ?

$\endgroup$
8
  • $\begingroup$ explicitly, why are you "rebinning"? Is the size of your FFT being changed? $\endgroup$ Commented Sep 19, 2023 at 23:57
  • $\begingroup$ It is many MGz of data for each waveform and there are many thousands of them. Some algorithms that use it do not need that resolution so we are trying to shrink the data traveling over the network. $\endgroup$ Commented Sep 20, 2023 at 0:00
  • $\begingroup$ so you have the same sample rate, but you are changing the window size? $\endgroup$ Commented Sep 20, 2023 at 0:01
  • $\begingroup$ Correct, let's say we have 100 millions of datapoints over 1 second. The data size from FFT with window size 1 Hz is 50mln and it is saved on the server. If the clients request this data with 50 Hz windows size was want to combine the data on the server and and return only 5 mln data points instead of 50 mln. $\endgroup$ Commented Sep 20, 2023 at 0:07
  • $\begingroup$ Or, like you said, sum bins 1to50, 51to100, 101to150 etc but whoever’s asking should know that you’re providing them with the sum of magnitudes in these frequency bands. $\endgroup$
    – Jdip
    Commented Sep 20, 2023 at 1:23

1 Answer 1

2
$\begingroup$

The increased bin size corresponds to a decreased total duration in time for the equivalent time domain waveform.

If a complex valued FFT is desired (accurately representing the magnitude and phase as if we had originally taken a 100 Hz bin spaced and therefore shorter duration FFT), then an accurate procedure would be to take the inverse FFT to recover the time domain waveform, and then truncate this waveform to the shorter length (and shorter number of samples) and then take the FFT of this shorter duration sequence. Ideally for this we would like to use an inverse FFT algorithm that only returns a portion of the total samples if it were more efficient to do so (specifically the first one hundredth of the total number of samples if we want 100 Hz spacing instead of 1 Hz spacing). There are alternate algorithms such as the Goertzel that could be used to return a subset of all the inverse FFT samples, but the direct inverse FFT algorithm would still be more efficient given the total number of samples needed in the OP’s case. (Consider how every bin in the original FFT result is needed to recover even just the first time domain sample). That said, I can’t think of a more efficient approach than doing the inverse FFT, truncate in time to the shorter duration and then take the FFT. The result of this would be the FFT if we originally only had 100 Hz bin spacing (and the associated shorter duration waveform capture in time).

If, however, a power spectral density is desired, in which the result is only a magnitude spectrum with no phase, then all samples could be used such that groups of 100 bins associates with each 100 Hz sub-band should be sum-squared (for a power qty and using $10Log_{10}()$ to express in dB) or root-sum-squared (for a magnitude qty and using $20Log_{10}()$ to express in dB). The squaring for the complex FFT samples should be complex conjugate products, which results in being the square of the absolute magnitudes for each frequency bin. But even for this purpose (unless the ability to process the inverse FFT of the original sequence was not feasible for some reason), for the case of a power spectral density my approach would be to recover the original time domain sequence using the inverse FFT and then compute the power spectral density using the Welch Method, which comes down to taking smaller FFT’s of each shorter block in time over the entire time domain sequence and averaging the individual magnitude spectrums. This results in a power spectral density with much less variation or noise in the result as I detail in this post: https://dsp.stackexchange.com/a/87731/21048

$\endgroup$

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.