How can I calculate the SNR of a signal from its frequency spectrum?
16 views (last 30 days)
Show older comments
I am pulling data from a spectrum analyzer and am trying to use the snr function from the signal processing toolbox to calculate the signal-to-noise ratio of the signal. The problem is that the value I am getting for the SNR makes no sense. I am calling the function like this:
snr(power, freqValues, rwb, 'power')
And the value of the snr I get is -28.0343 +13.6438i with rwb = 1.8e4;
The graph created by snr looks like this:

And for reference this is what the frequency spectrum I am capturing looks like:'
(This is created from plot(freqValues, power))

The frequency ranges from 0-2MHz and the major peak is at 902kHz @10.4dBm.
Any help is appreciated thanks.
2 Comments
Mathieu NOE
on 12 Feb 2021
hello
you have to come back to power first , compute the "good signal" power from your fft amplitude between 0.8 and 1 Mhz
and do the same on the remaining portion of the spectrum => you get the power of the background noise (+ other peaks)
SNR = power signal / power background noise
SNR in dB = 10*log10(SNR)
Mathieu NOE
on 12 Feb 2021
Question
in your code :
snr(power, freqValues, rwb, 'power')
is power expressed in dB as in your graph ? it should be in linear (units²) not in dB
Answers (0)
See Also
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!