functions to convert between frequency (spectrum) and time (wavefrom) domain More...
#include "sms.h"
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 |
functions to convert between frequency (spectrum) and time (wavefrom) domain
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().
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().
void sms_PolarToRect | ( | int | sizeSpec, | |
sfloat * | pRect, | |||
sfloat * | pMag, | |||
sfloat * | pPhase | |||
) |
convert spectrum from Rectangular to Polar form
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
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
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 |
References sfloat, sms_error(), sms_fft(), sms_power2(), and sms_windowCentered().
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).
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 |
References sfloat, sms_error(), sms_fft(), and sms_power2().
void sms_spectrumRMS | ( | int | sizeMag, | |
sfloat * | pInRect, | |||
sfloat * | pOutMag | |||
) |
compute magnitude spectrum of a DFT in rectangular coordinates
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.