Delaglio’s Tips for Measuring Noise in NMRPipe

NMRDraw has interactive tools to estimate noise (Draw/Estimate Noise) and report statistics of a selected region (Mouse/2D Zoom).

If you’d like to use command-line tools to estimate noise, here are some examples … you can combine these in a script to automated a signal to noise calculation according to whatever protocol you like.

If you’d like to report the RMS or other statistic of a spectral region, you can use the “specStat.com” utility. For example, this would perform an automated noise estimate. The noise estimate analyzes the distribution of intensities, and assumes that that inner fraction of this distribution is mostly due to noise. This estimate is usually good to between 5 – 20%, and will tend to underestimate the noise:

specStat.com -in test.ft2 -x1 0% -xn 100% -y1 0% -yn 100% -stat vEstNoise

This would report the RMS of the selected region (such as an empty region you define):

specStat.com -in test.ft2 -x1 10.5ppm -xn 9.7ppm -y1 117.0ppm -yn 104.0ppm -stat vRMS

As you know, you can perform peak detection in NMRDraw, but the same peak detection method is available from the command line, for example:

pkDetect2D.tcl -in test.ft2 -thresh 1.2e+6 -out test.tab

Given a peak table, you can extract the HEIGHT values like this:

set hiList = (`getTabCol.tcl -in test.tab -var HEIGHT`)

and you can extract statistics of the extracted values above (average, minimum, maximum, etc) like this:

getStat.tcl -x $hiList -stat Median

A complete example is below. Hope this helps!

Cheerful Regards,

big fd

#!/bin/csh

set autoNoise = (`specStat.com -in test.ft2 -x1 0% -xn 100% -y1 0% -yn 100% -stat vEstNoise -brief`)
set manualNoise = (`specStat.com -in test.ft2 -x1 10.5ppm -xn 9.7ppm -y1 117.0ppm -yn 104.0ppm -stat vRMS -brief`)

pkDetect2D.tcl -in test.ft2 -thresh 1.2e+6 -out test.tab -noverb

set hiList = (`getTabCol.tcl -in test.tab -var HEIGHT`)
set pkMedian = (`getStat.tcl -x $hiList -stat Median -noverb`)

set autoSN = (`MATH “$pkMedian/$autoNoise”`)
set manualSN = (`MATH “$pkMedian/$manualNoise”`)

nmrPrintf “Automated Noise Estimate: %9.1f\n” $autoNoise
nmrPrintf “RMS of Manually-Selected Empty Region: %9.1f\n” $manualNoise
nmrPrintf “Median Peak Height: %.3e\n” $pkMedian
nmrPrintf “Automated Signal-to-Noise: %9.3f\n” $autoSN
nmrPrintf “Manual Signal-to-Noise: %9.3f\n” $manualSN

Delaglio’s Tips for Measuring Noise in NMRPipe