0
$\begingroup$

I'm working with the FFT, and I've found that it output certain frequencies, but not all. If I input a 440Hz sine wave with 4096 samples, there is no 440Hz response, but instead it's distributed among a few frequencies, like:

... 421.875Hz: (mag: 0.207764, phase: 0.140608), 433.594Hz: (mag: 0.580138, phase: 0.144488), 445.313Hz: (mag: 0.690567, phase: -2.99323), 457.031Hz: (mag: 0.212671, phase: -2.98935), ... 

Since the FFT is a lossless transformation, it appears that you can represent a sine wave as the sum of multiple sine waves of different frequencies and phases. I don't know the formula for this transformation, however, and I'm not sure how it works (I haven't experienced playing multiple different notes and having them end up as a totally different note, but that doesn't mean it's impossible).

$\endgroup$
2
  • $\begingroup$ How many such experiments did you do? Did you try some very examples first? Such as 2Hz, 4Hz, and so on. $\endgroup$ Commented Oct 14, 2020 at 2:04
  • $\begingroup$ I did one personally and then checked for other FFT results online and found my results were typical. $\endgroup$ Commented Oct 15, 2020 at 19:27

2 Answers 2

2
$\begingroup$

For continuous sine wave the answer is no. For limited discrete sinusoids see below.

First, this question might be more appropriate for DSP Stack Exchange as you are talking about the subtilties of FFT.

Also be careful of how you interpret FFT outputs. FFT produces ideal outputs only when the input is a discrete complex sinusoid whose frequency is identical to one of the frequency bins.

We're talking about limited discrete complex sinusoidals here not continuous sine waves like $\cos(2\pi ft)$. The former is about a discrete basis for discrete signals of length $N$ but the latter is about the continuous Fourier transform.

Now, how these two are related can be found in Discrete-time Signal Processing by Oppenheim for example and I won't get into it.

But, as long as FFTs are concerned, know that they express a (discrete) vector of length $N$ using a linear combination of the discrete complex sinusoids that build the basis. So if your input isn't exactly one of them, then a bunch of them will work together to build your input signal. That's why you see more than one nonzero bin in the output.

For the continuous sine waves we always have $\int_{0}^{2k\pi}\sin(f_1t)\sin(f_2t) = 0$ whenever $f_1 \ne f_2$. This means that you cannot decompose a continuous sine wave using sine waves of other frequencies.

Keep experimenting with FFT - it's fun - but beware of the math behind!

$\endgroup$
2
$\begingroup$

Some preamble first:

If you are dealing with the FFT (well, the DFT, the fast part is not relevant here) then there are no $\sin$ waves as such, just discrete versions thereof.

The DFT is a way of representing a function $f: \{0,...,N-1\} \to \mathbb{C}$.

Think of it as a change of basis (because it is).

One basis is the collection of functions $b_k(j) = \delta_{jk}$ where $j,k \in 0,...N-1$. Then we can write $f = \sum_k f(k) b_k$. The function $f$ is clearly equivalent to the $N$ vector $(f(0),...,f(N-1))$ in the basis $b_0,...,b_{n-1}$.

The other basis is $e_k(j) = e^{ijk {2 \pi \over N}}$, where $j,k \in 0,...N-1$ (this needs to be proved!).

If we represent $(f(0),...,f(N-1))$ in the basis $e_1,...,e_{N-1}$, we get another $N$ vector $(\hat{f}(0),...\hat{f}(N-1))$, and we call $\hat{f}$ the DFT of $f$.

To answer your question:

Suppose your input is of the form $f(j) = e^{ij\alpha}$ (a $\sin$ wave is just a linear combination of these).

Then we see that any such function $f$ (for any $\alpha$) can be represented by some $(\hat{f}(0),...\hat{f}(N-1))$, so in this sense you can represent any $\sin$ wave as the sum of $\sin$s at the discrete frequencies.

Furthermore, it should be clear that the DFT of the function $f$ has exactly one non zero component iff $\alpha$ is of the form $k {2 \pi \over N}$ for some $k$. If $\alpha$ does not lie on this lattice, then the DFT must contain non zero components at more than one 'frequency'.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.