how can i convert Sinusoidal Signal to digital code(encoding)

Hi! I'm beginner in matlab. I have code below
clear all
A = 2;
f0 = 2.4;
Ts = 0.01;
t = [0:Ts:1];
omega = 2*pi*f0;
phi = 60*pi/180;
xt = A*cos(omega*t+phi);
figure(1)
plot(t, xt); grid;
xn = xt;
figure(2)
stem(xn)
Trial>> partition = [-2:0.5:2];
Trial>> codebook = [-2.25:0.5:2.25];
Trial>> [index quants] = quantiz(xt, partition, codebook);
I want convert this quantization code to digital code. for example
this code encode quantization to digital code. 3bit resolution
please help. thank you

カテゴリ

ヘルプ センター および File ExchangeOperators and Elementary Operations についてさらに検索

質問済み:

2016 年 10 月 13 日

回答済み:

2019 年 5 月 10 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by