ANALOG SIGNAL TO 8 BITS SIGNAL
ANALOG SIGNAL TO 8 BITS SIGNAL
(OP)
HI everyone !
I'm doing a program to transform a normal sine wave into a 8 bits signal
I'm just a beginner and i want your help to know if i'm doing it right.
I give you here the algoritm that i think it work
range = 5 % the max of my sin wave
n8 = 8; % number of bits
q8 = range/(2^n8); % quantization interval
quant8=composto/q8;
a8=fix(quant8);
sinalcod8=a8*q8; my final signal
Thanks
I'm doing a program to transform a normal sine wave into a 8 bits signal
I'm just a beginner and i want your help to know if i'm doing it right.
I give you here the algoritm that i think it work
range = 5 % the max of my sin wave
n8 = 8; % number of bits
q8 = range/(2^n8); % quantization interval
quant8=composto/q8;
a8=fix(quant8);
sinalcod8=a8*q8; my final signal
Thanks
RE: ANALOG SIGNAL TO 8 BITS SIGNAL
RE: ANALOG SIGNAL TO 8 BITS SIGNAL
You may find that your target 8-bit format uses unsigned integers (0-255), whereas your raw data is likely negative and positive. For 16-bit, signed integers are more common. So you probably need to decide whether to apply an offset based on the number of bits.
- Steve
RE: ANALOG SIGNAL TO 8 BITS SIGNAL
Now i use this function, dec2bin to transform this to an bin code. but i dont know how to represent this on a graph like plot.
Can you help me ?
sinal_digital8 = dec2bin(abs(a8),n8);
thanks ;)
RE: ANALOG SIGNAL TO 8 BITS SIGNAL
Cheers
Greg Locock
New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?
RE: ANALOG SIGNAL TO 8 BITS SIGNAL
thanks