How to do this unusual Fourier transform?
Mostrar comentarios más antiguos
I am trying to compute a sine transform:
I'm not sure about the non-standard bound of the integral (why it's not infinity???).
Anyway, let's say f_t = rand(40,1). Then,
N = 1000;
omega = logspace(-2,2,N);
for ii = 1:N
f_omega{ii} = omega(ii).*integral(@(t) f_t.*sin(omega(ii).*t),0,2*pi./omega(ii),'ArrayValued',true);
end
gives a vector of length 40 for each omega, which doesn't seem right to me. I should have just a vector of length N at the end. How do I do this integral? And should it matter what range in t I choose for f(t)?
3 comentarios
The result looks strange —
syms omega t
sympref('AbbreviateOutput',false);
f(t) = cos(5*pi*t)
f(omega) = omega * int(f(t) * sin(omega*t), t, 0, 2*pi/omega);
f = simplify(f, 500)
figure
fplot(f,[0.01 1000])
grid
Ax = gca;
Ax.XScale = 'log';
.
L'O.G.
el 25 de Ag. de 2023
Star Strider
el 25 de Ag. de 2023
I could not get it to work numerically, even using the non-random sine function for ‘f_t’ so that I could be certain that it had a non-random result. I did the symbolic calculation and plot to see what the correct result would be (sort of like looking in the back of the book to see what the correct answer is).
Respuestas (1)
Walter Roberson
el 25 de Ag. de 2023
0 votos
Anyway, let's say f_t = rand(40,1).
Let's not say that.
f is a function of t. By saying that f_t = rand(40,1) you are saying that f is constant in t, and is a 40-dimensional (constant) point. When you integrate that, of course you are going to end up with a 40-dimensional result.
5 comentarios
Walter Roberson
el 25 de Ag. de 2023
Could you confirm that the f on the left side of your equation is the same f on the right side of your equation? You talk about a sine transform, and "transforms" are suitable for application to classes of functions, but if you have the same f on both sides of the equation you are going to be restricting yourself to a rather narrow set of functions in a way that would never be called a "transform".
@Star Strider chose f(t) = cos(5*pi*t) and since I do not see any reference to that in your discussion, I gather that he choose an arbitrary function to attempt to transform? That would be more in keeping with it being considered a "transform" -- but there is the possibility that particular function does not happen to be one of the ones that the transform is valid for.
Star Strider
el 25 de Ag. de 2023
I considered
to be the result of that transform, although the usual representation would be
(upper case) denoting the transformed function.
I chose
arbitrarily in order to see what the result was (in both the numeric and symbolic calculations). Transforming a random vector (such as the one defining the original ‘f_t’) would simply produce noise, and that would not be sufficiently informative to determine whether the numeric function worked correctly.
Using that notation, but with the same functionality as Star Strider already posted:
syms f(t) G(omega) varepsilon_0 e_1
Pi = sym(pi);
sympref('AbbreviateOutput',false);
f(t) = cos(5*Pi*t)
G(omega) = omega/(varepsilon_0 * Pi) * int((f(t)*e_1) * sin(omega*t), t, 0, 2*Pi/omega);
G = simplify(G, 500)
G_representative = subs(G, {e_1, varepsilon_0}, {1,1})
figure
fplot(G_representative,[0.01 1000])
grid
Ax = gca;
Ax.XScale = 'log';
Categorías
Más información sobre Numbers and Precision en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




