# Splitting a vector at the output of the FFT

**URL:** <https://www.ruby-forum.com/t/splitting-a-vector-at-the-output-of-the-fft/234630>\
**Category:** GNU Radio\
**Created:** [March 18, 2015, 4:32pm UTC](https://www.ruby-forum.com/t/splitting-a-vector-at-the-output-of-the-fft/234630 "2015-03-18T16:32:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [March 18, 2015, 4:32pm UTC](https://www.ruby-forum.com/t/splitting-a-vector-at-the-output-of-the-fft/234630/1 "2015-03-18T16:32:46Z")

</div>

Hello GNUR’s!

I am a newbie in this community so I may pose a very simple question…  
I am trying to split via GUI the output vector of the FFT block in two  
halves, one with the upper part and one with the lower part -i.e. I  
don’t want a duplicate of the output vector-. Say I have a FFT of 1024  
points, how do I split the output into the first 512 points and the  
final 512 points? This leads me to the related question of how is the  
FFT implemented: is the DC component coming first and then the positive  
part of the spectrum with fftSize/2 samples to be finally followed by  
fftSize/2-1 of the negative part? Or is it some other way? Moreover, is  
it normalized by the number of points?

Thank you very much.

Cheers!

---

<div class="post-metadata">

**Author:** ![Alejandro\_Pascual\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3d9bf3/32.png) [@Alejandro\_Pascual\_L](https://www.ruby-forum.com/u/Alejandro_Pascual_L)\
**Post date:** [March 18, 2015, 4:54pm UTC](https://www.ruby-forum.com/t/splitting-a-vector-at-the-output-of-the-fft/234630/2 "2015-03-18T16:54:55Z")

</div>

Hi Alejandro,

are you sure you want to use the FFT sinks?  
They basically “just” internally put the sample stream into vectors of  
fftlen length, then calculate the dB(abs(fft(these vectors))), and  
display the result.  
What you’re describing sounds more like you’d want to use the  
standalone, not-graphical-sink FFT block.

The FFT is defined as most of the time in DSP: each bin corresponds to a  
specific exponent in the complex exponential function, ie.  
e^(j_n\_bin_omega); compare [1].

Greetings,  
Marcus

[1]

> **[The 1d Discrete Fourier Transform (DFT) (FFTW 3.3.10)](http://www.fftw.org/doc/The-1d-Discrete-Fourier-Transform-_0028DFT_0029.html#The-1d-Discrete-Fourier-Transform-_0028DFT_0029)**
>
> The 1d Discrete Fourier Transform (DFT) (FFTW 3.3.10)

---

<div class="post-metadata">

**Author:** ![Alejandro\_Pascual\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3d9bf3/32.png) [@Alejandro\_Pascual\_L](https://www.ruby-forum.com/u/Alejandro_Pascual_L)\
**Post date:** [March 20, 2015, 4:12pm UTC](https://www.ruby-forum.com/t/splitting-a-vector-at-the-output-of-the-fft/234630/3 "2015-03-20T16:12:06Z")

</div>

Thanks for the quick reply!

When I said splitting in the GUI I meant using the flowgraph (instead of  
digging into the code) not using the sink FFT. As you say, I am using  
the standalone block for the FFT and I want to split its output. Is  
there any block to do so or any kind of snippet of code to add in the  
fields of the parameters of the subsequent blocks?

Regarding the FFT output now it is much more clear having the actual  
implementation info. However, prior to this conversation I remember I  
used at the output of the FFT block a vector sink and, interestingly  
enough, I saw for a constant source a bin in the middle of the plot (at  
index fftSize/2) and when using a cosine with a certain frequency, the  
spectrum shifted right but nothing showed up in the “negative”  
frequencies. I’ll take a look at it again.

Again, thank you for your time.

Regards,  
Alejandro

---

<div class="post-metadata">

**Author:** ![Alejandro\_Pascual\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3d9bf3/32.png) [@Alejandro\_Pascual\_L](https://www.ruby-forum.com/u/Alejandro_Pascual_L)\
**Post date:** [March 21, 2015, 4:34pm UTC](https://www.ruby-forum.com/t/splitting-a-vector-at-the-output-of-the-fft/234630/4 "2015-03-21T16:34:21Z")

</div>

Hello again,

I still couldn’t figure out how to find a way to split a vector in the  
flowgraph (instead of digging into the code).  
I am using the standalone block for the FFT and I want to split its  
output in halves, meaning at the output of a FFT sized fftSize I want a  
vector (size fftSize/2) with the upper half and a vector (size  
fftSize/2) with the lower half.  
Is there any block to do so or any kind of snippet of code to add in the  
fields of the parameters of the subsequent blocks?

Thank you and best regards,  
Alejandro

---

<div class="post-metadata">

**Author:** ![Alejandro\_Pascual\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3d9bf3/32.png) [@Alejandro\_Pascual\_L](https://www.ruby-forum.com/u/Alejandro_Pascual_L)\
**Post date:** [March 21, 2015, 5:06pm UTC](https://www.ruby-forum.com/t/splitting-a-vector-at-the-output-of-the-fft/234630/5 "2015-03-21T17:06:19Z")

</div>

Hi Alejandro,

what about vector to stream, and a deinterleave with block size =  
fftlen/2 ?

Greetings  
Marcus
