Send and receive analog signal in Serial port
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Majid kh
am 2 Feb. 2019
Beantwortet: Walter Roberson
am 2 Feb. 2019
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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 2 Feb. 2019
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Analog Input and Output finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!