dsplib 1.1.0
C++ DSP library for MATLAB-like coding
Loading...
Searching...
No Matches
stft.h
1#pragma once
2
3#include <dsplib/array.h>
4
5namespace dsplib {
6
7enum class StftRange
8{
9 Centered,
10 Twosided,
11 Onesided
12};
13
14enum class OverlapMethod
15{
16 Ola,
17 Wola,
18};
19
20//determine whether window-overlap combination is COLA compliant
21bool iscola(const arr_real& win, int noverlap, OverlapMethod method = OverlapMethod::Ola);
22
35std::vector<arr_cmplx> stft(const arr_real& x, const arr_real& win, int overlap, int nfft,
36 StftRange range = StftRange::Onesided);
37
38//win: hann(nfft, `periodic`)
39//overlap: nfft/2
40std::vector<arr_cmplx> stft(const arr_real& x, int nfft, StftRange range = StftRange::Onesided);
41
53arr_real istft(const std::vector<arr_cmplx>& x, const arr_real& win, int overlap, int nfft,
54 StftRange range = StftRange::Onesided, OverlapMethod method = OverlapMethod::Wola);
55
56//win: hann(nfft, `periodic`)
57//overlap: nfft/2
58arr_real istft(const std::vector<arr_cmplx>& x, int nfft, StftRange range = StftRange::Onesided,
59 OverlapMethod method = OverlapMethod::Wola);
60
61} // namespace dsplib