Implement an alternative to SNR function

1 view (last 30 days)
Hasan Ghorbani
Hasan Ghorbani on 21 Sep 2015
Commented: Walter Roberson on 24 Sep 2015
Folks,
I have x as following:
[x,Fs] = audioread(strcat(PathName,FileName));
And some noise in the form of alpha*v as below:
rng('default');
alpha=0.2;
v = randn(size(x));
I don't have Signal Processing toolbox to use snr() function. How can I find SNR as given in this equation?

Answers (1)

Walter Roberson
Walter Roberson on 22 Sep 2015
hint:
sum(x.^2)
  2 Comments
Hasan Ghorbani
Hasan Ghorbani on 24 Sep 2015
Edited: Hasan Ghorbani on 24 Sep 2015
Thansk. Am I right by using following code:
x_snr_db = 20 * log10( sum(x.^2) / sum((alpha * v).^2) );

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!