I would like to make a 3D laplace s-domain plot from experimental data I have. The examples I have seen for this are when the function is already known and an analytical solution can be obtained (example How can I plot a 3D graph of a given Laplace Transform of a function?). I have experimental data (time series) where I don't know what functions are present, and am having difficulty generating the s-domain plot.
The approach I tried to take is
- start with time domain signal y(t)
- multiply it by e^(-sigma * t) for each value of sigma.
- calculate the complex fourier transform
- plot the s-domain, real vs imaginary. Look at poles and zeros.
I don't understand how to move from step 3 to step 4. The s-domain plot is a 3D plot with X, Y, and Z axes. I'm getting confused over what these different axes actually are.
X-axis = sigma, the value I am varying. Y-axis = the complex part of the output from step 3? Z-axis = ? magnitude of output from step 3?
Below is an example of what I'm trying to do in Python with an example signal that is similar to my experimental data. Ultimately I would like to do something similar to this question How to decompose a signal into exponentally decaying sinusoids?
import numpy as np
import matplotlib.pyplot as plt
from scipy import fftpack
#%% definitions
def synthetic_signal(t):
#y = np.exp(-1.5 * t) * np.cos(40 * t) # simpler example
y = 0.5 * np.exp(-10 * t) * np.sin(20 * 2 * np.pi * t + 0.1) + 1 * np.exp(-50 * t) * np.sin(250.0 * 2.0 * np.pi * t)
return y
def laplace_function(function, t, sigma):
y_exp = function * np.exp(-sigma * t)
y_exp_fft = np.fft.rfft(y_exp)
real = y_exp_fft.real
imaginary = y_exp_fft.imag
return real, imaginary
#%% look at result with a fixed sigma value to see if it makes sense.
t = np.linspace(0, 0.5, num=int(1e3), endpoint=False)
f = synthetic_signal(t)
l_real, l_imaginary = laplace_function(f, t, sigma=-1.5)
print('y_exp_fft =', y_exp_fft)
# plt.plot(l_imaginary, 'k.-')
# plt.plot(l_real, 'r.-')
plt.plot(l_real, l_imaginary, 'b.')
# then make a mesh plot
```