Smooth - psambit9791/jdsp GitHub Wiki
Smooth uses convolution with a specified kernel to smooth the input signal. It works in 2 modes:
-
Rectangular: This is a uniform kernel. Eg: For size 5, kernel =
$\frac{[1, 1, 1, 1, 1]}{size}$ -
Triangular: This is a weighted kernel. Eg: For size 5, kernel =
$\frac{[1, 2, 3, 2, 1]}{size}$
The parameters for this filter are as follows:
- Mode of Operation ⇨ "rectangular"
- Kernel Size ⇨ 11
String mode = "rectangular";
int wsize = 11;
Smooth s1 = new Smooth(signal, wsize, mode);
double[] out = s1.smoothSignal();
The parameters for this filter are as follows:
- Mode of Operation ⇨ "triangular"
- Kernel Size ⇨ 11
String mode = "triangular";
int wsize = 11;
Smooth s1 = new Smooth(signal, wsize, mode);
double[] out = s1.smoothSignal();