Smooth interpolation in a buffer of random values (using the
sinc-function that approximates an ideal low pass filter)
Syntax
y = SmoothIdealLowPass.interpolate(buffer,offset);
Description
Interpolate in buffer by using the sinc function. This is
an approximation of an ideal low pass filter that completely blocks
frequencies above the cut-off frequency f = 1/T (where T
is the sample period with which the buffer was filled). Input
argument offset is a Real number marking the point at which
interpolation shall take place. offset=0 is the first buffer value
buffer[1]. offset=size(buffer,1)-1 is the last buffer value
buffer[size(buffer,1)]. It is required that
0 ≤ offset < size(buffer,1)-1. The function
returns the interpolated value. The interpolation is continuous
with a continuous first derivative. In order to avoid issues at the
end of the buffer (where a minimally too large offset value
triggers an assert), it is best to make the buffer one element
larger as needed. For example, if the buffer is filled with a
sample period of 1 ms and every 100 samples an event occurs,
then the buffer should have length 102 for the samples 0 ms,
1 ms, 2 ms, ...., 100 ms, 101 ms.
| Date |
Description |
| Sep. 4, 2015 |
|
Generated at 2026-04-04T18:18:28Z by OpenModelicaOpenModelica 1.26.3 using
GenerateDoc.mos