Simple tool for frequency measurements.
Read our data, every column in this .csv file represents a random oscillations with a step in the middle.
freqs = pd.read_csv(r'test_freqfile/test_oscillations.csv')
Let's create object of our frequencer
class from column with random oscillations.
We will pass the values for x and y and the interval between each point.
test3 = frequencer(freqs.index, freqs.iloc[:,2], 0.05)
Now we can plot our test fluctuation with plot
method.
test3.plot()
Let's measure frequency of oscillations with autocorr_freq
method. It prints frequency value, plots chosen section of oscillations and autocorrelation plot.
test3.autocorr_freq(section=(0,7))
Also we can find step with find_step
method, if any. It prints index of step value and plots graph with convolution function.
test3.find_step()
Some tests:
assert test3.find_step(plot=False) == 638