How do I encode numbers into a bit stream, ready to be modulated?

Hey everyone. I've been assigned a project which involves two computers running Matlab. It involves asking the user for two numbers to perform basic arithmetic calculations on one computer, and then encoding the two numbers and the arithmetic operation into a bit stream, then digitally modulating the encoded stream using either amplitude, frequency or phase shift keying. The second computer receives the modulated signal, demodulates it, and then decodes the numbers and the operation to perform said calculation, and then uses the same method of encoding and modulation to send the result back to the first computer.
The first step would be to encode the numbers and the operation. I've tried using the de2bi function, but it wouldn't help me with the operators. The second approach would be to use ASCII to convert the numbers and the operators. But I don't see how that would make it into a bit stream.
Is there any library in Matlab that could help me with the encoding? I'd also really appreciate a way to approach modulation. I've chosen FSK for it's increased noise immunity, I know the theory behind it, but I don't have a clue as to how I can implement it on Matlab. Thanks.
(also, I'm an electrical engineering student in my 5th semester, this is a project of analog and digital communication)

1 comentario

Hey! I have been assigned a similar project. It invovles tranferring text messages. That is the only difference. Could you help me out?

Iniciar sesión para comentar.

Respuestas (1)

Changing to a bit-stream is not difficult.
a='46+87';%your two numbers and operator
b=dec2bin(double(a),8)';%convert ascii to binary (8-bit)
bitStream=b(:)'-'0';

Categorías

Etiquetas

Preguntada:

el 21 de Nov. de 2019

Respondida:

el 11 de Nov. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by