Weird TCP readings.

Post Reply
dunguyen
Posts: 2
Joined: Fri Nov 29, 2013 10:03 am

Weird TCP readings.

Post by dunguyen » Fri Nov 29, 2013 10:17 am

Hi Coen and the rest of the BioSemi team.

I have been making some measurements using a plethysmograph (and later emg and gsr). I have been picking up the data with TCP, converted to 24-bit numbers and so on and everything looks fine except that sometimes the values are being subtracted by what looks like a certain number.
When I plot it it looks like this:
[attachment=2]figure_1.png[/attachment]
Which is very weird looking. If you notice the top it looks signal the signal that I'm interested in.
[attachment=1]figure_2.png[/attachment]
Which is very similar to what I saw in the actiview acqusition program.
If I remove all values below zero I get this:
[attachment=0]figure_3.png[/attachment]
Which is ultimately what I want, except that almost half of the values are removed.
What causes this? And how can I avoid it?
Attachments
figure_3.png
figure_3.png (76.55 KiB) Viewed 7698 times
figure_2.png
figure_2.png (47.86 KiB) Viewed 7698 times
figure_1.png
figure_1.png (131.71 KiB) Viewed 7698 times

Coen
Site Admin
Posts: 973
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Re: Weird TCP readings.

Post by Coen » Mon Dec 02, 2013 1:11 pm

Treating two's complement numbers as unsigned ?

Best regards, Coen (BioSemi)

dunguyen
Posts: 2
Joined: Fri Nov 29, 2013 10:03 am

Re: Weird TCP readings.

Post by dunguyen » Wed Dec 04, 2013 10:51 am

Thanks that worked!
For anybody else wondering I used this solution: http://stackoverflow.com/a/3783679
The readings are correct now:
[attachment=0]fixed!.png[/attachment]
Attachments
fixed!.png
fixed!.png (77.84 KiB) Viewed 7671 times

Post Reply