Skip to main content
. 2024 May 7;11(5):464. doi: 10.3390/bioengineering11050464
Algorithm 1 Fast FrFT Algorithm with Plotting for EEG Signals.
Define Parameters:
  • α: The desired fractional Fourier transform angle.
  • N: The length of EEG signal x(n).
  • K: Scaling factor.
Algorithm Steps:
  • 1.
    Input: EEG signal x(n) of length N and desired fractional Fourier transform angle α for alcoholism detection.
  • 2.
    Output: EEG signal y(n) in the fractional Fourier domain and a scatter plot of the real and imaginary parts of the fast FrFT coefficients.
  • 3.
    Set the initial value of y(n) to x(n).
  • 4.
    Calculate the scaling factor K=exp(jπα/2).
  • 5.
    Initialize k to 1.
  • 6.
    While klog2(N) do:
    • (a)
      Set FFT length to 2k.
    • (b)
      Calculate the filter coefficients fk(m):
      fk(m)=m+12·expjπK(mN/2)22k (2)
    • (c)
      Filter the EEG signal y(n) using the filter coefficients fk(m) and perform an FFT to obtain the signal in the fractional Fourier domain.
    • (d)
      Multiply the signal in the fractional Fourier domain by the scaling factor K2k1.
    • (e)
      Inverse FFT the signal to obtain the EEG signal in the time domain.
    • (f)
      Set y(n) to the filtered EEG signal obtained in the previous step.
    • (g)
      Increment k by 1.
  • 7.
    Output EEG signal y(n) in the fractional Fourier domain.
  • 8.
    Calculate the fast FrFT coefficients ck:
    ck=1Nn=0N1y(n)·expjπα(nN/2)2N·expj2πnkN (3)
  • 9.
    Generate a scatter plot of the real and imaginary parts of the fast FrFT coefficients ck for alcoholism detection.