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

Function GetPeriodicHann

tensorflow/core/kernels/spectrogram.cc:29–36  ·  view source on GitHub ↗

Returns the default Hann window function for the spectrogram.

Source from the content-addressed store, hash-verified

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

Callers 1

InitializeMethod · 0.70

Calls 3

atanClass · 0.85
cosClass · 0.70
resizeMethod · 0.45

Tested by

no test coverage detected