Hi, I am working on a project and I am not sure how to convert the input signal from an analog to an 8-bit digital signal. Here is my code:
t = [0:1:4000]; % Number of Samples fs = 4500; % Sampled Frequency
Input = sin((2*pi*t)/fs); % Analog Sine Wave subplot(2,1,1) plot(Input) % Analog Sine Wave Plot grid on
My question is how to convert this sine wave sampled at 4500 Hz into a digital 8-bit signal.
No products are associated with this question.
t = [0:1:4000]; fs = 4500; Input1 = sin((2*pi*t)/fs); quant=max(Input1)/(2^7-1) y=round(Input1/quant) signe=uint8((sign(y)'+1)/2) out=[signe dec2bin(abs(y),7)] % The first bit represents the sign of the number