Correcting effects of Humidity on sensors
44 views (last 30 days)
Show older comments
Hi All
I have gas sensor, that gets effected by hummdity that needs to be corrected. So was hoping to see if we can correct this ?
How can i run my code on the this support forum with my data file, so it can be run?
0 Comments
Answers (1)
Star Strider
on 23 Oct 2025 at 14:11
What sort of correction do you want to do to your data?
Do you also have the humidity data?
Are there any published ways to correct the readings for humidity? If so, please share them.
To run your code with your data here, first upload the data file, using the 'paperclip' icon in the top toolbar (just to the right of the Σ). Click on the 'insert a line of doce' icon in the top toolbar (farthest left icon in the CODE section, or ALT+ENTER) to create a code line, then type or copy-paste your code in it. To run it, press the green arrrow in the top toolbar.
x = linspace(0, 2*pi);
y = sin(x) .* cos(x);
figure
plot(x, y)
grid
Your code should run here essentially the same way it runs on your computer, including reading the file.
,
10 Comments
Star Strider
about 2 hours ago
The 'lookup table' coould be implemented with one of the interpolation functions in core MATLAB. That part would not be difficult.
I have also been thinking about this with respect to the humidity transients, since that seems to be the most important problem.
Looking at the 'Humidity Transients' plot in 'App_note_v0', one option would be to re-create that experiment with numidity 'steps' and record the output. I am not certain what the sampling frequency would be, however considering that the note mentions that the numidity transients 'decay in about 10 minutes', sampling at 1 Hz might be enough, although more data is always better, so use a higher sampling frequency if system memory permits. Then use the System Identification Toolbox to derive the system structure (most likely a state space representation) choosing the appropriate order and using the compare function to determine the best system order. With that information, you can use the recorded humidity as an input, calculate the resulting output (simulate the state space representation with the recorded humidity signal), and then subtract that output signal from the observed result. That is the only way I can think of to correct for the transients. I doubt that any other approach would work.
The 'Humidity Transients' plot does not report either the input signal (probably some sort of step-wise humidity change) or the time, so using that plot as it exists would not be appropriate. (Without knowing the precise input signal and its shape, and the associated times, that plot is quantitatively useless.) It would be necessary to duplicate that experiment and mathematically identify the system in order to model the sensor response to humidity.
I can help with the system identification process once you have those data.
.
See Also
Categories
Find more on AI for Signals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







