returns a new *Signal* interpolated using the *new_timestamps*

        Parameters
        ----------
        new_timestamps : np.array
            timestamps used for interpolation
        interpolation_mode : int
            interpolation mode for integer signals; default 0

                * 0 - repeat previous samples
                * 1 - linear interpolation

        Returns
        -------
        signal : Signal
            new interpolated *Signal*

def interp(self, new_timestamps, interpolation_mode=0):
        """ returns a new *Signal* interpolated using the *new_timestamps*

        Parameters
        ----------
        new_timestamps : np.array
            timestamps used for interpolation
        interpolation_mode : int
            interpolation mode for integer signals; default 0

                * 0 - repeat previous samples
                * 1 - linear interpolation

        Returns
        -------
        signal : Signal
            new interpolated *Signal*

        """
        if not len(self.samples) or not len(new_timestamps):
            return Signal(
                self.samples.copy(),
                self.timestamps.copy(),
                self.unit,
                self.name,
                comment=self.comment,
                conversion=self.conversion,
                raw=self.raw,
                master_metadata=self.master_metadata,
                display_name=self.display_name,
                attachment=self.attachment,
                stream_sync=self.stream_sync,
                invalidation_bits=self.invalidation_bits.copy()
                if self.invalidation_bits is not None
                else None,
                encoding=self.encoding,
            )
        else:

            if len(self.samples.shape) > 1:
                idx = np.searchsorted(self.timestamps, new_timestamps, side="right")
                idx -= 1
                idx = np.clip(idx, 0, idx[-1])
                s = self.samples[idx]

                if self.invalidation_bits is not None:
                    invalidation_bits = self.invalidation_bits[idx]
                else:
                    invalidation_bits = None
            else:

                kind = self.samples.dtype.kind
                if kind == "f":
                    s = np.interp(new_timestamps, self.timestamps, self.samples)

                    if self.invalidation_bits is not None:
                        idx = np.searchsorted(
                            self.timestamps, new_timestamps, side="right"
                        )
                        idx -= 1
                        idx = np.clip(idx, 0, idx[-1])
                        invalidation_bits = self.invalidation_bits[idx]
                    else:
                        invalidation_bits = None
                elif kind in "ui":
                    if interpolation_mode == 1:
                        s = np.interp(
                            new_timestamps, self.timestamps, self.samples
                        ).astype(self.samples.dtype)
                        if self.invalidation_bits is not None:
                            idx = np.searchsorted(
                                self.timestamps, new_timestamps, side="right"
                            )
                            idx -= 1
                            idx = np.clip(idx, 0, idx[-1])
                            invalidation_bits = self.invalidation_bits[idx]
                        else:
                            invalidation_bits = None
                    else:
                        idx = np.searchsorted(
                            self.timestamps, new_timestamps, side="right"
                        )
                        idx -= 1
                        idx = np.clip(idx, 0, idx[-1])
                        s = self.samples[idx]

                        if self.invalidation_bits is not None:
                            invalidation_bits = self.invalidation_bits[idx]
                        else:
                            invalidation_bits = None
                else:
                    idx = np.searchsorted(self.timestamps, new_timestamps, side="right")
                    idx -= 1
                    idx = np.clip(idx, 0, idx[-1])
                    s = self.samples[idx]

                    if self.invalidation_bits is not None:
                        invalidation_bits = self.invalidation_bits[idx]
                    else:
                        invalidation_bits = None

            return Signal(
                s,
                new_timestamps,
                self.unit,
                self.name,
                comment=self.comment,
                conversion=self.conversion,
                source=self.source,
                raw=self.raw,
                master_metadata=self.master_metadata,
                display_name=self.display_name,
                attachment=self.attachment,
                stream_sync=self.stream_sync,
                invalidation_bits=invalidation_bits,
                encoding=self.encoding,
            )