Skip to content

Commit

Permalink
Expose .fftSize() on STFT
Browse files Browse the repository at this point in the history
  • Loading branch information
geraintluff committed Jun 6, 2021
1 parent f2d61ea commit e6f3afc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Signalsmith Audio's DSP Library

A C++ header-only library, providing classes/templates for (mostly audio) signal-processing tasks.
A C++11 header-only library, providing classes/templates for (mostly audio) signal-processing tasks.

```
git clone https://signalsmith-audio.co.uk/code/dsp.git
Expand All @@ -20,7 +20,7 @@ Tests (and source-scripts for the above docs) are available in a separate repo:
git clone https://signalsmith-audio.co.uk/code/dsp-doc.git
```

The goal (where possible) is for the actual audio characteristics of the tools (e.g. frequency responses and aliasing levels).
The goal (where possible) is to measure/test the actual audio characteristics of the tools (e.g. frequency responses and aliasing levels).


### License
Expand Down
9 changes: 6 additions & 3 deletions spectral.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ namespace spectral {
using Super = signalsmith::delay::MultiBuffer<Sample>;
using Complex = std::complex<Sample>;

int channels = 0, _windowSize = 0, fftSize = 0, interval = 1;
int channels = 0, _windowSize = 0, _fftSize = 0, interval = 1;
int validUntilIndex = 0;
WindowedFFT<Sample> fft;

Expand Down Expand Up @@ -194,7 +194,7 @@ namespace spectral {

this->channels = channels;
_windowSize = windowSize;
this->fftSize = fftSize;
this->_fftSize = fftSize;
this->interval = interval;
validUntilIndex = -1;

Expand Down Expand Up @@ -230,6 +230,9 @@ namespace spectral {
int windowSize() {
return _windowSize;
}
int fftSize() {
return _fftSize;
}
/// Returns the (analysis and synthesis) window
decltype(fft.window()) window() {
return fft.window();
Expand Down Expand Up @@ -316,7 +319,7 @@ namespace spectral {
}

int bands() const {
return fftSize/2;
return _fftSize/2;
}

/** Internal latency (between the block-index requested in `.ensureValid()` and its position in the output)
Expand Down

0 comments on commit e6f3afc

Please sign in to comment.