How to calculate SNR of signals in MATLAB? -
i've encountered simple, yet fundamental problem on calculating snr:
there several signals :
s1 = original , pure clean signal without noise.
n1 = white gaussian noise going added s1.
s2 = s1 + n1 (the noisy signal before performing noise-reduction algorithm)
s3 = noise-reduced signal (after performing noise reduction algorithm)
n2 = s3 - s1 (the amount of noise after performing noise-reduction algorithm)
now want compare snr before , after performing noise-reduction algorithm.
which signals should consider snr_before!? s1/n1 or s2/n1 ?
which signals should consider snr_after!? s3/n1 or s3/n2 ?
which commands or functions should use in matlab in order compute snr_before , snr_after?
thanks billion putting time on helping me.
what know calculating snr before :
snrbeforenoise = mean( signal .^ 2 ) / mean( noise .^ 2 );
and snr after :
residual_noise = signal - noise_reduced_signal; snr_after = mean( signal .^ 2 ) / mean( residual_noise .^ 2 );