# Calculation of snr

Discussion in 'Digital Photography' started by Marc Wossner, May 22, 2008.

1. ### Marc WossnerGuest

Hi ng,

I´d like to know about the signal to noise ratio of my digital camera.
According to a website I found this value is the ratio of total signal
to total noise expressed in decibels (dB) and can be calculated with
the following formula:

SNR = 20 log (Signal RMS / Noise RMS)

As math was always a horror for me, I have only a slight idea of "root
mean square" but don´t know how to deduce those values from simple

Best Regards!
Marc Wossner

Marc Wossner, May 22, 2008

2. ### ransleyGuest

On May 22, 5:28 am, Marc Wossner <> wrote:
> Hi ng,
>
> I´d like to know about the signal to noise ratio of my digital camera.
> According to a website I found this value is the ratio of total signal
> to total noise expressed in decibels (dB) and can be calculated with
> the following formula:
>
> SNR = 20 log (Signal RMS / Noise RMS)
>
> As math was always a horror for me, I have only a slight idea of "root
> mean square" but don´t know how to deduce those values from simple
>
> Best Regards!
> Marc Wossner

db is sound not what your eve sees, what is "this wedsite" for you id
say tb, trollbell

ransley, May 22, 2008

3. ### Marc WossnerGuest

On 22 Mai, 12:36, ransley <> wrote:
> On May 22, 5:28 am, Marc Wossner <> wrote:
>
> > Hi ng,

>
> > I´d like to know about the signal to noise ratio of my digital camera.
> > According to a website I found this value is the ratio of total signal
> > to total noise expressed in decibels (dB) and can be calculated with
> > the following formula:

>
> > SNR = 20 log (Signal RMS / Noise RMS)

>
> > As math was always a horror for me, I have only a slight idea of "root
> > mean square" but don´t know how to deduce those values from simple

>
> > Best Regards!
> > Marc Wossner

>
> db is sound not what your eve sees, what is "this wedsite" for you id
> say tb, trollbell

Yes, but "db" is also quite often used in electronic context as well
so I thought id would be correct.
If it isn`t, can you tell me the right way?

Best regards!
Marc Wossner

Marc Wossner, May 22, 2008
4. ### ransleyGuest

On May 22, 6:10 am, Marc Wossner <> wrote:
> On 22 Mai, 12:36, ransley <> wrote:
>
>
>
>
>
> > On May 22, 5:28 am, Marc Wossner <> wrote:

>
> > > Hi ng,

>
> > > I´d like to know about the signal to noise ratio of my digital camera.
> > > According to a website I found this value is the ratio of total signal
> > > to total noise expressed in decibels (dB) and can be calculated with
> > > the following formula:

>
> > > SNR = 20 log (Signal RMS / Noise RMS)

>
> > > As math was always a horror for me, I have only a slight idea of "root
> > > mean square" but don´t know how to deduce those values from simple

>
> > > Best Regards!
> > > Marc Wossner

>
> > db is sound not what your eve sees, what is "this wedsite" for you id
> > say tb, trollbell

>
> Yes, but "db" is also quite often used in electronic context as well
> so I thought id would be correct.
> If it isn`t, can you tell me the right way?
>
> Best regards!
> Marc Wossner- Hide quoted text -
>
> - Show quoted text -

I went to www.dpreview.com and typed in a search of Decibel, and it is
one measure used. But db was developed as a rating of sound. I have
no idea how its transfered to a visual rating, or number, if it even
is as sound can be easily rated in S/N and db numbers, which are easy
to understand and industry accepted. I dont see any db ratings at
dpreview, just visual detail charts and descriptions. It would make
buying equipment easy if numbered ratings on a large known scale were
assigned to cameras and lenses as is done in audio equipment. Is it
done with dvds on the video portion? It is done with sound ratings. To
compare your camera find sites that reviewed it, what camera is it.

ransley, May 22, 2008
5. ### Don Stauffer in MinnesotaGuest

On May 22, 5:28 am, Marc Wossner <> wrote:
> Hi ng,
>
> I´d like to know about the signal to noise ratio of my digital camera.
> According to a website I found this value is the ratio of total signal
> to total noise expressed in decibels (dB) and can be calculated with
> the following formula:
>
> SNR = 20 log (Signal RMS / Noise RMS)
>
> As math was always a horror for me, I have only a slight idea of "root
> mean square" but don´t know how to deduce those values from simple
>
> Best Regards!
> Marc Wossner

Unfortunately, the handling of logrithmic values is not the hardest
part of the job. In order to really look at signal to noise, you need
to make a very carefully controlled exposure, and look at lots of
pixels in order to get a statistical value of each part (signal and
noise). Also, there are a couple of types of snr definitions (large
signal vs small signal snr).

You should also be looking at a RAW file, since the jpeg compression
affects snr of an image.

the root mean square part is easy.

Look at a large range of noise pixels, say at least 10. Compute the
average. Then go back to the individual readings, and subtract the
average from each. Then square the differences. Add together all
these "squares". Now take the square root of the sum of the squares.
Many calculators can do this part. In fact, some scientific and most
statistical calculators can compute the RMS by entering a series of

Now you can convert your ratio into dbs.

Don Stauffer in Minnesota, May 22, 2008
6. ### David J TaylorGuest

John O'Flaherty wrote:
[]
>> - 4096 for 12-bit or 16384 for 14-bit. This program will take the
>> drudgery out of the calculations, if not out of getting the careful
>> exposures.

However, do be aware that a simple SNR calculation will tell you very
little about the performance of the camera, unless you take the MTF into
account. You could make a camera with a low high-frequency MTF which you
have a very high SNR, but produce very blurry images. You really need to
measure the SNR for a known input at a known spatial frequency, and then
weight that measurement according to the perception characteristics of the
viewer.....

Cheers,
David

David J Taylor, May 22, 2008
7. ### Marc WossnerGuest

Thanks a lot to all of you for your valuable input!
But I guess the calculation of the snr for a given camera would only
be the first step.
At least for high signal levels there should also be a scale of a
theoretical minimum noise to judge it against.
Could that be photon noise, because it´s unavoidable? And if so, what
values would be necessary to construct such a model?

Best regards!
Marc Wossner

Marc Wossner, May 23, 2008
8. ### Marc WossnerGuest

On 22 Mai, 16:21, Don Stauffer in Minnesota <>
wrote:
> On May 22, 5:28 am, Marc Wossner <> wrote:
>
> > Hi ng,

>
> > I´d like to know about the signal to noise ratio of my digital camera.
> > According to a website I found this value is the ratio of total signal
> > to total noise expressed in decibels (dB) and can be calculated with
> > the following formula:

>
> > SNR = 20 log (Signal RMS / Noise RMS)

>
> > As math was always a horror for me, I have only a slight idea of "root
> > mean square" but don´t know how to deduce those values from simple

>
> > Best Regards!
> > Marc Wossner

>
> Unfortunately, the handling of logrithmic values is not the hardest
> part of the job. In order to really look at signal to noise, you need
> to make a very carefully controlled exposure, and look at lots of
> pixels in order to get a statistical value of each part (signal and
> noise).  Also, there are a couple of types of snr definitions (large
> signal vs small signal snr).
>
> You should also be looking at a RAW file, since the jpeg compression
> affects snr of an image.

Can this effect be roughly quantified? This would be very helpful in
the comparison of .raw files and scanned silver film. Or could it be
overcome by using .tif for the scanned silver image?

Best regards!
Marc Wossner

Marc Wossner, May 23, 2008
9. ### Marc WossnerGuest

On 22 Mai, 19:01, "David J Taylor" <-
this-bit.nor-this-bit.co.uk> wrote:
> John O'Flaherty wrote:
>
> []
>
> >> - 4096 for 12-bit or 16384 for 14-bit. This program will take the
> >> drudgery out of the calculations, if not out of getting the careful
> >> exposures.

>
> However, do be aware that a simple SNR calculation will tell you very
> little about the performance of the camera, unless you take the MTF into
> account.  You could make a camera with a low high-frequency MTF which you
> have a very high SNR, but produce very blurry images.  You really need to
> measure the SNR for a known input at a known spatial frequency, and then
> weight that measurement according to the perception characteristics of the
> viewer.....

This is what Norman Korens hypothesis about Shannons information
theory does. He uses the equation C=W log2(SNR+1), that defines the
capacity of a data channel, to define image quality (IQ) as IQ=W
log2(SNR+1), where W is the image visual capacity in one dimension. He
choose to use the product of MTF 50 and image sensor size for this
value. Look at http://www.imatest.com/docs/shannon.html.

Best regards!
Marc Wossner

Marc Wossner, May 23, 2008
10. ### Chris MalcolmGuest

Marc Wossner <> wrote:
> On 22 Mai, 16:21, Don Stauffer in Minnesota <>
> wrote:
>> On May 22, 5:28 am, Marc Wossner <> wrote:
>>
>> > Hi ng,

>>
>> > I?d like to know about the signal to noise ratio of my digital camera.
>> > According to a website I found this value is the ratio of total signal
>> > to total noise expressed in decibels (dB) and can be calculated with
>> > the following formula:

>>
>> > SNR = 20 log (Signal RMS / Noise RMS)

>>
>> > As math was always a horror for me, I have only a slight idea of "root
>> > mean square" but don?t know how to deduce those values from simple

>>
>> > Best Regards!
>> > Marc Wossner

>>
>> Unfortunately, the handling of logrithmic values is not the hardest
>> part of the job. In order to really look at signal to noise, you need
>> to make a very carefully controlled exposure, and look at lots of
>> pixels in order to get a statistical value of each part (signal and
>> noise). ?Also, there are a couple of types of snr definitions (large
>> signal vs small signal snr).
>>
>> You should also be looking at a RAW file, since the jpeg compression
>> affects snr of an image.

> Can this effect be roughly quantified? This would be very helpful in
> the comparison of .raw files and scanned silver film. Or could it be
> overcome by using .tif for the scanned silver image?

In the case of audio we're talking about a signal which can be sampled
from a single signal measuring device, i.e. a microphone. In that case
signal to noise ratio has a simple and useful definition.

An image is sampled by millions of sensors fed extremely different
signals which have been imperfectly seperated by means of a sequence
of sophisticated and complex optical devices. We therefore not only
have the kind of signal to noise ratio in each sensor (pixel) of the
same kind as an audio signal, each one of them different, but extra
noise added in a very irregular manner by the imperfections of the
optics.

If you want to derive a single signal to noise ratio for the whole
image from this complex plethora of widely variable SNRs then you're
going to have to make quite a number of simplifying assumptions, and
those will depend very specifically on what kind of purposes you want
that single number for.

--
Chris Malcolm DoD #205
IPAB, Informatics, JCMB, King's Buildings, Edinburgh, EH9 3JZ, UK
[http://www.dai.ed.ac.uk/homes/cam/]

Chris Malcolm, May 23, 2008
11. ### Don Stauffer in MinnesotaGuest

On May 22, 12:01 pm, "David J Taylor" <-
this-bit.nor-this-bit.co.uk> wrote:
> John O'Flaherty wrote:
>
> []
>
> >> - 4096 for 12-bit or 16384 for 14-bit. This program will take the
> >> drudgery out of the calculations, if not out of getting the careful
> >> exposures.

>
> However, do be aware that a simple SNR calculation will tell you very
> little about the performance of the camera, unless you take the MTF into
> account. You could make a camera with a low high-frequency MTF which you
> have a very high SNR, but produce very blurry images. You really need to
> measure the SNR for a known input at a known spatial frequency, and then
> weight that measurement according to the perception characteristics of the
> viewer.....
>
> Cheers,
> David

I'd say snr is equally important to MTF. In military electronic
cameras the SNR and MTF were the two big performance issues we would
analyze. A very sharp imagine system (high mtf) will still not give
very good results with a poor snr. In fact, if the camera system has
too low an snr, it becomes very hard to even measure the mtf properly.

Fortunately, current digicams (at least visible light ones) seem to
generally have pretty good snr. Not like the old thermal IR cameras
we dealt with

Don Stauffer in Minnesota, May 23, 2008
12. ### David J TaylorGuest

Don Stauffer in Minnesota wrote:
[]
> I'd say snr is equally important to MTF. In military electronic
> cameras the SNR and MTF were the two big performance issues we would
> analyze. A very sharp imagine system (high mtf) will still not give
> very good results with a poor snr. In fact, if the camera system has
> too low an snr, it becomes very hard to even measure the mtf properly.
>
> Fortunately, current digicams (at least visible light ones) seem to
> generally have pretty good snr. Not like the old thermal IR cameras
> we dealt with

Don,

It sounds as if we have dealt with quite similar things in the past! We
used a technique of taking a four-bar target at a particular contrast
(delta-T) and spatial frequency, and applying /all/ the MTF and noise
factors to that (atmosphere, lens, sensor, processing, display, eye/brain)
and working out the SNR on the retina. Subjective tests showed what
actual observers could achieve in terms of subject recognition with a
given SNR and spatial frequency. Their capabilities were quite
surprising, in a similar way to how experienced bird-spotters can tell a
bird type when all the casual observer can tell is the colour!

Quite how you relate this to image quality in digital cameras I am not
sure, but I completely agree that both MTF and SNR are important. My
guess is that one should use targets of varying contrast (and ideally sine
wave targets), and measure the SNR within a specified spatial frequency
range (rather than just broadband noise). Perhaps something like an
octave of noise centred on the spatial frequency being tested (I suspect
the 1/3 octave of audio may be too fine).

Nice subject for someone's PhD?

Cheers,
David

David J Taylor, May 23, 2008
13. ### David J TaylorGuest

Marc Wossner wrote:
[]
> This is what Norman Korens hypothesis about Shannons information
> theory does. He uses the equation C=W log2(SNR+1), that defines the
> capacity of a data channel, to define image quality (IQ) as IQ=W
> log2(SNR+1), where W is the image visual capacity in one dimension. He
> choose to use the product of MTF 50 and image sensor size for this
> value. Look at http://www.imatest.com/docs/shannon.html.
>
> Best regards!
> Marc Wossner

Thanks, Marc.

I wish I had time to read that in more detail - I've bookmarked it.
However, I don't think that a single number is the answer, as you may want
rather different performance characteristics for (for example) portrait
and architectural photography. In portraits, for example, meaning
low-noise at low spatial frequencies but not too bothered about MTF at
high spatial frequencies (shows too much detail!). Detail may be the key
in other photographs....

Cheers,
David

David J Taylor, May 23, 2008
14. ### PDMGuest

"Marc Wossner" <> wrote in message
news:...

Hi ng,

I´d like to know about the signal to noise ratio of my digital camera.
According to a website I found this value is the ratio of total signal
to total noise expressed in decibels (dB) and can be calculated with
the following formula:

SNR = 20 log (Signal RMS / Noise RMS)

As math was always a horror for me, I have only a slight idea of "root
mean square" but don´t know how to deduce those values from simple

Best Regards!
Marc Wossner

For the life of me, I can not understand why you want to know. Please
amplify?

PDM

PDM, May 23, 2008
15. ### Marc WossnerGuest

On 23 Mai, 23:07, "PDM" <pdcm99minus this > wrote:
> "Marc Wossner" <> wrote in message
>
> news:...
>
> Hi ng,
>
> I´d like to know about the signal to noise ratio of my digital camera.
> According to a website I found this value is the ratio of total signal
> to total noise expressed in decibels (dB) and can be calculated with
> the following formula:
>
> SNR = 20 log (Signal RMS / Noise RMS)
>
> As math was always a horror for me, I have only a slight idea of "root
> mean square" but don´t know how to deduce those values from simple
>
> Best Regards!
> Marc Wossner
>
> For the life of me, I can not understand why you want to know. Please
> amplify?
>
> PDM

I want to know because I want to get a better understanding of the
underlying technique to make better use of it and to be able to rank
the values I find written and on the web by hands-on knowledge.

Best regards!
Marc Wossner

Marc Wossner, May 23, 2008
16. ### PDMGuest

"Marc Wossner" <> wrote in message
news:...
On 23 Mai, 23:07, "PDM" <pdcm99minus this > wrote:
> "Marc Wossner" <> wrote in message
>
> news:...
>
> Hi ng,
>
> I´d like to know about the signal to noise ratio of my digital camera.
> According to a website I found this value is the ratio of total signal
> to total noise expressed in decibels (dB) and can be calculated with
> the following formula:
>
> SNR = 20 log (Signal RMS / Noise RMS)
>
> As math was always a horror for me, I have only a slight idea of "root
> mean square" but don´t know how to deduce those values from simple
>
> Best Regards!
> Marc Wossner
>
> For the life of me, I can not understand why you want to know. Please
> amplify?
>
> PDM

I want to know because I want to get a better understanding of the
underlying technique to make better use of it and to be able to rank
the values I find written and on the web by hands-on knowledge.

How will this help you to take better pictures? Afterall, this is what's

PDM

PDM, May 24, 2008
17. ### Marc WossnerGuest

On 24 Mai, 02:24, "PDM" <pdcm99minus this > wrote:
> "Marc Wossner" <> wrote in message
>
> news:...
> On 23 Mai, 23:07, "PDM" <pdcm99minus this > wrote:
>
>
>
> > "Marc Wossner" <> wrote in message

>
> >news:...

>
> > Hi ng,

>
> > I´d like to know about the signal to noise ratio of my digital camera.
> > According to a website I found this value is the ratio of total signal
> > to total noise expressed in decibels (dB) and can be calculated with
> > the following formula:

>
> > SNR = 20 log (Signal RMS / Noise RMS)

>
> > As math was always a horror for me, I have only a slight idea of "root
> > mean square" but don´t know how to deduce those values from simple

>
> > Best Regards!
> > Marc Wossner

>
> > For the life of me, I can not understand why you want to know. Please
> > amplify?

>
> > PDM

>
> I want to know because I want to get a better understanding of the
> underlying technique to make better use of it and to be able to rank
> the values I find written and on the web by hands-on knowledge.
>
> How will this help you to take better pictures? Afterall, this is what's
> it's all about, not science.
>
> PDM

Better pictures, yes that´s what we are after. But to understand what
a good picture is one needs science. Because we perceive pictures
visually, science is necessary to understand how our visual system
works. And it is important as well to understand how photography as a
technical medium works. Looking at our visual system you can learn
that noise, together with resolution, is an important measure of
sharpness and sharpness in turn is the most important factor in image
quality. So understanding noise and its implications on how we
*perceive* sharpness (it is something our visual system creates) helps
in taking pictures that are judged as superior.

Best regards!
Marc Wossner

Marc Wossner, May 24, 2008
18. ### Ilya ZakharevichGuest

[A complimentary Cc of this posting was sent to
Don Stauffer in Minnesota
<>], who wrote in article <>:
> I'd say snr is equally important to MTF.

Actually, in the age of cheap image DSP, none of them is important at
all. ;-) Using proper DSP, you can modify any one of these
numbers/functions any way you want.

What IS important (and what does not change by applying DSP) is the
RATIO of MTF (at a particular spacial frequency) to the noise level
(filtered appropriately to reflect contribution of noise at the same
spacial frequency).

Essentially, this way you get S/N ratio as a function of spacial
frequency. This function more or less describes how good you can make
the image by application of PROPER DSP.

The integral of log of this function reflects the amount of
information in the image (Shannon-like "image quality"; AFAICS, it
reflects very well the subjective impressions).

Yours,
Ilya

Ilya Zakharevich, May 24, 2008
19. ### Kennedy McEwenGuest

In article <>, Floyd L. Davidson
<> writes
>ransley <> wrote:
>>On May 22, 5:28 am, Marc Wossner <> wrote:
>>> Hi ng,
>>>
>>> I´d like to know about the signal to noise ratio of my digital camera.
>>> According to a website I found this value is the ratio of total signal
>>> to total noise expressed in decibels (dB) and can be calculated with
>>> the following formula:
>>>
>>> SNR = 20 log (Signal RMS / Noise RMS)
>>>
>>> As math was always a horror for me, I have only a slight idea of "root
>>> mean square" but don´t know how to deduce those values from simple
>>>
>>> Best Regards!
>>> Marc Wossner

>>
>>db is sound not what your eve sees, what is "this wedsite" for you id
>>say tb, trollbell

>
>dB has no particular attachment to sound, any more than
>it does to light. It's a ratio of two numbers, as shown
>in the formula above. The numbers represent signal
>power, regardless of what the signal actually is.
>

The most common mistake of all is that in the formula above, the numbers
represent signal and noise AMPLITUDE, eg. voltage, current, digital
units, and NOT power!

If they were power then the correct formula would be
SNR = 10 log(Sig/Noise) dB

The Bell is defined as a power ratio. It is the factor of 10 that
converts Bells to deciBells. Power is proportional to, for example,
volts squared.
Hence 10 log(P1/P2) = 10 log ((V1/V2)^2) = 20 log(V1/V2).

Before estimating SNR, you need to be sure what the numbers you use
represent and how they relate to power (intensity, for example is
proportional to power) otherwise you could be a factor of two out.
--
Kennedy
Yes, Socrates himself is particularly missed;
A lovely little thinker, but a bugger when he's pissed.
Python Philosophers (replace 'nospam' with 'kennedym' when replying)

Kennedy McEwen, May 24, 2008
20. ### Don Stauffer in MinnesotaGuest

On May 23, 9:41 am, "David J Taylor" <-
this-bit.nor-this-bit.co.uk> wrote:

> Don,
>
> It sounds as if we have dealt with quite similar things in the past! We
> used a technique of taking a four-bar target at a particular contrast
> (delta-T) and spatial frequency, and applying /all/ the MTF and noise
> factors to that (atmosphere, lens, sensor, processing, display, eye/brain)
> and working out the SNR on the retina. Subjective tests showed what
> actual observers could achieve in terms of subject recognition with a
> given SNR and spatial frequency. Their capabilities were quite
> surprising, in a similar way to how experienced bird-spotters can tell a
> bird type when all the casual observer can tell is the colour!
>
> Quite how you relate this to image quality in digital cameras I am not
> sure, but I completely agree that both MTF and SNR are important. My
> guess is that one should use targets of varying contrast (and ideally sine
> wave targets), and measure the SNR within a specified spatial frequency
> range (rather than just broadband noise). Perhaps something like an
> octave of noise centred on the spatial frequency being tested (I suspect
> the 1/3 octave of audio may be too fine).
>
> Nice subject for someone's PhD?
>
> Cheers,
> David

While a bar chart target is not a sine wave, which is what MTF is
designed for, a normal bar chart target is a 50-50 square wave. Hence
there is no second harmonic. The first actual overtone that comes
into effect is the third. If there is reasonable anti-aliasing
filtering, then one can use modulation measured from a bar chart to do
MTF calcs. Yeah, a sine wave chart is better, but harder to find,
especially for IR.

Don Stauffer in Minnesota, May 24, 2008