source:
MML/trunk/applications/common/digitize.m
@
4
Last change on this file since 4 was 4, checked in by , 10 years ago | |
---|---|
File size: 263 bytes |
Line | |
---|---|
1 | function yout = digitize(y,q) |
2 | %DIGITIZE - Digitize a signal |
3 | % yout = digitize(y,q) |
4 | % q - quantization step |
5 | % |
6 | |
7 | r = rem(y,q); |
8 | addone = round(r/q); |
9 | |
10 | %yout = y - r; % Fix lower |
11 | yout = 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.