%BIG RED
%function to plot FILTERED data, with and without zeroing
%with respect to ambient signal
function []=plotFiltered(data)

tStep=data(2,1)-data(1,1);
n=size(data,2);
pPorts=n-1;
time=data(:,1);
pData=data(:,2:n);
probeNames={'probe1' 'probe2' 'probe3' 'probe4' 'probe5' 'probe6'...
    'probe7' 'probe8' 'probe9' 'probe10' 'probe11' 'probe12'};

%subtract offset from signal at each probe
tAmbient=2; %seconds from start with ambient conditions
pDataAmbient=pData(1:tAmbient/tStep,:);
pAmbient=mean(pDataAmbient);
pDataZeroed=bsxfun(@minus,pData,pAmbient);

%filter data with filter function
freq=15000;
pDataFiltered=filtered(pDataZeroed,freq,7);

figure()
plot(time,pDataFiltered)
title('Pressure Sensor Signals (zeroed)')
xlabel('time (s)')
ylabel('sensor signal (V)')
legend(probeNames)

end
