Power Spectral Density from jTransforms DoubleFFT_1D

后端 未结 3 960
悲&欢浪女
悲&欢浪女 2020-12-08 22:36

I\'m using Jtransforms java library to perform analysis on a given dataset.

An example of the data is as follows:

980,988,1160,1080,928,1068,1156,11         


        
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 23:15

    To get the magnitude of bin k you need to calculate sqrt(re * re + im * im), wheer re, im are the real and imaginary components in the FFT output for bin k.

    For your particular FFT re[k] = a[2*k] and im[k] = a[2*k+1]. Therefore to calculate the power spectrum:

    for k in 0 to N/2 - 1
      spectrum[k] = sqrt(sqr(a[2*k]) + sqr(a[2*k+1]))
    

提交回复
热议问题