1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-19 17:40:15 +02:00
Paul Licameli f52dfd3ac3 New library for math...
... note the swap of target_link_libraries lines in src/CMakeLists.txt,
needed to build at least on macOS, becuase FFT.h must be looked up first in
lib-math, not in lib-src/twolame

Also making a dependency cycle of SampleFormat and Dither!  But we will tolerate
that within one small library.
2021-07-22 16:54:00 -04:00

30 lines
708 B
C

/**********************************************************************
Audacity: A Digital Audio Editor
Spectrum.h
Dominic Mazzoni
**********************************************************************/
#ifndef __AUDACITY_SPECTRUM__
#define __AUDACITY_SPECTRUM__
#include "FFT.h"
/*
This function computes the power (mean square amplitude) as
a function of frequency, for some block of audio data.
width: the number of samples
calculates windowSize/2 frequency samples
*/
MATH_API
bool ComputeSpectrum(const float * data, size_t width, size_t windowSize,
double rate, float *out, bool autocorrelation,
int windowFunc = eWinFuncHann);
#endif