How to detect significant change / trend in a time series data? [closed]

As has been pointed out already, you’re not looking for the derivative. You’re really looking for a “significant change” detection algorithm for a time series. You’ll certainly want a smoothing filter (and the moving average filter is fine — see Bjorn’s answer for this part). But in addition to the smoothing filter, you will also … Read more

C/C++ library for reading MIDI signals from a USB MIDI device

PortMidi is another open source cross-platform MIDI I/O library worth checking out. On the other hand, if you are working on a sysex type of app, then direct Win32 works easily enough. Just came across another open source cross-platform framework that includes MIDI support: Juce. Also, I should note that there isn’t anything special about … Read more

Reverb Algorithm [closed]

Here is a very simple implementation of a “delay line” which will produce a reverb effect in an existing array (C#, buffer is short[]): int delayMilliseconds = 500; // half a second int delaySamples = (int)((float)delayMilliseconds * 44.1f); // assumes 44100 Hz sample rate float decay = 0.5f; for (int i = 0; i < … Read more

Step detection in one-dimensional data

convolve with a step, see if peak resolution is good enough import numpy as np from matplotlib import pyplot as plt d = ”’594. 568.55555556 577.22222222 624.55555556 546.66666667 552.88888889 575.55555556 592.33333333 528.88888889 576.11111111 625. 574.22222222 556.33333333 567.66666667 576.66666667 591.66666667 566.33333333 567.33333333 547.44444444 631.11111111 555.66666667 548.66666667 579.44444444 546.88888889 597.55555556 519.88888889 582.33333333 618.88888889 574.55555556 547.44444444 593.11111111 565.66666667 … Read more

calculate turning points / pivot points in trajectory (path)

You could use the Ramer-Douglas-Peucker (RDP) algorithm to simplify the path. Then you could compute the change in directions along each segment of the simplified path. The points corresponding to the greatest change in direction could be called the turning points: A Python implementation of the RDP algorithm can be found on github. import matplotlib.pyplot … Read more

Note onset detection

Here is a graphic that illustrates the threshold approach to note onset detection: This image shows a typical WAV file with three discrete notes played in succession. The red line represents a chosen signal threshold, and the blue lines represent note start positions returned by a simple algorithm that marks a start when the signal … Read more