Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

Smooth out data points

Still a little green? Ask your beginner's questions here

Smooth out data points

Postby zlou » Fri Feb 23, 2018 2:06 pm

Hello!

I'm interested in animating / visualizing some realtime data I'm pulling in. I'm able to connect to an API, and output the data into a Table DAT. From there, I'm not sure the best way to go. I tried making the data "move" by following Matthew Ragan's tutorial here: https://matthewragan.com/2014/05/28/let ... hdesigner/

The problem I'm having is that the data I get is somewhat erratic, jumping up and down quickly. So, the table values don't move smoothly as they go from data point to data point.

I would like to figure out a way to slowly move between each of my data points (similarly to how you can slowly and smoothly move through noise data). I've tried messing with the Filter CHOP but that hasn't been able to meaningfully smooth things out.

Anyone have any ideas?
zlou
 
Posts: 3
Joined: Tue Feb 13, 2018 2:49 pm

Re: Smooth out data points

Postby raganmd » Fri Feb 23, 2018 4:47 pm

You might look at the Lag CHOP too - it allows you to filter both on the rising and falling edges of your data, as well as to overshoot or clamp slope. It can be a little slippery, but lots of good options there. Are you dealing with multiple samples or single samples in your data stream?
raganmd
 
Posts: 1351
Joined: Thu Mar 28, 2013 5:21 am
Location: San Francisco, CA

Re: Smooth out data points

Postby zlou » Fri Feb 23, 2018 6:33 pm

Thanks for the response! The sample I'm pulling is a series of values of one type. A good analogy would be getting all of the "high" temperatures in one location from each day of last year (except in this case, unfortunately, the temperature does not stay at similar temps from day to day).

I was able to set up a visualizer that moves a geometric object around the screen based on random noise data. However, when I connect that visualizer to my actual data, the object jumps around in a crazy way.

Essentially, I want to try to slow it down (akin to increasing the period of the noise CHOP), and interpolate the data so that it creates and reads values between the data points.

I've tried messing around with the Lag CHOP (and the Stretch CHOP), but to no avail - however, this might be due to my n00bishness, not from the tools being incapable of doing what I want.

For reference, I quickly put together a prototype of what I'm building that should display the problem I'm having (I didn't include any of my attempts to move through the table rows). It shows a working prototype using a Noise CHOP to control the x,y position of a circle, and then shows how messed up the prototype is that attempts to use the table data to drive the x position.
Attachments
example_data.toe
(5.24 KiB) Downloaded 33 times
zlou
 
Posts: 3
Joined: Tue Feb 13, 2018 2:49 pm

Re: Smooth out data points

Postby zlou » Fri Feb 23, 2018 7:14 pm

My response actually trigged a thought that I think led to a solution. I remembered having gone through a different tutorial by you (Matthew - I'm assuming that's raganmd) of you showing how to animate the temperature data in your videos from the THP 494 & 598 class.

I essentially took the same model of using a Constant -> Speed -> Lookup to slowly go through the data points (making the constant realllly low). That seems to be working for now.

Also - Matthew, I'm a really big fan of your tutorials. So helpful and interesting - thanks for your support for all the TD users!
zlou
 
Posts: 3
Joined: Tue Feb 13, 2018 2:49 pm

Re: Smooth out data points

Postby raganmd » Fri Feb 23, 2018 7:40 pm

Heyyyy - Yeah, it's me. :)

Well done - I can't tell you how many times I find that just talking about a problem or challenge ends up helping me figure out how to move forward. It's often one of the reasons I like the forum more than other more immediate messaging approaches since it gives you space to think about the problem you're trying to solve.

I'm in the middle of prepping for a show, but I'll take a look later this weekend to see if I can give you a nudge in another direction. It's great to hear that the tuts are helpful, graphics programming is a wild ride and I'm always thankful for some places to work from - so I hope I can offer that to folks as well.
raganmd
 
Posts: 1351
Joined: Thu Mar 28, 2013 5:21 am
Location: San Francisco, CA

Re: Smooth out data points

Postby greg » Sat Feb 24, 2018 2:14 am

In terms if smoothing out captured or recorded data, look at the palette component gestureCapture. It has some tricks where the captured data is treated as keyframes and there are a few methods to smooth the data without making it too sluggish. It outputs a SOP that can be converted to channels that can be used in a lookup.

I know this is not your problem. Seems like the way you set it up, you first sample is displayed at frame 1 of the timeline, second sample at frame 2. What Mathew explains with Speed CHOP, its reset, and Lookup give more control.
User avatar
greg
Staff
 
Posts: 538
Joined: Tue Nov 13, 2007 1:08 am

Re: Smooth out data points

Postby raganmd » Mon Feb 26, 2018 3:08 pm

Hey zlou,

Finally looking at your example file. One thing to keep in mind here is that in your channel referencing approach you're getting a new sample from your CHOP every frame - this is what makes the data look like it's jumping. The lookup approach is a pretty solid solution here, though you could also use a stretch CHOP to change also do some of that linear interpolation.

After your datto1 try adding a stretch CHOP with an end sample of 6000. You should see the movement of your circle slow down a good bit this way.
raganmd
 
Posts: 1351
Joined: Thu Mar 28, 2013 5:21 am
Location: San Francisco, CA


Return to Beginners

Who is online

Users browsing this forum: No registered users and 7 guests