I have a 1st dataset of 86400 wind speed (WS) values ββin Matlab and need help filtering it. This requires a certain level of dexterity.
If the average WS exceeds:
- 25 m / s in a time interval of 600 s
- 28 m / s in a time interval of 30 seconds
- 30 m / s in a time interval of 3 s
If any of these parameters is satisfied, WS is considered βinvalidβ until the average WS level falls below 22 m / s for 300 s.
Here is what I have for a 600 second call. I do 600 and 300 seconds of moving average from the data contained in the "data set". I filter the intervals from the first occurrence of an average of 25 m / s to the next occurrence of a value below 22 m / s as "NaN". After filtering, I will do another 600 seconds, and the intervals with the values ββmarked with the NaN icon will remain on NaN.
i.e.
Rolling600avg(:,1) = tsmovavg(dataset(:,2), 's', 600, 1); Rolling300avg(:,1) = tsmovavg(dataset(:,2), 's', 300, 1); a = find(Rolling600avg(:,2)>25) b = find(Rolling300avg(:,2)<22) dataset(a:b(a:find(b==1)),2)==NaN; %?? Not sure
This will require clever use of the βsearchβ and some indexing. Can anyone help me out? Filters 28 m / s and 30 m / s will follow the same method.
source share