# Precise use of FFTW

**URL:** https://discourse.julialang.org/t/precise-use-of-fftw/3931
**Category:** General Usage
**Created:** [May 25, 2017, 7:38pm UTC](https://discourse.julialang.org/t/precise-use-of-fftw/3931 "2017-05-25T19:38:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MikaelSlevinsky](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mikaelslevinsky/32/38545_2.png) [@MikaelSlevinsky](https://discourse.julialang.org/u/MikaelSlevinsky)
#### Post date: [May 25, 2017, 7:38pm UTC](https://discourse.julialang.org/t/precise-use-of-fftw/3931/1 "2017-05-25T19:38:58Z")

</div>

How can I call FFTW to map rows of an m x (2n+1) matrix whose column basis is:

{ 1, sinθ, cosθ, sin2θ, cos2θ,…, sin nθ, cos nθ }

to values of the sum (over the matrix entries in the row times the column basis) at equispaced points in θ? Preferably operating allocation-free.

---

<div class="post-metadata">

### Author: ![MikaelSlevinsky](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mikaelslevinsky/32/38545_2.png) [@MikaelSlevinsky](https://discourse.julialang.org/u/MikaelSlevinsky)
#### Post date: [June 8, 2017, 5:01pm UTC](https://discourse.julialang.org/t/precise-use-of-fftw/3931/2 "2017-06-08T17:01:11Z")

</div>

A solution is available in FastTransforms.jl commit [67a6b](https://github.com/MikaelSlevinsky/FastTransforms.jl/commit/67a6b560735ef8f82e1c6a7f82dad3e1a843fc8e), though I won’t claim it’s optimal in any way beyond meeting the above criteria.
