How can I convert serial data to a binary sequence?
显示 更早的评论
> The sequence is 01011010 how can I change from the square wave shown here to a square wave that shows just 01011010? The data rate is 600 bits per second and I am sampling at about 3 times that. Thank you.
4 个评论
Walter Roberson
2017-3-16
Is the diagram intended to display one copy of sampling 01011010 at 1800 samples per second? Is the x axis numbering sample numbers or milliseconds?
For the numbering to make sense as sample numbers, there would have to be about 83 groups of 8 bits.
For the x axis number to make sense as milliseconds, there would have to be about 18 groups of 8 bits.
Brendan Lyden
2017-3-17
Walter Roberson
2017-3-17
I was misreading the readings a bit.
On my display it appears that 3 cm corresponds to 80 samples. The overall display shows up as 7.8 cm, so that would be 7.8*(80/3) = 208 samples.
The sample counts would work out if there were 4 samples per bit rather than 3 -- 208/4 = 52 bits, which would be 6 1/2 repetitions of 8 bits. For the sample count to work out with 3 samples per bit, there would have to be between 8 and 9 repetitions rather than between 6 and 7.
Walter Roberson
2017-3-19
I see in the other discussion that you are sampling at about 3000 samples per second. 208 samples at 3000 samples per second of 600 data bits per second would only be enough samples for 5 complete repetitions.
Question: are you sending async or synchronous? If you are sending async with RS232 then you need to worry about start bits and stop bits, and you have to know the number of each; pretty much everyone uses 1 start bit, but the number of stop bits used varies a bit. Asynch implies that the transitions need to be detected rather than assuming a fixed frequency.
It would also be important to know if you are using a protocol such as bisync or NRZ or NRZI.
采纳的回答
更多回答(1 个)
fateme zabihi
2021-3-8
0 个投票
hello
I have a 4-bit output as a pulse that I want to multiply by 8, 4, 2, and 1 based on the importance of the bits and see the final output. What should I do?
类别
在 帮助中心 和 File Exchange 中查找有关 AI for Signals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


