Skip to main content
73 votes

How can I draw a Homer with epicycloids?

The main challenge to make something general is to create a list of points that, when joined, is as close as possible to the original image. The first example (elephant) focuses on the mathematical ...
anderstood's user avatar
  • 14.3k
53 votes
Accepted

How to use 2D Fourier analysis to clean the noise in an image

Here's what I did back in pre-MMA6 times. I believe you can easily adapt this method to work with all the fancy commands that have been added since then. Someone proficient in CDF programming could ...
Peltio's user avatar
  • 5,506
19 votes

What's the correct way to shift zero frequency to the center of a Fourier Transform?

I am writing this answer to put on record how to do the equivalent of fftshift() in MATLAB, for both the one- and two-dimensional cases. In Mathematica, the ...
J. M.'s missing motivation's user avatar
19 votes

Calculate the 2D Fourier transform of an Image

Taking the Fourier transform is easy and fun! Let's strip away some of the complexities. First, remove the color from the image, since this just complicates things (you can always take the transform ...
bill s's user avatar
  • 69.1k
19 votes

Circular Aperture Diffraction Pattern

Physicist chiming in - Hi!. I believe there has been some confusion here. It seems to me that OP is meaning to plot an Airy disk which was studied by G.B. Airy but is not given by the Airy function. ...
AccidentalFourierTransform's user avatar
18 votes

A more convenient Fourier series

For the reasons mentioned above, I wrote the following "shell" for these functions: ...
xzczd's user avatar
  • 66.7k
17 votes

How can I use fast Fourier transform (FFT) to solve a PDE (heat equation)?

There are three mistakes here, mainly related to FFT. First, you misunderstood the meaning of fftshift in the MATLAB code. It's not ...
xzczd's user avatar
  • 66.7k
16 votes

Find the function $f(x)$ by using its fourier expansion

Note that the expression returned by Sum is correct and equals $x(1-x)$ for $0 \leq x \leq 1$. I assume your question is how to simplify the expression into $x(1-x)$...
Greg Hurst's user avatar
  • 36.2k
16 votes
Accepted

How fast is my fidget spinner spinning? A sound experiment!

First, import the audio and extract usable data from it: ...
Miladiouss's user avatar
  • 1,883
14 votes

Implement finite Fourier transforms

This post contains several code blocks, you can copy them easily with the help of importCode. The following is my implementation for finite Fourier transforms. ...
xzczd's user avatar
  • 66.7k
14 votes
Accepted

How to set up a spherically symmetric Fourier transform?

Summary: To perform the 3D Fourier Transform of a spherically symmetric function $f(r)$ in Mathematica, use the command (4 Pi)/k FourierSinTransform[f[r] r, r, k] ...
Michael Seifert's user avatar
13 votes

Package for fast spherical harmonic transform in Mathematica?

I am aware that my answer would not be accepted because OP explicitly demanded a FFT-like method. I am aware of the fact that the method is not very fast either. However, it is so simple that I do ...
yarchik's user avatar
  • 18.6k
12 votes

Circular Aperture Diffraction Pattern

I feel a bit bad about sliding in so lately. @Nasser's answer was already very good. However, the function is very oscillatory, so I thought it might be a better idea to use a ...
Henrik Schumacher's user avatar
12 votes
Accepted

Why does Fourier give me a different picture than ImagePeriodogram?

There are two differences between ImagePeriodogram and Fourier. One you have already identified (ImagePeriodogram takes the Log of the Fourier spectrum). Second, the periodogram is shifted so that ...
bill s's user avatar
  • 69.1k
12 votes
Accepted

Why does this Fourier transform not match the formula?

I think the confusion is between frequency in cycles per second or Hz and frequency in radians per second. In the page you link to the frequency is in Hz. Thus to match this convention the ...
Hugh's user avatar
  • 16.5k
11 votes

Fourier transform of interpolating function

Starting with your equations we get ...
Hugh's user avatar
  • 16.5k
11 votes
Accepted

finding Frequency of Sinewave data using Fourier

Have a look at my post on using Fourier here you will see that the frequency axis has an increment of the sample rate divided by the number of points and goes from zero to one less than the sample ...
Hugh's user avatar
  • 16.5k
11 votes
Accepted

Comparing ordinates between FourierTransform and Fourier

Several points are raised by this question. The key issue to understand is how FourierTransform and Fourier are scaled. A second ...
Hugh's user avatar
  • 16.5k
11 votes

Fourier Transform With Noise

It depends how we define "noise". Suppose the noise comes from the Alternative Current (AC) of a device placed near the recorder of the signal. Then the noise is going to be a high frequency sinusoid. ...
Anton Antonov's user avatar
11 votes
Accepted

Does version 11 have this bug in FourierSeries?

This is a bug in FourierSeries, and appears to be caused by the default setting GenerateConditions -> False which is used ...
Devendra Kapadia's user avatar
11 votes
Accepted

Demonstration of Fourier Series: Selectable Target Function, Selectable Number of Coefficients, Scrolling Graph

...
kglr's user avatar
  • 396k
10 votes
Accepted

Fourier in Mathematica different from octave

Read the docs for Fourier. There are different conventions, and Mathematica lets you choose which convention you want using the ...
bill s's user avatar
  • 69.1k
10 votes
Accepted

Using Fourier Series to acquire Nonlinear ODE Periodic Solutions

Direct solution of the last equation in the question also is feasible, because the Fourier series converges very rapidly. as will be seen below. The equation for a three term expansion can be written ...
bbgodfrey's user avatar
  • 61.6k
10 votes
Accepted

Discrepancy between Matlab and Mathematica Fourier parameters

From the documentation, Mathematica defaults to defining y = Fourier[x] as: $$ y_k = \frac1{\sqrt{n}} \sum_{j=1}^n x_j e^{2 \pi i (j-1) (k-1)/n} $$ From the ...
user3047059's user avatar
10 votes
Accepted

Indeterminate result from Sinc

You've avoided Sin[0]/0 problems, but your numerator and denominator in your more complicated expression are still both zero in some cases. One way is to take a ...
John Doty's user avatar
  • 13.7k
10 votes

Fourier Transform to help guess with NonLinearModelFit

I am guessing that you are trying to fit the data to a sum of sinusoids, and use frequency analysis to provide guesses for the parameters. Here is one approach using Periodogram: ...
David Keith's user avatar
  • 4,604
10 votes
Accepted

Strange result of FourierCosCoefficient on $\cos^2 t$

@user64494 is correct that the result arises because some of Mathematica's solvers return results that are only generically correct (that is, incorrect only for finitely many exceptions or on a ...
Michael E2's user avatar
  • 236k
10 votes
Accepted

How to visualize overtones in Mathematica?

You can use Manipulate with an IntervalSlider to look at the different harmonics. ...
Bob Hanlon's user avatar
  • 159k
10 votes

What's wrong with this FFT-based Von Kármán vortex street simulation?

I found the index should start from 0 instead of 1. This affects the (squared) wave number k....
rnotlnglgq's user avatar
  • 3,740
10 votes
Accepted

Convert MATLAB code solving 1D wave equation via FFT using ode45 into Mathematica code

but I can't get the correct resultā€¦ I'd argue it's mainly caused by careless mistakeā€¦ Anyway, we don't have much post solving PDE via FFT (Is this the only one?), so let me do a favor. 2 issues here: ...
xzczd's user avatar
  • 66.7k

Only top scored, non community-wiki answers of a minimum length are eligible