Hello everyone !
I’ve been recoding the Cubic Spline Interpolation algorithm as found here, so I can use it to play with waveforms. One of the major interest is to be able to resize the sample, thus tuning it.
With SC, I’ve generated an array corresponding to a 440HZ sinusoidal waveform :
var array440 = Array.fill(440, { |i| sin(pi * 2 / 440 * i) }) ++ [0];
Which I’ve interpolated, multiplying it’s size by 16 :
It’s not perfect, but good enough.
However, when downsampling, I’ve noticed that clicks happens at the start and the end of the new sample. This is especially audible here, with the 16 times downsampling, which last for ~140 ms.
Still, the sample starts and ends at 0, and follows a curve that I wouldn’t consider brutal :
The end of the file looks the same (mirrored down and backwards that is).
I believed that clicks where caused by ‘brutal’ jumps between a sample and the next one. However, here, clicks are occurring despite a curve that seems smooth enough. I guess it isn’t smooth in the end ?
I tried to fade in the beginning of the curve (and the end) but this did not remove the clicks.
I have an intuition that this might be because the amplitude is raising almost linearly, where it should be naturally raising exponentially ?
Does anybody know why those clicks occur ?
Thank you, Simon.