<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ccn-wiki.caset.buffalo.edu/index.php?action=history&amp;feed=atom&amp;title=NLDetrendFSTS</id>
	<title>NLDetrendFSTS - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://ccn-wiki.caset.buffalo.edu/index.php?action=history&amp;feed=atom&amp;title=NLDetrendFSTS"/>
	<link rel="alternate" type="text/html" href="https://ccn-wiki.caset.buffalo.edu/index.php?title=NLDetrendFSTS&amp;action=history"/>
	<updated>2026-05-24T18:02:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://ccn-wiki.caset.buffalo.edu/index.php?title=NLDetrendFSTS&amp;diff=787&amp;oldid=prev</id>
		<title>192.168.1.1 at 19:42, 4 October 2016</title>
		<link rel="alternate" type="text/html" href="https://ccn-wiki.caset.buffalo.edu/index.php?title=NLDetrendFSTS&amp;diff=787&amp;oldid=prev"/>
		<updated>2016-10-04T19:42:19Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:42, 4 October 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l61&quot;&gt;Line 61:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 61:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Matlab &lt;/del&gt;functions]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;MATLAB &lt;/ins&gt;functions]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>192.168.1.1</name></author>
	</entry>
	<entry>
		<id>https://ccn-wiki.caset.buffalo.edu/index.php?title=NLDetrendFSTS&amp;diff=786&amp;oldid=prev</id>
		<title>192.168.1.1 at 19:41, 4 October 2016</title>
		<link rel="alternate" type="text/html" href="https://ccn-wiki.caset.buffalo.edu/index.php?title=NLDetrendFSTS&amp;diff=786&amp;oldid=prev"/>
		<updated>2016-10-04T19:41:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:41, 4 October 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l61&quot;&gt;Line 61:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 61:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: Matlab &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Functions&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: Matlab &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;functions&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>192.168.1.1</name></author>
	</entry>
	<entry>
		<id>https://ccn-wiki.caset.buffalo.edu/index.php?title=NLDetrendFSTS&amp;diff=785&amp;oldid=prev</id>
		<title>192.168.1.1 at 19:41, 4 October 2016</title>
		<link rel="alternate" type="text/html" href="https://ccn-wiki.caset.buffalo.edu/index.php?title=NLDetrendFSTS&amp;diff=785&amp;oldid=prev"/>
		<updated>2016-10-04T19:41:31Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:41, 4 October 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l60&quot;&gt;Line 60:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 60:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: Matlab Functions]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>192.168.1.1</name></author>
	</entry>
	<entry>
		<id>https://ccn-wiki.caset.buffalo.edu/index.php?title=NLDetrendFSTS&amp;diff=783&amp;oldid=prev</id>
		<title>192.168.1.1: Created page with &quot;A MATLAB function was created that subtracts the nonlinear trend, obtained from the global mean, from each of the time series vectors. In the course of doing so, the function...&quot;</title>
		<link rel="alternate" type="text/html" href="https://ccn-wiki.caset.buffalo.edu/index.php?title=NLDetrendFSTS&amp;diff=783&amp;oldid=prev"/>
		<updated>2016-10-04T19:40:15Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;A MATLAB function was created that subtracts the nonlinear trend, obtained from the global mean, from each of the time series vectors. In the course of doing so, the function...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A MATLAB function was created that subtracts the nonlinear trend, obtained from the global mean, from each of the time series vectors. In the course of doing so, the function plots the original data, the global mean, and the transformed data (with the trend removed).&lt;br /&gt;
&lt;br /&gt;
== NLDetrendFSTS.m ==&lt;br /&gt;
 function dtM = NLDetrendFSTS(M, droprows)&lt;br /&gt;
 %Removes non-linear trends from a cell array of matrices, M.&lt;br /&gt;
 %Parameters:&lt;br /&gt;
 %   M: a cell array of matrices.&lt;br /&gt;
 %   drop: a vector of indices indicating the rows to be dropped before&lt;br /&gt;
 %       detrending (default: empty; all rows are kept). Positive values are&lt;br /&gt;
 %       relative to the start of each matrix and values less than 1 are&lt;br /&gt;
 %       relative to the end of each matrix (e.g., [-1 0 1 2 3 4] drops the&lt;br /&gt;
 %       first four rows, 1:4, and the last two rows, -1:0)&lt;br /&gt;
 if isempty(droprows) || ~exist(&amp;#039;droprows&amp;#039;, &amp;#039;var&amp;#039;)&lt;br /&gt;
    droprows=[];&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 nmatrices=length(M);&lt;br /&gt;
 dtM=cell(nmatrices,1);&lt;br /&gt;
  &lt;br /&gt;
 &lt;br /&gt;
 figure(1);&lt;br /&gt;
 &lt;br /&gt;
 for i=1:nmatrices&lt;br /&gt;
    A=M{i};&lt;br /&gt;
    %drop rows as requred&lt;br /&gt;
    A=dropRows(A,droprows);&lt;br /&gt;
    %get global mean waveform&lt;br /&gt;
    gmean=mean(A&amp;#039;)&amp;#039;;&lt;br /&gt;
    %find polynomial line of best fit to mean waveform&lt;br /&gt;
    polyord=6;&lt;br /&gt;
    t=(1:length(gmean))&amp;#039;;&lt;br /&gt;
    [p,s,mu]=polyfit(t,gmean,polyord);&lt;br /&gt;
    f_y=polyval(p,t,[],mu);&lt;br /&gt;
    %subtract the line of best fit from the time series&lt;br /&gt;
    f_y_mat=repmat(f_y,1,size(A,2));&lt;br /&gt;
    dtA=A-f_y_mat;&lt;br /&gt;
    subplot(nmatrices,3, ((i-1)*3)+1);&lt;br /&gt;
    plot(A);&lt;br /&gt;
    subplot(nmatrices,3, ((i-1)*3)+2);&lt;br /&gt;
    plot(gmean);&lt;br /&gt;
    subplot(nmatrices,3, ((i-1)*3)+3);&lt;br /&gt;
    plot(dtA);&lt;br /&gt;
    dtM{i}=dtA;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 %% Nested utility function dropRows(M,droprows)&lt;br /&gt;
    function M=dropRows(M,droprows)&lt;br /&gt;
        %receives matrix M and drops rows indexed by positive values in&lt;br /&gt;
        %droprows, and indexed from the end (e.g., M(end-1,:) for values&lt;br /&gt;
        %less than 1&lt;br /&gt;
        sz=size(M);&lt;br /&gt;
        keeprows=1:size(M,1); %rows to keep&lt;br /&gt;
        %convert negative droprows indices into end-relative values&lt;br /&gt;
        droprows=[droprows(droprows&amp;gt;0) droprows(droprows&amp;lt;1)+size(M,1)];&lt;br /&gt;
        keeprows(droprows)=[];%removes from rows to keep the set of rows to drop&lt;br /&gt;
        M=M(keeprows, :); %keep only the rows not flagged to be dropped&lt;br /&gt;
        %if M was 3D+, it will need to be reshaped&lt;br /&gt;
        sz(1)=size(M,1); %new number of rows in sz matrix, all other dimensions maintained as they were&lt;br /&gt;
        M=reshape(M, sz);&lt;br /&gt;
    end&lt;br /&gt;
 end&lt;/div&gt;</summary>
		<author><name>192.168.1.1</name></author>
	</entry>
</feed>