Research Article
Logical Sensor Network: An Abstraction of Sensor Data Processing over Multidomain Sensor Network
Listing 1
Source code for filter node (lowpass filter) node in Java.
public class LowpassFilter extends Filter{ | private static final double k = 0.1; | private double smooth; | 4 public LowpassFilter(String n, Trigger t) { | 5 super(n, t); | 6 } | 7 @Override | 8 public Data filter(Data d) { | 9 smooth += (data.getValue() – smooth) * k; | Data res = new ProcessorData(d); | res.setValue(smooth Value); | return res; | 13 } | 14 } |
|