Skip to content

Commit a8c5812

Browse files
committed
float32 support
1 parent 85c7a15 commit a8c5812

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,18 @@ arr_cmplx y6 = x1 * 2i;
5050
### Slicing
5151
The behavior of slices is as close as possible to numpy. Except for cases with invalid indexes, in which case numpy does not throw an exception.
5252
```cpp
53-
using namespace dsplib;
53+
arr_real x = {0, 1, 2, 3, 4, 5, 6};
54+
x.slice(0, 2) ///{0, 1}
55+
x.slice(2, -1) ///{2, 3, 4, 5}
56+
x.slice(-1, 0, -1) ///{6, 5, 4, 3, 2, 1}
57+
x.slice(-1, 0) ///OUT_OF_RANGE, but numpy returns []
58+
x.slice(0, -1, -1) ///OUT_OF_RANGE, but numpy returns []
59+
x.slice(-8, 7) ///OUT_OF_RANGE, but numpy returns [0 1 2 3 4 5 6]
60+
```
61+
62+
### Fast Fourier Transform:
63+
The FFT/IFFT calculation table is cached on first run. To eliminate this behavior, you can use the fft_plan object.
64+
```cpp
5465
arr_real x = randn(512);
5566
arr_cmplx y = fft(x);
5667
```
@@ -91,7 +102,7 @@ arr_real x2 = awgn(x1, 10);
91102
arr_real y = xcorr(x1, x2);
92103
```
93104

94-
Simple Spectrum Analyze (16-bit scale):
105+
### Simple Spectrum Analyze (16-bit scale):
95106
```cpp
96107
int nfft = 1024;
97108
arr_real x = randn(nfft) * 1000;

0 commit comments

Comments
 (0)