Add SQRT_HANN window type to both SpectrogramCalculator and InverseSpectrogramCalculator.
PiperOrigin-RevId: 503041493
This commit is contained in:
parent
97af47ebf5
commit
e2dedcbfe5
|
@ -280,6 +280,13 @@ absl::Status SpectrogramCalculator::Open(CalculatorContext* cc) {
|
||||||
audio_dsp::HammingWindow().GetPeriodicSamples(frame_duration_samples_,
|
audio_dsp::HammingWindow().GetPeriodicSamples(frame_duration_samples_,
|
||||||
&window);
|
&window);
|
||||||
break;
|
break;
|
||||||
|
case SpectrogramCalculatorOptions::SQRT_HANN: {
|
||||||
|
audio_dsp::HannWindow().GetPeriodicSamples(frame_duration_samples_,
|
||||||
|
&window);
|
||||||
|
absl::c_transform(window, window.begin(),
|
||||||
|
[](double x) { return std::sqrt(x); });
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Propagate settings down to the actual Spectrogram object.
|
// Propagate settings down to the actual Spectrogram object.
|
||||||
|
|
|
@ -68,6 +68,7 @@ message SpectrogramCalculatorOptions {
|
||||||
HANN = 0;
|
HANN = 0;
|
||||||
HAMMING = 1;
|
HAMMING = 1;
|
||||||
COSINE = 2;
|
COSINE = 2;
|
||||||
|
SQRT_HANN = 4;
|
||||||
}
|
}
|
||||||
optional WindowType window_type = 6 [default = HANN];
|
optional WindowType window_type = 6 [default = HANN];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user