# Difference between revisions of "FFT"

This block takes in a vector of floats or complex values and calculates the FFT. If all you do is want to see the frequency domain of a signal, the QT GUI Frequency Sink is more user friendly.

Note that even if the input signal is real, the output will be complex, so you must use a Complex to Mag or similar block if you want to see magnitude.

## Parameters

FFT Size
Number of samples used in each FFT calculation, which also determines how many points are in the output.
Forward/Reverse
Whether to do an FFT or IFFT.
Window
Type of window to apply to each set of samples before the FFT is taken, default is a blackmanharris window. The argument of the window.blackmanharris() function is simply how many points in the window, which must match the FFT size. If an empty window "[]" is supplied then no windowing math is performed.
Shift
Whether or not to do an "fft shift" which puts DC (0 Hz) in the center. If you are not sure what this means, leave it set to Yes. Only active when input type is complex.
Number of threads to assign to perform the FFTs.

## Example Flowgraph

This flowgraph shows how the FFT block can be used to reproduce the behavior of the QT GUI Frequency Sink block. Both outputs match (besides an arbitrary scaling factor), but using the FFT block directly requires converting from a stream to vector, and performing the magnitude and log manually.

C++ files
Complex input
Real input
Core algorithms
{"ft_lang_label":"__label__en","ft_lang_prob":0.84885347,"math_prob":0.87761027,"size":2667,"snap":"2021-43-2021-49","text_gpt3_token_len":643,"char_repetition_ratio":0.11791213,"word_repetition_ratio":0.49799198,"special_character_ratio":0.24109486,"punctuation_ratio":0.10396975,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97034633,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-12-01T13:01:19Z\",\"WARC-Record-ID\":\"<urn:uuid:41bbf9e0-f7e0-4909-940e-0b0e32d1f0ec>\",\"Content-Length\":\"23290\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f0ecfa3d-105c-4ddf-94d3-0e8ead7ae3e1>\",\"WARC-Concurrent-To\":\"<urn:uuid:f3992004-fa67-4bf7-aca6-c6aeaeabd21f>\",\"WARC-IP-Address\":\"140.211.167.19\",\"WARC-Target-URI\":\"https://wiki.gnuradio.org/index.php?title=FFT&diff=prev&oldid=8225\",\"WARC-Payload-Digest\":\"sha1:TFVFKABTYWIZYE2CB72NZVUPL7EOQJ24\",\"WARC-Block-Digest\":\"sha1:P5WELTFL337UV3D4SI6LAVENIBZH57I6\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964360803.0_warc_CC-MAIN-20211201113241-20211201143241-00491.warc.gz\"}"}