libftsh
A Fast Transform for Spherical Harmonics
 All Data Structures Files Functions Variables Defines
Defines | Functions
lctw.c File Reference

Local Cosine Transform based on FFTW. More...

#include "libftsh.h"

Defines

#define ENTEREXIT   0

Functions

void lctw (REAL *fcn, Ftrigtw_Plan *main_plan)
void lctw_init (Ftrigtw_Plan *main_plan, int flags, int numpts)

Detailed Description

Local Cosine Transform based on FFTW.

Summary:


Function Documentation

void lctw ( REAL fcn,
Ftrigtw_Plan main_plan 
)

Computes the local cosine transform of fcn and puts the coeficients back into fcn.

The local cosine transform is also known as the type 4 discrete cosine transform.

This is the LCT at half integer points. Is its own inverse.

INPUTS:

  • fcn array containing the data
  • main_plan -- a structure holding precomputed trig functions, the plan used by fftw, and the number of points; initialized by lctw_init.

OUTPUT: fcn. Puts the coefficients in fcn. specifically: \[ f(k) =norm \sum_{j=0}^{numpts-1} f(j) \cos\left(\pi\frac{(k+1/2)(j+1/2)}{numpts}\right) \]

         numpts-1              (k+0.5)  (j+0.5)
  fcn[k]= SUM   fcn[j] cos( PI ----------------  ) *norm
         j=0                         numpts   

set for \(L^2\) normalization.

NOTES:

  • comment better
  • requires even numpts. checked by lctw_init

Here is the caller graph for this function:

void lctw_init ( Ftrigtw_Plan main_plan,
int  flags,
int  numpts 
)

This routine initializes for lctw

We initialize trigonometic things used by the lct and dct portions, and call the initailizer for the fftw real transform (forward).

INPUTS:

  • main_plan -- a structure that will hold the things we generate Memory for its fields is allocated in this routine.
  • flags -- flags passed directly to the rfftw initializer
  • numpts -- the number of points on which we will transform MUST be even

OUTPUTS: main_plan is filled in:

NOTES:

  • comment better

Here is the caller graph for this function: