close all
clear all
clc
n=-100:100;
y=sin(.2*pi*n);
% y2 = exp(y);
% V= max(y2);
y2 = y;
V= max(y2);
partitionV=(-15:15)/16*V;
codebookV=(-16:15)/16*V;
A=87.6;
compressedy2 = compand(y2,87.6,V,'a/compressor');
[index,quants] = quantiz(compressedy2,partitionV,codebookV);
reconstructedy = compand(quants,A,max(quants),'a/expander');
plot(n,y);
hold on
plot(n,reconstructedy,'r');