Skip to content

Instantly share code, notes, and snippets.

@mkolod
Created January 20, 2016 19:03
Show Gist options
  • Select an option

  • Save mkolod/033c70b54136a1b11f46 to your computer and use it in GitHub Desktop.

Select an option

Save mkolod/033c70b54136a1b11f46 to your computer and use it in GitHub Desktop.
# sine wave in time domain
x <- seq(0, 20*pi, 0.01)
y <- sin(x)
plot(x, y, type='l')
# inverted time domain after 2 FFT applications
invertedY <- fft(fft(y)) / length(y)
plot(x, invertedY, type='l')
# original time domain after 4 FFT applications
originalY <- fft(fft(fft(fft(y)) / length(y))) / length(y)
plot(x, originalY, type = 'l')
@mkolod
Copy link
Author

mkolod commented Jan 20, 2016

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