×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

ANALOG SIGNAL TO 8 BITS SIGNAL

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
Replies continue below

Recommended for you

RE: ANALOG SIGNAL TO 8 BITS SIGNAL

(OP)
composto is my sine wave

RE: ANALOG SIGNAL TO 8 BITS SIGNAL

One comment...

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

(OP)
Hi Steve,

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

(OP)
... I can't find a solution to my problem... :/ when i want to transform binary to gray code i find an error Undefined function 'grey2bin' for input arguments of type 'char'. and i can't plot my matrix of binary code... i want to represent like a square pulse

thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close