function y = afilter(x,fs)
%AFILTER Filters input x and returns output y.

% MATLAB Code
% Generated by MATLAB(R) 8.4 and the DSP System Toolbox 8.7.
% Generated on: 20-Jan-2016 12:24:49

persistent Hd;

if isempty(Hd)
    
    WT    = 'A';    % Weighting type
    Class = 1;      % Class
    
    h = fdesign.audioweighting('WT,Class', WT, Class, fs);
    
    Hd = design(h, 'ansis142', ...
        'SOSScaleNorm', 'Linf');
    
    
    
    set(Hd,'PersistentMemory',true);
    
end

y = filter(Hd,x);


