Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some intermediate steps #52

Closed
telephon opened this issue May 20, 2021 · 1 comment
Closed

some intermediate steps #52

telephon opened this issue May 20, 2021 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation python

Comments

@telephon
Copy link
Collaborator

telephon commented May 20, 2021

I think it would help the students if we add some more basic transformations of the FFT before doing the sorting via ML techniques.

here are some suggestions:

## reconstruction of the original
data_inverted = librosa.istft(data_fft, hop_length=HOP_LENGTH, win_length=WIN_LENGTH)
display(Audio(data_inverted, rate=sr))

## backwards
data_fft_shifted = np.flip(data_fft, axis=1)
data_shifted = librosa.istft(data_fft_shifted, hop_length=HOP_LENGTH, win_length=WIN_LENGTH)
display(Audio(data_wo_phase, rate=sr))

## inverted spectrum
data_fft_shifted = np.flip(data_fft, axis=0)
data_shifted = librosa.istft(data_fft_shifted, hop_length=HOP_LENGTH, win_length=WIN_LENGTH)
display(Audio(data_wo_phase, rate=sr))

## scrambled spectrum
import random
data_fft_shuffled = data_fft.copy()
random.shuffle(data_fft_shuffled)
data_shuffled = librosa.istft(data_fft_shuffled, hop_length=HOP_LENGTH, win_length=WIN_LENGTH)
display(Audio(data_shuffled, rate=sr))

then it would be nice to have something similar to the following sclang transformations in python, of course only if there is a simple equivalent:

n = data_fft.size;
Array.fill(n, { if(0.3.coin) { 1 } { 0 } }) * data_fft
Array.fill(n, { |i| if(i.linlin(0, n, 0, 1).coin) { 1 } { 0 } }) * data_fft
data_fft.rotate(n div: 2)
@capital-G capital-G added documentation Improvements or additions to documentation python labels May 26, 2021
@capital-G capital-G self-assigned this May 26, 2021
@capital-G
Copy link
Owner

I think this is implemented via #59 which does a deep dive on FFT.
if not feel free to re-open again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation python
Projects
None yet
Development

No branches or pull requests

2 participants