Removing Outliers / Replacing

Good Day,

I do aplogize upfront to open a new topic but I failed to find a search function in the forum.

I have a simple question:

I have a wave from a measurement system which - sometimes if it is exposed to neaby high power electrical motors - creates fluctuating measurement values. 

They are obvious outliers and not related to a true measured value. See attached Graph1. 

I would like to do the below:

1) place my cursors at Start and End where the fluctation starts

2) replace (not delete them) the outliers (which are defined by the value < 3 in the example) by a given value; in the attached example by the value 3.431

The result should look like in "Graph2" below

I have played around with the ?: function, but was not successful, as I only could apply it to the entire wave and not to a certain part of the wave, given by the cursors. 

 

Thanks for your help,

Marc

 

 

 

Original measured values After successful removing outliers

This should do the job

MyWave[pcsr(A), pcsr(B)] = MyWave[p]<3 ? 3.431 : MyWave[p]

"MyWave[a, b]=" means from point a to point b, which I combine with the "<statement> ? <true> : <false>" that you already suggested.

Thanks - this is what I am looking for.

I have tried more or less the same command, but obviously, I did something wrong

You might also try median smoothing:

Smooth/M=threshold width, w_target

The attachment provides a UI for spike removal using either median smoothing or another algorithm that produces very similar results.

You can't choose replacement values, and it doesn't allow you to select a point range, but the end result is perhaps similar to what you're looking for.

spikes108.zip (8.73 KB)

Additionally: Of course you can open new posts. But if you ever want to try the search function use the magnifying glass in the top right corner of the forum. :-)