# shz_fft

Source: https://sh4zam.com/api/complex/shz_fft/

```c
SHZ_INLINE void shz_fft(shz_complex_t* s, size_t size) SHZ_NOEXCEPT;
```

Fast Fourier Transform.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `s` | `shz_complex_t *` |  |
| `size` | `size_t` |  |

## Returns

Nothing (`void`).

## Details

Applies a fast fourier transform to convert the complex array of samples, `s`, of the given `size`, from the time to the frequency domain. The conversion is done in-place.

## Notes

- The underlying implementation uses the Radix2 variant of the Cooley-Tukey FFT algorithm, using an XMTRX-accelerated 2 point butterfly DIF.

## Warnings

- `size` must be a power-of-two!
- `s` must be aligned to 8-byte boundaries!
- This routine clobbers `XMTRX`!

## Availability

- **C++ equivalent:** [`shz::fft`](https://sh4zam.com/api/cpp/#shzfft)
- **Type-generic form:** none
- **Back-ends:** SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- **Defined in:** [`sh4zam/shz_complex.h:255`](https://github.com/gyrovorbis/sh4zam/blob/ba1e30c88d49df0311870b229e1dd860ef26c477/include/sh4zam/shz_complex.h#L255)
- **Module:** [Complex](https://sh4zam.com/api/complex/), section "Signal Processing"
