{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.transform.dft.agent.input.json",
  "title": "Discrete Fourier transform — agent input",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "samples"
  ],
  "properties": {
    "mode": {
      "type": "string",
      "enum": [
        "dft",
        "idft",
        "fft",
        "ifft"
      ]
    },
    "samples": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 16384
        },
        {
          "type": "array",
          "minItems": 1,
          "maxItems": 64,
          "items": {
            "anyOf": [
              {
                "type": [
                  "number",
                  "string"
                ],
                "pattern": "^[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?$",
                "maxLength": 400
              },
              {
                "type": "array",
                "minItems": 1,
                "maxItems": 2,
                "items": {
                  "type": [
                    "number",
                    "string"
                  ],
                  "pattern": "^[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?$",
                  "maxLength": 400
                }
              },
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "re": {
                    "type": [
                      "number",
                      "string"
                    ],
                    "pattern": "^[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?$",
                    "maxLength": 400
                  },
                  "x": {
                    "type": [
                      "number",
                      "string"
                    ],
                    "pattern": "^[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?$",
                    "maxLength": 400
                  },
                  "real": {
                    "type": [
                      "number",
                      "string"
                    ],
                    "pattern": "^[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?$",
                    "maxLength": 400
                  },
                  "im": {
                    "type": [
                      "number",
                      "string"
                    ],
                    "pattern": "^[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?$",
                    "maxLength": 400
                  },
                  "imag": {
                    "type": [
                      "number",
                      "string"
                    ],
                    "pattern": "^[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?$",
                    "maxLength": 400
                  }
                },
                "anyOf": [
                  {
                    "required": [
                      "re"
                    ]
                  },
                  {
                    "required": [
                      "x"
                    ]
                  },
                  {
                    "required": [
                      "real"
                    ]
                  }
                ]
              }
            ]
          }
        }
      ]
    },
    "im": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 16384
        },
        {
          "type": "array",
          "minItems": 1,
          "maxItems": 64,
          "items": {
            "type": [
              "number",
              "string"
            ],
            "pattern": "^[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?$",
            "maxLength": 400
          }
        }
      ]
    }
  },
  "description": "Use samples and optional im; N1–64, FFT/IFFT power-of-two length; backward normalization; real/complex decimal input. Underflow text and conflicting forms are rejected. Output components may be unreliable relatively near cancellation zeros; compare spectrum-scaled errors. (calculation_version 1.2.3)"
}
