{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When the DFT is computed for purely real input, the output is Hermitian-symmetric, i.e. the negative frequency terms are just the complex conjugates of the corresponding positive-frequency terms, and the negative-frequency terms are therefore redundant.  This function does not compute the negative frequency terms, and the length of the transformed axis of the output is therefore "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "n//2 + 1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "When "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "A = rfft(a)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and fs is the sampling frequency, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "A[0]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " contains the zero-frequency term 0*fs, which is real due to Hermitian symmetry."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is even, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "A[-1]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " contains the term representing both positive and negative Nyquist frequency (+fs/2 and -fs/2), and must also be purely real. If "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "n"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is odd, there is no term at fs/2; "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "A[-1]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " contains the largest positive frequency (fs/2*(n-1)/n), and is complex in the general case."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If the input "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " contains an imaginary part, it is silently discarded."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "",
              "annotation": "IndexError",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "axis"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is not a valid axis of "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "a"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "out",
              "annotation": "complex ndarray",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The truncated or zero-padded input, transformed along the axis indicated by "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "axis"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", or the last one if "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "axis"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is not specified. If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "n"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is even, the length of the transformed axis is "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "(n/2)+1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "n"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is odd, the length is "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "(n+1)/2"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Compute the one-dimensional discrete Fourier Transform for real input."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "a",
              "annotation": "array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Input array"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "n",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Number of points along transformation axis in the input to use. If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "n"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is smaller than the length of the input, the input is cropped. If it is larger, the input is padded with zeros. If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "n"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is not given, the length of the input along the axis specified by "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "axis"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is used."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "axis",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Axis over which to compute the FFT. If not given, the last axis is used."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "norm",
              "annotation": "{\"backward\", \"ortho\", \"forward\"}, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Normalization mode (see "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "numpy.fft",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "numpy.fft"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "). Default is \"backward\". Indicates which direction of the forward/backward pair of transforms is scaled and with what normalization factor."
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionadded",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionadded 1.20.0"
                        }
                      ]
                    },
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "The \"backward\", \"forward\" values were added."
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "out",
              "annotation": "complex ndarray, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If provided, the result will be placed in this array. It should be of the appropriate shape and dtype."
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionadded",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionadded 2.0.0"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This function computes the one-dimensional "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "n"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "-point discrete Fourier Transform (DFT) of a real-valued array by means of an efficient algorithm called the Fast Fourier Transform (FFT)."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/numpy/fft/_pocketfft.py",
  "item_line": 324,
  "item_type": "_ArrayFunctionDispatcher",
  "aliases": [
    "numpy.fft.rfft"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.fft.fft([0, 1, 0, 0])\nnp.fft.rfft([0, 1, 0, 0])\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nNotice how the final element of the `fft` output is the complex conjugate\nof the second element, for real input. For `rfft`, this symmetry is\nexploited to compute only the non-negative frequency terms."
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "fft",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "numpy.fft"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The one-dimensional FFT of general (complex) input."
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "fftn",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "numpy.fft:fftn"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "n"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "-dimensional FFT."
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "irfft",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "numpy.fft:irfft"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The inverse of "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "rfft",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "numpy.fft",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "numpy.fft"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For definition of the DFT and conventions used."
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "rfftn",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "numpy.fft:rfftn"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "n"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "-dimensional FFT of real input."
            }
          ]
        }
      ],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "a",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "n",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "axis",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "-1"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "norm",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "out",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "rfft"
  },
  "references": null,
  "qa": "numpy.fft:rfft",
  "arbitrary": [],
  "local_refs": [
    "a",
    "axis",
    "n",
    "norm",
    "out"
  ]
}