/Users/richardeakin/projects/libsms/trunk/src/spectrum.c File Reference

functions to convert between frequency (spectrum) and time (wavefrom) domain More...

#include "sms.h"
Include dependency graph for spectrum.c:

Functions

int sms_spectrum (int sizeWindow, sfloat *pWaveform, sfloat *pWindow, int sizeMag, sfloat *pMag, sfloat *pPhase)
 compute a complex spectrum from a waveform
int sms_spectrumMag (int sizeWindow, sfloat *pWaveform, sfloat *pWindow, int sizeMag, sfloat *pMag)
 compute the spectrum Magnitude of a waveform
int sms_invSpectrum (int sizeWaveform, sfloat *pWaveform, sfloat *pWindow, int sizeMag, sfloat *pMag, sfloat *pPhase)
 function for a quick inverse spectrum, windowed
int sms_invQuickSpectrumW (sfloat *pFMagSpectrum, sfloat *pFPhaseSpectrum, int sizeFft, sfloat *pFWaveform, int sizeWave, sfloat *pFWindow)
 function for a quick inverse spectrum, windowed function to perform the inverse FFT, windowing the output sfloat *pFMagSpectrum input magnitude spectrum sfloat *pFPhaseSpectrum input phase spectrum int sizeFft size of FFT sfloat *pFWaveform output waveform int sizeWave size of output waveform sfloat *pFWindow synthesis window
void sms_RectToPolar (int sizeMag, sfloat *pRect, sfloat *pMag, sfloat *pPhase)
 convert spectrum from Rectangular to Polar form
void sms_PolarToRect (int sizeSpec, sfloat *pRect, sfloat *pMag, sfloat *pPhase)
 convert spectrum from Rectangular to Polar form
void sms_spectrumRMS (int sizeMag, sfloat *pInRect, sfloat *pOutMag)
 compute magnitude spectrum of a DFT in rectangular coordinates

Detailed Description

functions to convert between frequency (spectrum) and time (wavefrom) domain


Function Documentation

int sms_invQuickSpectrumW ( sfloat *  pFMagSpectrum,
sfloat *  pFPhaseSpectrum,
int  sizeFft,
sfloat *  pFWaveform,
int  sizeWave,
sfloat *  pFWindow 
)

function for a quick inverse spectrum, windowed function to perform the inverse FFT, windowing the output sfloat *pFMagSpectrum input magnitude spectrum sfloat *pFPhaseSpectrum input phase spectrum int sizeFft size of FFT sfloat *pFWaveform output waveform int sizeWave size of output waveform sfloat *pFWindow synthesis window

References sfloat, and sms_ifft().

Here is the call graph for this function:

int sms_invSpectrum ( int  sizeWaveform,
sfloat *  pWaveform,
sfloat *  pWindow,
int  sizeMag,
sfloat *  pMag,
sfloat *  pPhase 
)

function for a quick inverse spectrum, windowed

Not done yet, but this will be a function that is the inverse of sms_spectrum above.

function to perform the inverse FFT, windowing the output sfloat *pFMagSpectrum input magnitude spectrum sfloat *pFPhaseSpectrum input phase spectrum int sizeFft size of FFT sfloat *pFWaveform output waveform int sizeWave size of output waveform sfloat *pFWindow synthesis window

References sfloat, sms_error(), sms_ifft(), sms_PolarToRect(), and sms_power2().

Here is the call graph for this function:

void sms_PolarToRect ( int  sizeSpec,
sfloat *  pRect,
sfloat *  pMag,
sfloat *  pPhase 
)

convert spectrum from Rectangular to Polar form

Parameters:
sizeSpec size of spectrum (pMag and pPhase arrays)
pRect pointer output spectrum in rectangular form (2x sizeSpec)
pMag pointer to sfloat array of magnitude spectrum
pPhase pointer to sfloat array of phase spectrum

References sfloat.

void sms_RectToPolar ( int  sizeMag,
sfloat *  pRect,
sfloat *  pMag,
sfloat *  pPhase 
)

convert spectrum from Rectangular to Polar form

Parameters:
sizeMag size of spectrum (pMag and pPhase arrays)
pRect pointer output spectrum in rectangular form (2x sizeSpec)
pMag pointer to sfloat array of magnitude spectrum
pPhase pointer to sfloat array of phase spectrum

References sfloat.

int sms_spectrum ( int  sizeWindow,
sfloat *  pWaveform,
sfloat *  pWindow,
int  sizeMag,
sfloat *  pMag,
sfloat *  pPhase 
)

compute a complex spectrum from a waveform

Parameters:
sizeWindow size of analysis window
pWaveform pointer to input waveform
pWindow pointer to input window
sizeMag size of output magnitude and phase spectrums
pMag pointer to output magnitude spectrum
pPhase pointer to output phase spectrum
Returns:
sizeFft, -1 on error
Todo:
remove this return

References sfloat, sms_error(), sms_fft(), sms_power2(), and sms_windowCentered().

Here is the call graph for this function:

int sms_spectrumMag ( int  sizeWindow,
sfloat *  pWaveform,
sfloat *  pWindow,
int  sizeMag,
sfloat *  pMag 
)

compute the spectrum Magnitude of a waveform

This function windows the waveform with pWindow and performs a zero-padded FFT (if sizeMag*2 > sizeWindow). The spectra is then converted magnitude (RMS).

Parameters:
sizeWindow size of analysis window / input wavefrom
pWaveform pointer to input waveform
pWindow pointer to analysis window
sizeMag size of output magnitude spectrum
pMag pointer to output magnitude spectrum
Returns:
0 on success, -1 on error

References sfloat, sms_error(), sms_fft(), and sms_power2().

Here is the call graph for this function:

void sms_spectrumRMS ( int  sizeMag,
sfloat *  pInRect,
sfloat *  pOutMag 
)

compute magnitude spectrum of a DFT in rectangular coordinates

Parameters:
sizeMag size of output Magnitude (half of input real FFT)
pInRect pointer to input DFT array (real/imag sfloats)
pOutMag pointer to of magnitude spectrum array

References sfloat.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Thu Oct 29 04:08:07 2009 for libsms by  doxygen 1.6.1