📺 Watch how to smooth Analysis Values - articulateinstruments/AAA-DeepLabCut-Resources GitHub Wiki
Click on the video below to watch it on YouTube.
The above video was recorded in AAA version 219 on 8th August 2021
in this tutorial i'm going to demonstrate how to smooth analysis values in a previous tutorial we measured the tongue tip movement along this orange measurement fiducial and the tongue root movement along this pink measurement fiducial and if we have a look at these analysis values of the distance variation along this pink line for instance we can see is a little bit noisy in this region move through it slowly we can see this is because the the estimate in is fluctuating a little bit due just due to the error in the tongue contour estimation so we can smooth this out and smooth out these these slight fluctuations and we can do this using maths values so if we go into edit analysis values and we'll create a maths value create new and we'll call this tip test underscore sn for smooth okay and we'll base this on the base expression tip dist so that's the data that it's going to take as input and we want to filter it so we're going to use this edit filter option and we're going to select the Savitzky Golay savgol filter and this is a smoothing filter we'll select m equals four and there's two two options of shapes filter here this one is slightly sharper cut off now i think by default you normally get a 20 millisecond window length which corresponds to an 82 hertz cut off but tongue movement is quite slow so a value of around about a hundred or perhaps 120 will give us well in this case 100 milliseconds gives us roughly a 16 hertz cut off so it's only going to look at movements of 16 hertz and less so we'll click ok and we'll just do that again for the the root so this is root and dist underscore sn for smooth again go into edit oh again up here we need to say what the input is root dist if you don't get the name quite right you'll see an error down here saying that root disk doesn't exist as we put the t in it recognizes it again we'll click on filter so it's remembers the last settings that you used that's convenient and if we select close now if we select all of these files up here in the fine chart function and select common axis and re-plot these we should get them being plotted on top of each other oh sorry i forgot we need to save these mass values into the database and to avoid us having to recalculate them every time and to do that we'll press this recalculate button so that's it just recalculating you can do this just for the current recording or you can do it for all recordings in the session but we will just do it for this one recording at the moment and if we close that and now if you're going to select these common axes now it's a little difficult to see here but if i switch off the tongue root raw data you can see that there is a a smoothed version down here of the pink line now if we picked even lower values than 16 hertz we could get this to be a little bit smoother but you'd want to be careful not to lose any of the actual movement data from this so in in another tutorial we'll show how to export these smooth analysis values