# I FFT gives unexpected data

1. Jan 29, 2017

### GhostLoveScore

I am trying to do Fast Fourier Transform on some data recorded from RTL SDR. I managed to write a program that does that, but the problem is this. This is final result as it should look

And this is my result

It may be hard to understand this, I'll try to explain. My graph is done using 5000 samples. At upper graph, see that vertical line at around 99.4 MHz? That's the same line as at 3500 at lower graph. And if you look closely at lower graph, you can see that it really should be cut vertically at 2500 and left and right side switched.

I understand that when doing Fourier Analysis using N samples, as a result we get N frequency bins. And the result looks like this

1,2,3,4,5,6....N/2,N/2.....6,5,4,3,2,1

So in a way I understand why I need to have right and left half of my graph switched. The result would look like this

N/2,..., 6,5,4,3,2,1,0,1,2,3,4,5,6,...,N/2

And the graph looks like this

What I don't understand is why the bins N/2 - N are not mirror image of bins 0 - N/2. And what I am doing here, switching bins N/2 - N to the left and bins 0 - N/2 to the right is the correct way to do this?
I forgot to say that data that I used for input was complex data.

Last edited: Jan 29, 2017
2. Jan 29, 2017

### mathman

It would clarify it a little if you labelled the coordinates on your graph.

3. Jan 29, 2017

### GhostLoveScore

As I said, I used 5000 samples so I got 5000 frequency bins. That's what is on X axis. Amplitude is on Y axis.

4. Jan 29, 2017

### Dr Transport

what are the frequencies...

5. Jan 29, 2017

### GhostLoveScore

Sorry, I didn't write frequency on the graph, just the bin number. I'll try to explain - signal bandwidth is 2.4MHz and center frequency is 100.122 MHz.

For my first graph that means 0 = 100.122MHz, 2500 = 98.9MHz/101.3MHz, 5000 = 100.122

For my second graph 0=98.9MHz, 2500 = 100.122MHz, 5000 = 101.3MHz

You will notice how there is a split at 2500. I didn't know exactly if 2500 = 98.9MHz 2501=101.3MHz or 2499=98.9MHz 2500= 101.3MHz so I wrote it like that.

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted