Ask Your Question

backchodmaster's profile - activity

2020-07-02 19:31:14 +0200 received badge  Editor (source)
2020-07-02 10:23:55 +0200 answered a question Find and plot the Fourier transform of the Ricker wavelet

I will show you how to calculate fourier transform in sage. I am assuming you have theoretical knowledge of the thing.

i will calculate the fourier transform of a sin wave of the form sin(2πft)

code begins from here: f= frequency,t=time

from sage.symbolic.integration.integral import indefinite_integral

amplitude = 1.0

phase = 0.0

Input(f,t) = amplitudesin(2pift + phase)


Input_fourier(f,t) = indefinite_integral(exp(-2piItf)*Input(f,t),t) show(Input(f,t)) show(Input_fourier)

The output shall be the fourier transform


plot(norm(Input_fourier(f,2)),f,0,10000,gridlines = True,)

This will give u the plot

norm means the modulus of the complex function.