Skip to content
DeepForgeby svx
All problems
EasyCalculusca-150

Fourier Transform of Gaussian

Problem

The Fourier transform of the Gaussian e^(-a*x^2) is sqrt(pi/a) * e^(-omega^2/(4a)).

Since the transform is real and positive, its magnitude equals its value. Given a > 0 and the angular frequency omega, return that magnitude.

Hint

A Gaussian transforms to a Gaussian: wider in x means narrower in frequency.

Test cases

case 1
in: [1,0]
expected: 1.7724538509055159
case 2
in: [1,1]
expected: 1.380388447043143
case 3
in: [4,0]
expected: 0.8862269254527579
case 4
in: [0.25,2]
expected: 0.06492724936026344
Starter codePython
def gaussian_ft_magnitude(a, omega):
    # Your code here
    pass

4 test cases · run your code against them in the editor