source: MML/trunk/applications/common/digitize.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 263 bytes
Line 
1function yout = digitize(y,q)
2%DIGITIZE - Digitize a signal
3% yout = digitize(y,q)
4% q - quantization step
5%
6
7r = rem(y,q);
8addone = round(r/q);
9
10%yout = y - r;               % Fix lower
11yout = y - r + addone*q;     % Round
12
13
14%[y;yout;yout1]
15%[y;yout;addone;r]
16
Note: See TracBrowser for help on using the repository browser.