xine-lib: xine-lib-1.2.13/src/post/visualizations/fft.c File Reference

xine-lib 1.2.13-20230125hg15249

Macros | Functions
fft.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <math.h>`
`#include "fft.h"`

## Macros
#define | SINE(x) (fft->SineTable[(x)])
#define | COSINE(x) (fft->CosineTable[(x)])
#define | WINDOW(x) (fft->WinTable[(x)])
#define | PERMUTE(x, y) reverse((x), (y))
#define | SAMPLES (1 << bits)
#define | REAL(x) wave[(x)].re
#define | IMAG(x) wave[(x)].im
#define | ALPHA 0.54

## Functions
static unsigned int | reverse (unsigned int val, int bits)
void | fft_compute (fft_t *fft, complex_t wave[])
fft_t * | fft_new (int bits)
void | fft_dispose (fft_t *fft)
void | fft_window (fft_t *fft, complex_t wave[])
double | fft_amp (int n, complex_t wave[], int bits)
double | fft_amp2 (fft_t *fft, int n, complex_t wave[])
void | fft_scale (complex_t wave[], int bits)

## Macro Definition Documentation

## ◆ ALPHA

#define ALPHA 0.54

Referenced by fft_new().

## ◆ COSINE

#define COSINE | ( |  | x | ) | (fft->CosineTable[(x)])

Referenced by fft_compute().

## ◆ IMAG

#define IMAG | ( |  | x | ) | wave[(x)].im

Referenced by fft_amp(), fft_amp2(), fft_compute(), and fft_window().

## ◆ PERMUTE

#define PERMUTE | ( |  | x,
|  |  | y ) reverse((x), (y))

Referenced by fft_amp(), and fft_new().

## ◆ REAL

#define REAL | ( |  | x | ) | wave[(x)].re

Referenced by fft_amp(), fft_amp2(), fft_compute(), and fft_window().

## ◆ SAMPLES

#define SAMPLES (1 << bits)

Referenced by fft_compute(), fft_new(), and fft_window().

## ◆ SINE

#define SINE | ( |  | x | ) | (fft->SineTable[(x)])

Referenced by fft_compute().

## ◆ WINDOW

#define WINDOW | ( |  | x | ) | (fft->WinTable[(x)])

Referenced by fft_window().

## Function Documentation

## ◆ fft_amp()

double fft_amp | ( | int | n,
|  | complex_t | wave[],
|  | int | bits )

References bits, IMAG, PERMUTE, and REAL.

## ◆ fft_amp2()

double fft_amp2 | ( | fft_t * | fft,
|  | int | n,
|  | complex_t | wave[] )

References fft_s::bmask, IMAG, fft_s::PermuteTable, and REAL.

Referenced by draw_fftgraph(), and draw_fftscope().

## ◆ fft_compute()

void fft_compute | ( | fft_t * | fft,
|  | complex_t | wave[] )

References bits, fft_s::bits, fft_s::bmask, COSINE, IMAG, fft_s::PermuteTable, REAL, SAMPLES, and SINE.

Referenced by draw_fftgraph(), and draw_fftscope().

## ◆ fft_dispose()

void fft_dispose | ( | fft_t * | fft | ) |

References fft_s::PermuteTable, and fft_s::SineTable.

Referenced by fftgraph_port_close(), and fftscope_port_close().

## ◆ fft_new()

fft_t * fft_new | ( | int | bits | ) |

References ALPHA, bits, fft_s::bits, fft_s::bmask, fft_s::CosineTable, NULL, PERMUTE, fft_s::PermuteTable, SAMPLES, fft_s::SineTable, and fft_s::WinTable.

Referenced by fftgraph_port_open(), and fftscope_port_open().

## ◆ fft_scale()

void fft_scale | ( | complex_t | wave[],
|  | int | bits )

References bits, complex_s::im, and complex_s::re.

Referenced by draw_fftgraph(), and draw_fftscope().

## ◆ fft_window()

void fft_window | ( | fft_t * | fft,
|  | complex_t | wave[] )

References bits, fft_s::bits, IMAG, REAL, SAMPLES, and WINDOW.

Referenced by draw_fftgraph(), and draw_fftscope().

## ◆ reverse()

static unsigned int reverse | ( | unsigned int | val,
|  | int | bits )
| inlinestatic

References bits.