mercredi 21 janvier 2015

generating DAC audio signal in matlab

I have Been trying to make and understand ADCs using matlab, i made this little program that allows me to modify the number of bits from the wave form (2^8 , 8 being the No of bits, can go from 1 to 64), however when playing the sound in the computer it sounds like if there was something stopping the sound, its possible to change the frequency however the problem persists im wondering what did i do wrong



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');

Aucun commentaire:

Enregistrer un commentaire