Mercurial > hg > aimmat
view aim-mat/tools/@frame/logcompress.m @ 0:74dedb26614d
Initial checkin of AIM-MAT version 1.5 (6.4.2011).
author | tomwalters |
---|---|
date | Fri, 20 May 2011 12:32:31 +0100 |
parents | |
children |
line wrap: on
line source
% method of class @frame % % INPUT VALUES: % % RETURN VALUE: % % % (c) 2003, University of Cambridge, Medical Research Council % Stefan Bleeck (stefan@bleeck.de) % http://www.mrc-cbu.cam.ac.uk/cnbh/aimmanual % $Date: 2003/03/13 14:48:22 $ % $Revision: 1.6 $ function nap=logcompress(nap,options) %if nargin <2 % options.dynamic_range=50; %end nap=halfwayrectify(nap); vals=getvalues(nap); %gtfb output values are: 0< gt_vals <1 %therefore we will scale for 16bit values %operationally only 15 bits are used as we %half wave rectify vals=vals.*2.^15; %avoid log problems by making everything > 1 vals(find(vals<1))=1; vals=20.*log10(vals); nap=setvalues(nap,vals);