codebook = [-1.2:.2:1]; % Codebook length must be equal to the number of partition intervals
サンプリング後の正弦波で量子化を実行します。
[index,quants] = quantiz(sig,partition,codebook);
量子化された正弦波とサンプリング後の正弦波をプロットします。
plot(t,sig,'x',t,quants,'.')
title('Quantization of sine wave')
xlabel('Time')
ylabel('Amplitude')
legend('Original sampled sine wave','Quantized sine wave');
axis([-.2 7 -1.2 1.2])
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.