MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetPeriodicHann

Function GetPeriodicHann

tensorflow/lite/kernels/internal/spectrogram.cc:30–37  ·  view source on GitHub ↗

Returns the default Hann window function for the spectrogram.

Source from the content-addressed store, hash-verified

28namespace {
29// Returns the default Hann window function for the spectrogram.
30void GetPeriodicHann(int window_length, std::vector<double>* window) {
31 // Some platforms don't have M_PI, so define a local constant here.
32 const double pi = std::atan(1.0) * 4.0;
33 window->resize(window_length);
34 for (int i = 0; i < window_length; ++i) {
35 (*window)[i] = 0.5 - 0.5 * cos((2.0 * pi * i) / window_length);
36 }
37}
38} // namespace
39
40bool Spectrogram::Initialize(int window_length, int step_length) {

Callers 1

InitializeMethod · 0.70

Calls 3

atanClass · 0.85
cosFunction · 0.50
resizeMethod · 0.45

Tested by

no test coverage detected