0
$\begingroup$

Assume I have a discrete random signal, $f(t)$ for which I want to calculate the laplace transform.

How can I do it in matlab without using sym variables, for example consider I have this discrete signal f(t):

>> t=linspace(0,1000, 10000);
>> f=t.*cos(t);

Is there a way to calculate the Laplace numerically?

After thinking more about the problem I came up with this approach:

t=linspace(0,1000, 10000);
f=t.*cos(t);
syms s;                                
F_s = symfun(sum(f.*exp(-s*t)), s);
ilaplace(F_s)

Though I am not sure it's plausible.

$\endgroup$
2
$\begingroup$

This requires use of the MATLAB symbolic toolbox

>> syms x
>> f = x * cos(x);

>> t = linspace(0, 1000, 1000); % Or whatever values you want to evaluate the Laplace Transform over
>> L = double(laplace(f, t)); % Simulataneously compute the Transform and convert it from 'syms' to double

I guess this isn't exactly what you're asking for, as it requires keeping your function $f$ as a "symbolic expression". I dont know of any function which performs a "discrete Laplace tranform" though.

EDIT: Actually, I dont believe there is such thing as a Laplace Transform for discrete functions. However, the Laplace Transform is just a specific case of the z-Transform when $z = e^s$, which is definitely defined for discrete signals. Unfortunately I can't say much more about this relation between the two transforms, but hopefully this gives you a little more information about how to proceed from here.

$\endgroup$
  • $\begingroup$ My original signal is unknown analytically. $f(t)$ is a random signal. $\endgroup$ – 0x90 Nov 9 '17 at 4:53
  • 1
    $\begingroup$ What if instead of computing the integral $\int_{0}^{\infty} f(t) e^{-st} dt$, you took the sum $\sum_{t=0}^{\infty} f[t] e^{-st}$ (which is only nonzero wherever $t$ is nonzero) $\endgroup$ – goldrik Nov 9 '17 at 5:25
2
$\begingroup$

This comes from my Junior Level Linear Systems course and your question reminded me of:

Lathi, Bhagwandas Pannalal. Signal, Systems, and Controls. Intext, 1973.

in his last chapter (7) where he combines discrete and continuous time elements in a hybrid system, the discrete time elements are modeled as continuous time $\delta(t)$ functions followed by a zero order hold. He gives a table (Table 7.4) of "equivalences", and apologizes that $G(s)$ and $G(z)$ is an abuse of notation.

enter image description here

but I don't know how you it's going to help you if all you have is a sequence of numbers, and no functional form, because the Z transform of a finite sequence (necessary to compute) corresponds to a Z transform of a FIR filter that is all zeros.

You could also try fitting an AR or ARMA model to your data and then you have a functional form but it would need to be a very good fit. Any residuals would get you back to the FIR filter Z transform. The Z transform is linear so adding one to another would be OK. The Bilinear transform would get you back to a zero state one sided Laplace.

The 2 approaches FIR and ARMA, will not give the same Z transform and by extension the same Laplace. You need to decide what you want to do with the Laplace and choose accordingly.

$\endgroup$
1
$\begingroup$

Since your original function is discrete, you can either model that function as a sum of weighted, shifted Kronecker delta functions, and the apply the formula for the Laplace transform.

Or you could simply find the z-transform, and then apply some kind of discrete-to-continuous transformation on the z-transform (example the Bilinear transform), to come to a laplace transform.

$\endgroup$
  • $\begingroup$ Matlab has z transform only to continuous/symbolic variables. $\endgroup$ – 0x90 Nov 9 '17 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.