# How to do this unusual Fourier transform?

2 views (last 30 days)

Show older comments

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 Comments

Star Strider
on 25 Aug 2023

### Answers (1)

Walter Roberson
on 25 Aug 2023

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 Comments

Walter Roberson
on 25 Aug 2023

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';

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!