Title: | Convolution of Data |
---|---|
Description: | General functions for convolutions of data. Moving average, running median, and other filters are available. Bibliography regarding the functions can be found in the following text. Richard G. Brereton (2003) <ISBN:9780471489771>. |
Authors: | Federico Maria Vivaldi [aut, cre] |
Maintainer: | Federico Maria Vivaldi <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2025-03-08 03:44:49 UTC |
Source: | https://github.com/cran/Convolutioner |
This function return the data smoothed using the an Hamming window filter. Data are smoothed using a cosine window with particular coefficients.
Hamming(raw_data, buffer_size = 5)
Hamming(raw_data, buffer_size = 5)
raw_data |
Data upon which the algorithm is applied |
buffer_size |
number of points the algorithm use to compute the coefficients of the Hann window |
Smoothed data using Hann Window filter
raw_data = c(1:100) smoothed_data = Hamming(raw_data)
raw_data = c(1:100) smoothed_data = Hamming(raw_data)
This function return the data smoothed using the an Hann window filter. Data are smoothed using a cosine window.
Hann(raw_data, buffer_size = 5)
Hann(raw_data, buffer_size = 5)
raw_data |
Data upon which the algorithm is applied |
buffer_size |
number of points the algorithm use to compute the coefficients of the Hann window |
Smoothed data using Hann Window filter
raw_data = c(1:100) smoothed_data = Hann(raw_data)
raw_data = c(1:100) smoothed_data = Hann(raw_data)
This function return the data smoothed using the basic moving average algorithm. For each chunk of data of size equal to the buffer_size parameter is calculated the average and this value is used as the i term of the newly smoothed data. zero padding is applied for initial and final values
MA(raw_data, buffer_size = 5)
MA(raw_data, buffer_size = 5)
raw_data |
Data upon which the algorithm is applied |
buffer_size |
number of points the algorithm use to compute the average |
Smoothed data using moving average algorithm
raw_data = c(1:100) smoothed_data = MA(raw_data)
raw_data = c(1:100) smoothed_data = MA(raw_data)
This function return the data smoothed using the running median algorithm. For each chunk of data of size equal to the buffer_size parameter is calculated the median and this value is used as the i term of the newly smoothed data. For initial and final values zero padding is applied.
RMS(raw_data, buffer_size = 5)
RMS(raw_data, buffer_size = 5)
raw_data |
Data upon which the algorithm is applied |
buffer_size |
number of points the algorithm use to compute the median |
Smoothed data using running median algorithm
raw_data = c(1:100) smoothed_data = RMS(raw_data)
raw_data = c(1:100) smoothed_data = RMS(raw_data)
This function return the data smoothed using the a sine window filter.
sine(raw_data, buffer_size = 5)
sine(raw_data, buffer_size = 5)
raw_data |
Data upon which the algorithm is applied |
buffer_size |
number of points the algorithm use to compute the coefficients of the Hann window |
Smoothed data using Hann Window filter
raw_data = c(1:100) smoothed_data = sine(raw_data)
raw_data = c(1:100) smoothed_data = sine(raw_data)
Generate test data in order to test the filtering functions. To a signal function is added random noise contribution. V0.1 = noise is assumed gaussian
test_data( amplitude = 1, f = 100, npoints = 1000, type = "sinusoidal", x0 = 0, noise_contribution = 100 )
test_data( amplitude = 1, f = 100, npoints = 1000, type = "sinusoidal", x0 = 0, noise_contribution = 100 )
amplitude |
amplitude of the signal, default = 1 |
f |
frequency of the sinusoidal signal, default = 100 |
npoints |
number of points of the time serie |
type |
type of signal, default = sinusoidal. Available types: sinusoidal, gaussian |
x0 |
signal position for gaussian type. Default = 0 |
noise_contribution |
percentage pointing the maximum wanted signal/noise ratio. Default = 10 |
A time serie with added random noise.
test_data()
test_data()