curvesmoothing

calculate x-value of curve maximum of a smooth line in R and ggplot2

女生的网名这么多〃 提交于 2019-12-13 08:28:52
问题 data <- dput(data): structure(list(x = 1:16, y = c(-79.62962963, -84.72222222, -88.42592593, -74.07407407, -29.62962963, 51.38888889, 79.62962963, 96.2962963, 87.96296296, 88.42592593, 73.14814815, 12.96296296, -63.42592593, -87.03703704, -87.5, -87.96296296)), .Names = c("x", "y"), row.names = c(NA, 16L), class = "data.frame") I calculated in R with ggplot2 a smooth line for my dataset: p1 <- ggplot(data, aes(x=x(°), y=(%))) library(splines) library(MASS) (p2 <- p1 + stat_smooth(method = "lm

How to smoothen a plot in MATLAB?

依然范特西╮ 提交于 2019-12-03 03:49:05
问题 I have some 9000 points that are plotted on a graph: [Full resolution] Actually, the plot is not as smooth as I wanted it to be. Is there some way I can smoothen the graph to a required degree? Or some form of thresholding so that I can selectively smoothen out the parts that is too bumpy? I am not sure but can fast-fourier-transform help? 回答1: A simple (ad hoc) way is to just take a weighted average (tunable by alpha ) at each point with its neighbors: data(2:n-1) = alpha*data(2:n-1) + (1

How to smoothen a plot in MATLAB?

烂漫一生 提交于 2019-12-02 17:13:28
I have some 9000 points that are plotted on a graph: [ Full resolution ] Actually, the plot is not as smooth as I wanted it to be. Is there some way I can smoothen the graph to a required degree? Or some form of thresholding so that I can selectively smoothen out the parts that is too bumpy? I am not sure but can fast-fourier-transform help? A simple (ad hoc) way is to just take a weighted average (tunable by alpha ) at each point with its neighbors: data(2:n-1) = alpha*data(2:n-1) + (1-alpha)*0.5*(data(1:n-2)+data(3:n)) or some variation thereof. Yes, to be more sophisticated you can Fourier

How to 'smooth' data and calculate line gradient?

放肆的年华 提交于 2019-11-29 22:41:04
I'm reading data from a device which measures distance. My sample rate is high so that I can measure large changes in distance (i.e. velocity) but this means that, when the velocity is low, the device delivers a number of measurements which are identical (due to the granularity of the device). This results in a 'stepped' curve. What I need to do is to smooth the curve in order to calculate the velocity. Following that I then need to calculate the acceleration. How to best go about this? (Sample rate up to 1000Hz, calculation rate of 10Hz would be ok. Using C# in VS2005) The wikipedia entry

How to 'smooth' data and calculate line gradient?

孤街醉人 提交于 2019-11-28 19:23:24
问题 I'm reading data from a device which measures distance. My sample rate is high so that I can measure large changes in distance (i.e. velocity) but this means that, when the velocity is low, the device delivers a number of measurements which are identical (due to the granularity of the device). This results in a 'stepped' curve. What I need to do is to smooth the curve in order to calculate the velocity. Following that I then need to calculate the acceleration. How to best go about this?

Plot smooth line with PyPlot

三世轮回 提交于 2019-11-26 01:39:45
问题 I\'ve got the following simple script that plots a graph: import matplotlib.pyplot as plt import numpy as np T = np.array([6, 7, 8, 9, 10, 11, 12]) power = np.array([1.53E+03, 5.92E+02, 2.04E+02, 7.24E+01, 2.72E+01, 1.10E+01, 4.70E+00]) plt.plot(T,power) plt.show() As it is now, the line goes straight from point to point which looks ok, but could be better in my opinion. What I want is to smooth the line between the points. In Gnuplot I would have plotted with smooth cplines . Is there an