Smooth a curve or increasing the resolution?
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello !!
I read data from an instrument (ILX Lightwave TEC) that gives me current values and I plot against time, but my curve saturates at times. I think this might be a resolution problem.
I would like to smooth the curve.
I tried using the slidingavg function, but it doesn't seem right.
clear all
y = load('ILX_TEC_curr.txt');
x = load('ILX_TEC_time.txt');
N = 10;
ys = slidingavg(y, N);
hfig4=figure(4);
plot(x,y,x,ys,'-o');
xlabel('Time (s)','fontsize',18,'fontweight','bold');
ylabel('Sample TEC Current (A)','fontsize',18,'fontweight','bold');
Is there another form or function that can help me smooth the first result (first curve - blue line)?
Attached here are the data if that helps.
Thank you.
Tay
Réponses (1)
Sulaymon Eshkabilov
le 4 Août 2021
You may consider using a moving average filter smoothdata() with sgolay, for instance.
3 commentaires
Sulaymon Eshkabilov
le 4 Août 2021
Before making a final decision, play with the settings of these filters and also test movmean(). And compare them. The problem here is the quality of your acquired data. It looks like your data was not collected on a fixed smapling time.
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!