set fundamental to 0dB using snr

1 Ansicht (letzte 30 Tage)
Joe Miller
Joe Miller am 2 Sep. 2017
Kommentiert: Star Strider am 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

Akzeptierte Antwort

Star Strider
Star Strider am 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 Kommentare
Joe Miller
Joe Miller am 3 Sep. 2017
Thank you
Star Strider
Star Strider am 3 Sep. 2017
My pleasure.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by