1 %This file is part of TEAP.
3 %TEAP is free software: you can redistribute it and/or modify
4 %it under the terms of the GNU General Public License as published by
5 %the Free Software Foundation, either version 3 of the License, or
6 %(at your option) any later version.
8 %TEAP is distributed in the hope that it will be useful,
9 %but WITHOUT ANY WARRANTY; without even the implied warranty of
10 %MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 %GNU General Public License
for more details.
13 %You should have received a copy of the GNU General Public License
14 %along with TEAP. If not, see <http://www.gnu.org/licenses/>.
19 %> @param rawHST [1xN] the raw HST signal
20 %> @param sampRate [1x1] the sampling rate, in Hz
21 %> @retval Signal A HST TEAP signal
23 %> Copyright Frank Villaro-Dixon, 2014
28 error(
'Usage: HST_aqn_variable(rawHST, sampRate)');
34 if(median(rawHST) > 70)
35 warning([
'The signal given seems to be given in °F. I need °C ! ' ...
36 'Automatic conversion applied. ' ...
37 'And stop using Fahrenheit, nobody uses it anyway !']);
38 rawHST = (rawHST - 32) .* (5/9);
41 if(median(rawHST) < 4 && median(rawHST) > -4) %we may have a relative signal
43 elseif(median(rawHST) < 20 || median(rawHST) > 45)
44 error(['Something seems wrong with the HST signal: temperatures outside' ...
51 %And, we filter the signal, else it's useless