[a, b] = uigetfile({'*.wav'}, 'Audio asli');
audioasli = strcat(b, a);  
audioasli = audioread(audioasli);

[c, d] = uigetfile({'*.wav'}, 'Audio watermark');
audiowatermark = strcat(d, c);  
audiowatermark = audioread(audiowatermark);

a = 0;
N = length(audiowatermark);
for n = 1 : N-1
    if audioasli(n) == audiowatermark(n)
        continue
    end
    a = a + (audioasli(n)^2)/(audioasli(n)-audiowatermark(n))^2;
end
SNR = 10*log10(a);

disp([' SNR= ',num2str(SNR),' dB']);