Skip to content

Instantly share code, notes, and snippets.

@tobin
Created February 7, 2012 15:02
Show Gist options
  • Select an option

  • Save tobin/1760109 to your computer and use it in GitHub Desktop.

Select an option

Save tobin/1760109 to your computer and use it in GitHub Desktop.
Apply a matrix of second order section digital filters to a timeseries.
function y = applysos(soscoef, x)
% Apply a matrix of SOS cofficients to some time series.
%
% Tobin Fricke
% 2012-02-07
if size(soscoef,2) ~= 6
error('soscoef is not the right size');
end
y = x;
for ii=1:size(soscoef,1)
y = filter(soscoef(ii,1:3), soscoef(ii,4:6), y);
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment