Seeq Team Allison Buenemann Posted July 1, 2019 Seeq Team Share Posted July 1, 2019 FAQ: I've got a signal with drop-outs and I want to filter my signal to only visualize samples with values above a threshold. Is there a quick way to do this in Seeq? Solution: We can use Seeq's Signal Filtering capabilities to break down a signal into individual samples and create a new signal that keeps the samples only above your specified threshold. 1. Visualize your signal with drop-outs and determine the threshold value. For this example, we will filter out all samples with a value of less than or equal to 40F. 2. Open a new Seeq Formula window and use the search documentation to look for information on filtering a signal. When we begin to type filter, we see right away an option "filter() Signal". Open the documentation to get an understanding of what the function is doing and example syntax. The first example below is taking a string signal and breaking it down into samples, then keeping samples only if their string value is not equal to 'T4A' (note single or double quotes are required for string inputs). The second example is filtering to remove infinite values or NaN values. The first logical statement "$sample.getValue().isValid()" is keeping only the samples with valid values, removing NaN or other invalid values. The second logical statement "$sample.getValue().isFinite()" is keeping only the samples with finite values. Note that we can string as many logical criteria together as we want here using the && operator. In our case, we want to filter our temperature signal to show only samples with values above 40F. The syntax in the formula input window below "$Temp.filter($sample -> ($sample.getValue().isGreaterThan(40)))" shows how we are able to take our temperature signal, break it down into individual samples, and then only keep samples whose value is greater than 40F. The new filtered signal appears nearly exactly the same as the original, but with the drop-outs removed. 1 Link to comment Share on other sites More sharing options...
Administrators Teddy Posted July 2, 2019 Administrators Share Posted July 2, 2019 The method I use in the newer versions of Seeq is the remove() function. It shortens the syntax a little bit and gets around a transform. See screenshots below for details. The result. Link to comment Share on other sites More sharing options...
Pat Dixon Posted May 3, 2021 Share Posted May 3, 2021 This is not working for me. Remove is not removing data, it is keeping the last value. This messes up formulas. Link to comment Share on other sites More sharing options...
Seeq Team Joe Reckamp Posted May 3, 2021 Seeq Team Share Posted May 3, 2021 Hi Pat, You will need to make sure that the maximum interpolation is less than the data being removed or else the data will be interpolated through the gaps. You can set the maximum interpolation in the formula as well by adding a .setmaxinterpolation(<time>) at the end. 1 Link to comment Share on other sites More sharing options...
Pat Dixon Posted May 3, 2021 Share Posted May 3, 2021 That helped, thanks. Would it make sense to have a trim or clamp function to make this easier? All I want to do is to remove data outside of a range, and it seems you have to go pretty deep to get that to work Link to comment Share on other sites More sharing options...
Thorsten Vogt Posted May 3, 2021 Share Posted May 3, 2021 Hi Pat, you may use within() fo this. The following example keeps only the portions of the signal where the value of the signal is above 65: Regards, Thorsten 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now