1

Let's say I have a piece of music, and I want to find patterns that reproduces themselves so that I can cut out certain areas without it being audible.

For example : enter image description here

enter image description here

What would be the best approach in python?

I thought about generating a waveform and then slicing it into images to find two similar ones but I don't know where to start and if it's a good idea.

Regis
  • 53
  • 6
  • You can try to use a rolling autocorrelation of the signal, e.g. https://stackoverflow.com/questions/51453152/computing-rolling-autocorrelation-using-pandas-rolling. – jfaccioni Sep 16 '21 at 14:24

2 Answers2

0

you can split signal into buffers and compare it with fft. If the result of the fft differs from previous one by certain specified value, you can divide the part... but this really depends on what kind of music you are doing this alorithm for - for example, for house music it could be problematic to distinguish parts with fft, so you could for example acquire tempo of the track via waveform of the percussions and measure rms value.. if the rms value is changed, you have next part. The most fun and valid solution for this problem woudl be to actually use neural network, where waveform is your input and output list of the timestamps of certain parts and there you go

Mateusz
  • 17
  • 5
0

To complete Mateusz answer, here is a post about Fourier transform to générate new features. Other tools exists to split an audio file into patterns or parts using pyAudioAnalysis. An explanation is given here

Cunningham
  • 178
  • 2
  • 10