Skip to content

Instantly share code, notes, and snippets.

View Minenik2's full-sized avatar
🎵
Listening to Reol - 金字塔!

Minenik2

🎵
Listening to Reol - 金字塔!
  • IT Masters Student at University of Oslo
  • Norway
  • 13:54 (UTC +02:00)
View GitHub Profile
@Ravarcheon
Ravarcheon / spectralRotation.py
Last active June 7, 2024 14:48
rotates an audio file by 90 degrees in the spectrum while being a reversible process with minimal loss (only floating point errors which are like -150 dB but thats literally silence ahaha~)
import numpy as np
import soundfile as sf
from scipy.fftpack import fft, ifft
def rotateSignal(signal,flip):
if flip:
signal = signal[::-1]
x = np.concatenate((signal, signal[1:][::-1])) # concatenating the array with a reverse of itself makes it such that the fourier transform doesn't layer over a reversed version of itself in the inverse fft
rotSig = ifft(x)