help! what is wrong with my code

Status
Not open for further replies.

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:

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
 

errm, no, its still the same
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…