DSPRelated.com
Forums

SNR in Simulink

Started by Phil Newman August 11, 2005
 Phil Newman   Aug 10, 10:05 am     show options

I have a pure tone sine-wave signal of amplitude 1 and frequency 1. I
have additional white noise signal added to this pure tone signal.


The white noise is specified as Noise Power, and simulink defines this
as the height of the Power Spectral Density of the white noise. (in
this case it is set to 0.02)


Can anyone help me with calculating the SNR of the resulting signal?


I currently have


SNR =3D 10*log10(sum(abs(Signal).^2)/s=ADum(abs(Noise).^2))


but the units for PSD are watts per hertz - can this calculate?


Phil

Phil Newman wrote:
> Phil Newman Aug 10, 10:05 am show options > > I have a pure tone sine-wave signal of amplitude 1 and frequency 1. I > have additional white noise signal added to this pure tone signal. > > > The white noise is specified as Noise Power, and simulink defines this > as the height of the Power Spectral Density of the white noise. (in > this case it is set to 0.02) > > > Can anyone help me with calculating the SNR of the resulting signal? > > > I currently have > > > SNR = 10*log10(sum(abs(Signal).^2)/s�um(abs(Noise).^2)) > > > but the units for PSD are watts per hertz - can this calculate? > > > Phil
You also need to know the noise bandwidth then (watts/Hz)*(BW)= watts. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
well, the only other information I have is that the sampling time is 1.
Which infers that the bandwidth is 1Hz?

Phil Newman wrote:
> well, the only other information I have is that the sampling time is 1. > Which infers that the bandwidth is 1Hz?
No. At most 1/2 (units unspecified), but cutting it that close will put you in trouble for many things. For a noise calculation it will only make the result a little pessimistic. If you don't know that the sample rate must exceed twice the bandwidth, some catch-up reading is indicated. There's a tutorial and a bibliography at http://dspguru.com/. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Ah well, I know I appear to be lacking in knowledge, but not that much!

thanks for the help

Phil
"Jerry Avins" <jya@ieee.org> wrote in message 
news:jYidnWu06bi9JGHfRVn-jQ@rcn.net...
> Phil Newman wrote: >> well, the only other information I have is that the sampling time is 1. >> Which infers that the bandwidth is 1Hz? > > No. At most 1/2 (units unspecified), but cutting it that close will put > you in trouble for many things. For a noise calculation it will only make > the result a little pessimistic. > > If you don't know that the sample rate must exceed twice the bandwidth, > some catch-up reading is indicated. There's a tutorial and a bibliography > at http://dspguru.com/. > > Jerry > -- > Engineering is the art of making what you want from things you can get. > &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Philip Newman wrote:
> Ah well, I know I appear to be lacking in knowledge, but not that much! > > thanks for the help
You're welcome. I believe you, but you had me wondering. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins  <jya@ieee.org> wrote:

>Phil Newman wrote:
>> well, the only other information I have is that the sampling >> time is 1. Which infers that the bandwidth is 1Hz?
> No. At most 1/2 (units unspecified), but cutting it that > close will put you in trouble for many things. For a noise > calculation it will only make the result a little pessimistic.
> If you don't know that the sample rate must exceed twice > the bandwidth, some catch-up reading is indicated. There's a > tutorial and a bibliography at http://dspguru.com/.
Essential knowledge, but not needed to calculate the SNR of this signal. It's simulink, so you can easily measure the RMS value of the sine wave (which should be 1), and the RMS value of the noise signal (which may be 0.02). Do this by running a comfortably large number N of samples and calculating RMS = sqrt((sum over t) s(t)^2 / N). Divide these two to get your SNR. To express it in dB take 20log10() of the result. Steve
Thanks Steve,

the way you've done it comes out with the same answer as what I had to
start with, but it confirms it for me.

Cheers,

Phil