Skip to content

Instantly share code, notes, and snippets.

@ak-git
Last active December 13, 2023 11:11
Show Gist options
  • Save ak-git/d93d9305eab1fe5e77cd3e333638bab8 to your computer and use it in GitHub Desktop.
Save ak-git/d93d9305eab1fe5e77cd3e333638bab8 to your computer and use it in GitHub Desktop.
Fourier Transform in R
signal <- c(1, 0, 0, 1)
fft_result <- fft(signal)
print(fft_result)
@ak-git
Copy link
Author

ak-git commented Dec 13, 2023

@ak-git
Copy link
Author

ak-git commented Dec 13, 2023

Input:
1, 0, 0, 1
Result:
2+0i 1+1i 0+0i 1-1i

@ak-git
Copy link
Author

ak-git commented Dec 13, 2023

Input:
1, 0, 1
Result:
2.0+0i 0.5+0.8660254i 0.5-0.8660254i

@ak-git
Copy link
Author

ak-git commented Dec 13, 2023

Input:
1, 0, 1, 1
Result:
3+0i 0+1i 1+0i 0-1i

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment