function r = lowpassFIR(q,order,cutoff)

DT = diff(q.data(:,1));
rate = 1/mean(DT);
%if find(DT ~= DT(1))
%    error('Must be uniform time spacing');
%end
disp(sprintf('rate = %f', rate));
F = fir1(order, cutoff/(0.5*rate));
r = q;
for i=2:size(q.data,2)
%    r.data(:,i) = filtfilt(F, 1, q.data(:,i));
    r.data(:,i) = filter(F, 1, q.data(:,i));
end

% crop sides
r.data = [r.data(1:end-order,1) r.data((order/2+1):(end-order/2),2:end)];
r.nr = size(r.data,1);
