# Seamless audio loops via Fourier transforms?

I am trying to create short seamless loops of continuous sound.

I recorded myself making an "Aaaaah" sound at 44.1 KHz, and cut this recording to a section containing 4096 samples (giving me slightly under 1/10th of a second of audio).

When I play this in a loop, the sound is very much recognizable but there is of course an audible ticking noise at the point where it is cut.

I applied an FFT transform to this data. When I apply an inverse FFT to the Fourier tables to recreate the signal, the defect is of course still audible.

Is there anything I can do to the Fourier tables to eliminate the defect without changing the other audible properties of the recording? I'm very much uneducated in signal processing, but intuitively I feel that since the ticking sound repeats once per loop, it might be possible to work in the frequency domain to achieve my goal of cleaning it up to produce a seamless continuous sound.

Note: In case there are Javascript programmers here, I created a CodePen here with the "Aaah" loop and its conversion to and from Fourier tables, to facilitate experimentation in code.

• The clicking is due to a time-domain discontinuity in the waveform. You're unlikely to find anything to do in the frequency domain to fix that, short of lowpass-filtering it to the point where the high-frequency content in the click isn't audible. You would likely notice degradation in the sound of interest in that case, though. Commented Aug 31, 2015 at 19:57
• Thank you! What about a window function? I tried applying a Hanning window to the sample data, and the tick is gone but there is now a vibrating effect since the amplitude increases and decreases during the loop. Could there be a way to process this out? Commented Aug 31, 2015 at 20:17
• Why not just have a smooth ramp up of a few samples at the beginning of your sample and then a smooth ramp down at the end --- keeping greater than 99% of the samples the same. Using a window across the whole signal will cause a low frequency modulation, which may give the undesirable side tones you are noticing.
– Peter K.
Commented Aug 31, 2015 at 20:46
• Why not use a phase vocoder to do this frame freeze? Its will keep the phase coherence at every 4096 frame. Commented Aug 31, 2015 at 22:28
• it's the same issue of looping with the samplers from the 80s and 90s. consider AMDF or autocorrelation to find click-free splice points. and then crossfade, in case your splice points are not perfectly matched. Commented Sep 1, 2015 at 0:44