Demodulate a parameter x and subtract the background values
0001 function z = demodBG( ichoice, x ) 0002 % Demodulate a parameter x and subtract the background values 0003 i = ichoice; 0004 imax = 10; 0005 k = 1; 0006 while i<( length(x) - imax ) 0007 z(k) = mean( [x(i) x(i+1) x(i+2) x(i+3)] ) - mean( [x(i+5) x(i+6) x(i+7) x(i+8)] ); 0008 i = i + 10; 0009 k = k + 1; 0010 end 0011 end