Filtering Sensor Data to Remove Temperature Ramp Effects
51 次查看(过去 30 天)
显示 更早的评论
Hi,
I need to apply some filtering to my data in order to remove samples collected while the temperature is ramping up, and to use only the samples where the temperature is relatively stable.
There will still be some small fluctuations in temperature during these stable periods, but they should be minimal. As shown in the attached plots, the regions highlighted with red circles in the top plot correspond to the temperature ramp and settling areas that I would like to filter out. The bottom plot shows the sensor signal, where these temperature changes clearly introduce ripple and transient effects.
Is there a recommended function or method to reliably detect and filter out these ramping regions, leaving only the stable temperature data for further analysis?

4 个评论
dpb
2026-1-10,16:03
移动:dpb
2026-1-10,16:36
Have you tried findchangepts to see if it can detect the slope changes for you? It may not be sufficiently sensitive, but worth a shot.
The next obvious step is to look at first/second derivatives...
回答(1 个)
dpb
2026-1-10,16:34
编辑:dpb
2026-1-10,17:11
load SensorLog_ALLS2
%head(Tall)
Tall.Properties.VariableNames=strrep(Tall.Properties.VariableNames,' ',''); % remove blanks
Tall.Properties.VariableNames(2:3)={'T','RH'}; % more convenient
head(Tall)
findchangepts(Tall.T,'Statistic','linear') % look at overall
Pstart=500; Pend=2500; % pick start, end locations
findchangepts(Tall.T(Pstart:Pend),'Statistic','linear') % look at inner section only
N=18;
findchangepts(Tall.T(Pstart:Pend),'Statistic','linear', ...
'MaxNumChanges',N) % and make sensitive
That doesn't look too bad for starters. Will need to add some heuristics to guess where to start/stop and how many steps there are.
I wish there were some other way to influence its sensitivity besides just the number of points so could make it based on the actual change in computed values.
You might find fitting the linear expression to the total and looking at residuals a helpful approach-- that's basically what findchangepts is doing.
Note I cheated by counting the number of intervals and then set N to be 2X that number in order to delineate the start/stop sections. An earlier post with N=10 wasn't enough so several were midpoints and only one break between sections instead of two.
Using the two-output form and using the returned residual in a loop as N is increased in steps of 2 might work pretty well.
5 个评论
dpb
2026-1-11,13:01
which -all findchangepts
is in Sitnal Processing TB, yes....without, you would need to "roll your own" similar function; the starting point would be still picking the two ends of the transient you want to cover and fitting a straight line, then looking at the residuals to find where they have larger excursions to locate smaller subsections. "Wash, rinse, repeat..."
As above, if you do know the setpoint levels, then locating regions within an ever tightening tolerance of those and detrending those sections should also help or might be even more efficient.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multirate Signal Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


