function y = matlabFilter(x)
%MATLABFILTER Filters input x and returns output y.

%
% MATLAB Code
% Generated by MATLAB(R) 8.0 and the DSP System Toolbox 8.3.
%
% Generated on: 28-May-2013 09:30:14
%

%#codegen

% To generate C/C++ code from this function use the codegen command. Type
% 'help codegen' for more information.

persistent Hd;

if isempty(Hd)
    
    % The following code was used to design the filter coefficients:
    % % Butterworth Lowpass filter designed using FDESIGN.LOWPASS.
    %
    % % All frequency values are in Hz.
    % Fs = 10;  % Sampling Frequency
    %
    % N  = 4;  % Order
    % Fc = 2;  % Cutoff Frequency
    %
    % % Construct an FDESIGN object and call its BUTTER method.
    % h  = fdesign.lowpass('N,F3dB', N, Fc, Fs);
    % Hd = design(h, 'butter', 'SystemObject', true);
    
    Hd = dsp.BiquadFilter( ...
        'Structure', 'Direct form II', ...
        'SOSMatrix', [1 2 1 1 -0.453119520652385 0.466325570763237; 1 2 1 1 ...
        -0.328975677370953 0.064587654916443], ...
        'ScaleValues', [0.253301512527713; 0.183902994386373; 1]);
end

y = step(Hd,x);


% [EOF]
