classdef AFilteredMSEAudioMetricItem < FFMPEGDecoderAudioMetricItem
    
    properties
    
    end
    
     methods 
         function obj=AFilteredMSEAudioMetricItem
             obj=obj@FFMPEGDecoderAudioMetricItem('A-Weighted-PSNR');
         end
         
         
         function m=calc_audio_metric(obj,y1,y2,fs)
              
              [b, a] = aweighting(fs);
              
              e=y1-y2;
              
              e=filter(b,a,e);
              
              m=sum(sum(abs(e.^2)))/size(e,1)/size(e,2);
              m=10*log10(1/m);
         end
    end
    
    
    
end