File Exchange

image thumbnail

Log Binning of Data

version 1.8 (1.6 KB) by

Takes in data, and then produces data for a log binned histogram

6 Downloads

Updated

View License

This script takes in data, and then produces a logarithmically binned (natural log) histogram:
[midpoints,Freq,eFreq] =logbin(data, BinNum)
where the inputs are
data: the input data from some experiment which will be binned
BinNum: the number of bins used in the data reduction process.

The outputs are:

midpoints := the centre of each log bin

Freq := the number of counts in each bin

eFreq := This calculates the original relative Poissonian error before normalisation, then calculates the new error after normalisation.

One should note that this script is a slightly modified version of
'logbinfromlinbin.m' which can be found here:
http://www-personal.umich.edu/~ladamic/courses/si614w06/matlab/index.html

Modified by LPS July, 2010.

NOTES:
This paper will be of use to some looking more deeply into the technique of using log bins in data reduction

"Sampling, log binning, fitting, and plotting durations of open and shut intervals from single channels and the effects of noise"
by McManus et al. 1987.

Comments and Ratings (4)

LPS

LPS (view profile)

Hi Frank,

Thanks for the kind remarks. As for the error, I will look in to altering it within the near future; as well as add more to it.

LPS

Frank Gommer

Hi LPS,
just tried your code and it seems that it does not work with negative values?
It would be nice to add the plot function as well (similiar to hist)...
Otherwise, for my work the code is a good idea!
Cheers,
Frank

LPS

LPS (view profile)

Please do not forget to rate this algorithm, and leave questions or suggestions for improvements to this script.

Many thanks,

LPS

LPS

LPS (view profile)

Thanks John, just getting used to the whole layout of the community.

This paper will be of use to some looking more deeply into the technique of using log bins in data reduction

"Sampling, log binning, fitting, and plotting durations of open and shut intervals from single channels and the effects of noise"
by McManus et al. 1987.

Updates

1.8

Made a research article more apparent in the description.

1.7

Cleaned up the script, updated the help document within the file - it should be more easily used now.

1.6

Realised the information on the usage of the file was severely out of date. This has now been updated.

1.5

I have included an error on the Frequency. This calculates the original relative Poissonian error before normalisation, then calculates the new error after normalisation.

1.4

Corrected normalisation issue; added better documentation (i.e. request help in CMD window works).

1.3

Fixed rounding error which created some extra unnecessary end bins. Also included another output parameter: edges; which some may find useful.

1.2

Edit info content

1.1

Edited info text

MATLAB Release
MATLAB 7.8 (R2009a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today