Error when taking the continuous time Fourier transform

I am trying to figure out what the error is associated with taking a Fourier transform. I have a 1D vector A of 130 elements and I know the error associated with each element that is just a number. The error is a 130 element vector called std_A. From that I think I can calculate the error associated with the function that it makes up:
syms t w real
f(t) = sum(exp(-t./A))*heaviside(t);
std_ft(t) = sqrt(sum((abs(t).*exp(-t.*A)*heaviside(t)+dirac(t)).*std_A).^2);
The last line is what I calculated by doing the error propagation for the nonlinear function and is approximate.
Since I think in general you need to take the Fourier transform of the error in the time domain to calculate the error in the frequency domain, I have:
std_fw(w) = fourier(std_ft(t),t,w);
The calculation is very slow I think due to the length of the vector A and also the end result is actually a function of both t and w, which I'm not sure how to work with.
Is there a better way of doing this? I feel like I am making this harder than it needs to be.

4 Comments

@L'O.G., I don't have the Symbolic Math Toolbox, but by reading examples in Fourier transform - MATLAB fourier (mathworks.com), none of them use function definitions that reference the independent variable like your f(t), std_ft(t) or std_fw(w). If these are valid what do they produce when the lines aren't terminated with semicolons? And why isn't f used in std_ft?
@Jeffrey Clark For example, using a much smaller vector for A to show you:
A = [0.5 0.75];
syms t w real
f(t) = sum(exp(-t./A))*heaviside(t);
f(w) = fourier(f(t),t,w)
I get as output
f(w) = 1/(2 + w*1i) + 1/(4/3 + w*1i)
Also, $f(t)$ is in the expression for the standard deviation. I just wrote it out explicitly after propagating the error and taking the derivative.
@L'O.G., thanks for explaining some things. Your original post said std_fw(w) returned something that is a function of both t and w, but in your simplified example above f(w) is only a function of w. Is this your question? (It is mine.) Could the symbolic math engine not have been able to do the fourier completely? Or is your f(t) above and std_ft(t) quite different if you were to ask MATLAB to display those symbolic equations like you did above for f(w), perhaps with unresolved dependencies?
@Jeffrey Clark I thought f(w) should only be a function of w, but unfortunately the symbolic engine doesn't seem able to do the CTFT completely. See Paul's response below and my comment to him, which is really the crux of my problem.

Sign in to comment.

 Accepted Answer

Using some examle data ...
A = 1:5;
std_A = 11:15;
syms t w real
f(t) = sum(exp(-t./A))*heaviside(t)
f(t) = 
std_ft(t) = sqrt(sum((abs(t).*exp(-t.*A)*heaviside(t)+dirac(t)).*std_A).^2)
std_ft(t) = 
FWIW, there is no need to use abs(t) here because each is multiplied by heaviside(t).
Anyway, I doubt the signal std_ft(t) has a closed form expression for its Fourier Transform, assuming its Fourier Transform exists.
fourier(std_ft(t),t,w)
ans = 
Certainly Matlab can't find one, so it just resturns an answer in terms of fourier().

6 Comments

@Paul Thanks. Am I making this harder than it needs to be? Is there a more straightforward way of propagating the error in f(t) thru the Fourier transform?
I don't know what you mean by "propagating the error in f(t)" so I can't really say anything on that topic.
@Paul Sorry if I was unclear: there's error associated with each element in A. That leads to error associated with f(t). I was trying to figure out how that leads to error in f(w). That was the whole point of trying to do the complicated error propagation formula.
I might still not be understanding. But maybe you can use a Taylor series expansion?
syms t tau A w real
assumeAlso(tau,'positive');
assumeAlso(A,'positive')
f(t) = exp(-t/tau)*heaviside(t);
Tf(t) = taylor(f(t),tau,A,'Order',2) % seconnd order Taylor expansion around tau = A
Tf(t) = 
T(w) = fourier(Tf(t),t,w)
T(w) = 
The term A - tau is the peturbation in tau from its nominal value A
syms dtau real
T(w) = subs(T(w),A - tau,-dtau)
T(w) = 
The first term is just the Fourier transform of f(t) with tau = A
fourier(subs(f(t),tau,A),t,w)
ans = 
Maybe the "error" in the Fourier Transform due to the perturbation in tau from its nominal value A is
E(w) = T(w) - fourier(subs(f(t),tau,A),t,w)
E(w) = 
Disclaimer: I'm not really sure how to interpret this result as I've never thought of this problem. I guess E(w) is a an approximation to the difference between the FT of f(t) as computed and as expected? Presumably one could also use a higher order Taylor series. .
Thanks @Paul. This is interesting. I'll think about this. Really appreciate your help.
Actually, I guess I should have at least run a simple test to see if it works:
syms t w real
A = 1; dtau = 0.1;
f(t) = exp(-t/(A + dtau))*heaviside(t);
F(w) = fourier(f(t),t,w);
f0(t) = exp(-t/A)*heaviside(t);
F0(w) = fourier(f0(t),t,w);
dF(w) = dtau/A^2/(1/A + 1i*w)^2;
figure;
fplot(abs([F(w) , F0(w) , dF(w) , F0(w)+dF(w)]))
legend('F', 'F0', 'dF' , 'F0 + dF')
figure;
fplot(angle([F(w) , F0(w) , dF(w) , F0(w)+dF(w)]))
legend('F', 'F0', 'dF' , 'F0 + dF')

Sign in to comment.

More Answers (0)

Products

Release

R2021b

Asked:

on 11 Jul 2022

Commented:

on 11 Jul 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!