def transform(self, timestamp: float, nsamp: int=1):
    'add per-sample timestamp information to the data matrix\n\n        Args:\n            timestamp (float): the timestamp of the last sample of d\n            nsamp(int): number of samples to interpolate\n\n        Returns:\n            np.ndarray: (nsamp) the interpolated time-stamps\n        '
    if (not hasattr(self, 'last_sample_timestamp_')):
        self.fit(timestamp, nsamp)
    self.n_ = (self.n_ + nsamp)
    if ((self.last_sample_timestamp_ < timestamp) or (self.sample2timestamp is not None)):
        if (self.sample2timestamp is not None):
            newtimestamp = self.sample2timestamp.transform(self.n_, timestamp)
            if (abs((timestamp - newtimestamp)) < self.max_delta):
                timestamp = int(newtimestamp)
        samples_ts = np.linspace(self.last_sample_timestamp_, timestamp, (nsamp + 1), endpoint=True, dtype=int)
        samples_ts = samples_ts[1:]
    elif self.fs:
        samples_ts = ((np.arange(((- nsamp) + 1), 1, dtype=int) * (1000 / self.fs)) + timestamp)
    else:
        samples_ts = (np.ones(nsamp, dtype=int) * timestamp)
    self.last_sample_timestamp_ = timestamp
    return samples_ts
add per-sample timestamp information to the data matrix

Args:
    timestamp (float): the timestamp of the last sample of d
    nsamp(int): number of samples to interpolate

Returns:
    np.ndarray: (nsamp) the interpolated time-stamps
def transform(self, timestamp: float, nsamp: int=1):
    'add per-sample timestamp information to the data matrix\n\n        Args:\n            timestamp (float): the timestamp of the last sample of d\n            nsamp(int): number of samples to interpolate\n\n        Returns:\n            np.ndarray: (nsamp) the interpolated time-stamps\n        '
    if (not hasattr(self, 'last_sample_timestamp_')):
        self.fit(timestamp, nsamp)
    self.n_ = (self.n_ + nsamp)
    if ((self.last_sample_timestamp_ < timestamp) or (self.sample2timestamp is not None)):
        if (self.sample2timestamp is not None):
            newtimestamp = self.sample2timestamp.transform(self.n_, timestamp)
            if (abs((timestamp - newtimestamp)) < self.max_delta):
                timestamp = int(newtimestamp)
        samples_ts = np.linspace(self.last_sample_timestamp_, timestamp, (nsamp + 1), endpoint=True, dtype=int)
        samples_ts = samples_ts[1:]
    elif self.fs:
        samples_ts = ((np.arange(((- nsamp) + 1), 1, dtype=int) * (1000 / self.fs)) + timestamp)
    else:
        samples_ts = (np.ones(nsamp, dtype=int) * timestamp)
    self.last_sample_timestamp_ = timestamp
    return samples_ts