# fft() Function & Examples

Use the fft() matrix function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## fft

#### fft(x)

Try it yourself:

```calculio
fft([[1, 0], [1, 0]])
```

[ifft](https://calcul.io/function/ifft/index.md)

---

## Analyze frequency content with fft

**fft(x)** computes the fast Fourier transform of a sequence. It converts samples from a time or index domain into complex frequency coefficients, revealing periodic components efficiently.

## Reading a transform

A strong coefficient indicates energy near its corresponding frequency. The output is generally complex, so use [abs](https://calcul.io/function/abs/index.md) for magnitude and [arg](https://calcul.io/function/arg/index.md) for phase. [ifft](https://calcul.io/function/ifft/index.md) reverses the transform and should reconstruct the original sequence up to rounding error.

## Practical preparation

Sample spacing determines the physical frequency scale; fft alone does not know whether samples are seconds, milliseconds, or pixels. Remove a large offset when it obscures smaller oscillations, and use [mean](https://calcul.io/function/mean/index.md) to find that offset. For filter frequency response rather than a transform of samples, see [freqz](https://calcul.io/function/freqz/index.md).

## Caveats

Finite records can cause spectral leakage, and the highest measurable frequency is limited by sampling rate. Complex output and ordering conventions matter when interpreting bins. Use matching sequence lengths and do not mistake the transform magnitude for an automatically normalized amplitude.

[All functions](https://calcul.io/functions/index.md)
