Mar 19, 2011 #1 J jess17 Junior Member level 3 Joined Mar 4, 2011 Messages 26 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,431 t = 0:.001:2*pi; % Times at which to sample the sine function sig = sin(2*t); % Original signal, a sine wave partition = [-1:2/15:1]; % Length 16, to represent 17 intervals codebook = [0:1:16]; % Length 17, one entry for each interval quants= quantiz(sig,partition,codebook); % Quantize. x=quants; Last edited: Mar 23, 2011
t = 0:.001:2*pi; % Times at which to sample the sine function sig = sin(2*t); % Original signal, a sine wave partition = [-1:2/15:1]; % Length 16, to represent 17 intervals codebook = [0:1:16]; % Length 17, one entry for each interval quants= quantiz(sig,partition,codebook); % Quantize. x=quants;
Mar 19, 2011 #2 S Sckoarn Guest iess17, I am going to guess, as I do not recongize the syntax. But "partition = [-1:2/15:1]; " 15:1 is only 15, should it read 15:0? Sckoarn
iess17, I am going to guess, as I do not recongize the syntax. But "partition = [-1:2/15:1]; " 15:1 is only 15, should it read 15:0? Sckoarn
Mar 19, 2011 #3 J jess17 Junior Member level 3 Joined Mar 4, 2011 Messages 26 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,431 errm, no, its still the same
Mar 19, 2011 #5 J jess17 Junior Member level 3 Joined Mar 4, 2011 Messages 26 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,431 its in matlab Sckoarn said: jess17, What language is it? Click to expand...