Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fourier decomposition doesn't work with a constant function #18

Open
VictorLamoine opened this issue Jul 6, 2019 · 3 comments
Open

Comments

@VictorLamoine
Copy link

If you draw a perfectly constant function the decomposition doesn't work:
image

@JoniRousu
Copy link
Contributor

From my academic background (electrical engineering student) I can say that a fourier transformation of a constant doesn't exist in the real world. The result would be a so called dirac delta function (https://en.m.wikipedia.org/wiki/Dirac_delta_function).
But it would be nice to indicate that.

@Jezzamonn
Copy link
Owner

I guess it depends on what context you're talking about, but in some contexts you definitely can do a fourier transform of a constant! One of the terms will be the constant term, essentially with a frequency of zero.

This is more due to the implementation though, but there's maybe two reasons why you can't see it on the page:
The first is because to make it visually simpler, as well as keep the page running smoothly, it doesn't draw sine waves that are very small (and 0 is as small as you can get).
I guess the second thing is I might also be filtering out the constant term anyway because it's kind of different to represent it. If you see a line by itself it's hard to tell how far away that line is from zero without having a line at zero. Same with the circles, I don't draw the constant term there, I just zero it out (also to keep the image balanced in the middle).

But there's not really a good reason not to show it, particularly for that case. I'll see if I can get some time to adjust it

@JoniRousu
Copy link
Contributor

I guess it depends on what context you're talking about, but in some contexts you definitely can do a fourier transform of a constant! One of the terms will be the constant term, essentially with a frequency of zero.

I was talking about time constant functions. As I said, a fourier transform is possible. The solution is a dirac function with the value of the constant as "weight". The problem is that the width is infinitely small and thus the only frequency is 0. That's what I meant with "doesn't exist in the real world".
If you take a look at the Wikipedia page, you will find a schematic representation of a dirac function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants