source:
MML/trunk/applications/common/digitize.m
Last change on this file was 4, checked in by , 11 years ago | |
---|---|
File size: 263 bytes |
Rev | Line | |
---|---|---|
[4] | 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.