set fundamental to 0dB using snr

1 vue (au cours des 30 derniers jours)
Joe Miller
Joe Miller le 2 Sep 2017
Commenté : Star Strider le 3 Sep 2017
Dear Sir/Madam,
How do you adjust the snr plot so that the fundamental is at 0dB?
Fs = 10000;
f = 2100;
t = 0:1/Fs:1;
x = 5*sin(2*pi*f*t) + 0.001*randn(1,length(t));
snr(x, Fs, 5);
Regards Joe

Réponse acceptée

Star Strider
Star Strider le 2 Sep 2017
Dividing ‘x’ by ‘max(x)’ is probably as close as you can get:
xs = x/max(x);
figure(1)
snr(xs, Fs, 5)
  2 commentaires
Joe Miller
Joe Miller le 3 Sep 2017
Thank you
Star Strider
Star Strider le 3 Sep 2017
My pleasure.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by