What is the best smoothing procedure to calculate differentials for a large number of data points (x,y)?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
There is a set of data (X,Y) independently obtained from an experiment. Plotting Y vs X looks like this. There are ~114000 data points.
Upon zooming in, you can see the scatter in the data. Because of this when the slope (instantaneous differential) is calcultaed using diff(Y)./diff(X), the scatter is magnified and the trend I'm looking for is completely lost.
For now, I used an arbitratry smoothing procedure using moving average to somewhat acquire the trend I'm looking for, which looks like this:
Could someone please suggest a more standard procedure that I could employ that would be statistically accurate? I have attached the dataset (X,Y).
0 commentaires
Réponses (1)
Bruno Luong
le 6 Août 2022
Modifié(e) : Bruno Luong
le 6 Août 2022
The Savitzky-Golay filter (moving polynomial fit) is a good filter that preserves decendly the slope.
There is a similar thread discussed not long ago, in short you fit data with appropriate model/tools 'depending on the characteristic of you data); then take the derivative of the model.
load('example.mat')
pp=BSFK(X,Y); %FEX file
pp1=ppder(pp);
xq=linspace(min(X),max(X),513);
ydq=ppval(pp1,x)
plot(xq,ydq)
Voir également
Catégories
En savoir plus sur Smoothing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!