我一直在尝试使用 Matlab 制作和理解 ADC。我制作了这个小程序,允许我修改波形的位数(2^8,8 是位数,可以从 1 到 64)。但是,在计算机中播放声音时,听起来好像有什么东西停止了声音。可以更改频率,但问题仍然存在。我想知道我做错了什么?
clf %clr screen
t = 0:1:1600
fs = 1000
senial = sin((2*pi*t)/fs)
quant=max(senial)/(2^8) % R/L = size of sep
y=round(senial/quant) % Quantizationto 2^N bit
signe=uint8((sign(y)'+1)/2) % transforms it to int 8 bit
out=[signe] % The first bit represents the sign of the number
sound(y,fs)
plot(y,'b');