Send and receive analog signal in Serial port
1 次查看(过去 30 天)
显示 更早的评论
Hi there, I can produce sine signal and send it to sound card or receive signal by microphone and see it on MATLAB, is there any way that i can do it for serial port?
0 个评论
采纳的回答
Walter Roberson
2019-2-2
No, not unless the data was low rate binary and you were willing to encode it by asserting or retracting DSR or DTR, as those can be detected. This assumes that you are using a true serial port and not USB emulating serial: those only transmit one DSR and DTR state per packet rather than each time the pins change.
Although voltages can vary for RS232 / RS422 / TTL transmit pins, serial drivers have no way of seeing those voltages, and can only get at the decoded pulse trains of start bit, 7 or more data bits, and then stop bit.
Now, if you had a sensor device such as an arduino that was reading the sine wave for you, and transferring a representation of it as data over RS232 / RS422 / TTL pins or USB, then that would be a different situation.
For the purpose of reading raw analog without a specific data acquisition device, you would have more success in connecting to microphone and examining the audio inputs. A microphone input is a form of analog to digital convertor.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Analog Input and Output 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!