Skip to content

Commit f9b9721

Browse files
author
vlazzarini
committed
added complex operations overview
1 parent 4f46f39 commit f9b9721

File tree

7 files changed

+54
-16
lines changed

7 files changed

+54
-16
lines changed

docs/math/complex.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# **Complex Arithmetic and Operators**
2+
3+
Csound supports all arithmetic and a set of operators for Complex variables
4+
and arrays:
5+
6+
* +,-, * and / for Complex-Complex, Complex-k, and Complex-i expressions (returning Complex)
7+
* +,-, * and / for Complex[]-Complex[] and Complex[]-k expressions (returning Complex)
8+
9+
For Complex and Complex[] types, the following functions are supported
10+
11+
* [abs](../opcodes/abs.md) - magnitude
12+
* [arg](../opcodes/arg.md) - argument
13+
* [complex](../opcodes/complex.md) - rectangular conversion
14+
* [conj](../opcodes/conj.md) - conjugation
15+
* [imag](../opcodes/imag.md) - imaginary part
16+
* [polar](../opcodes/polar.md) - polar conversion
17+
* [real](../opcodes/real.md) - real part
18+
19+
Assignment and initialisation are also supported with comma-separated arguments for
20+
both real and imaginary parts respectively,
21+
22+
``` csound-orc
23+
var:Complex = real:{k,i}, imag:{k,i}
24+
```
25+
26+
27+

docs/math/linearalgebra.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ category:
55
# Linear Algebra Opcodes
66
Scalar, vector, and matrix arithmetic on real and complex values.
77

8-
Plugin opcodes in linear_algebra. This opcode is part of the plugin repository and has to be installed separately. The plugin repository can be found here: [https://github.com/csound/plugins](https://github.com/csound/plugins)
8+
Plugin opcodes in linear_algebra. These opcodes are part of the plugin repository and has to be installed separately. The plugin repository can be found here: [https://github.com/csound/plugins](https://github.com/csound/plugins)
99

1010
These opcodes implement many linear algebra operations, from scalar, vector, and matrix arithmetic up to and including QR based eigenvalue decompositions. The opcodes are designed for digital signal processing, and of course other mathematical operations, in the Csound orchestra language.
1111

docs/math/mathfunc.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Opcodes that perform mathematical functions are:
55
* [abs](../opcodes/abs.md)
66
* [arg](../opcodes/arg.md)
77
* [ceil](../opcodes/ceil.md)
8+
* [chebyshevpoly](../opcodes/chebyshevpoly.md)
89
* [complex](../opcodes/complex.md)
910
* [conj](../opcodes/conj.md)
1011
* [exp](../opcodes/exp.md)
@@ -17,6 +18,7 @@ Opcodes that perform mathematical functions are:
1718
* [log10](../opcodes/log10.md)
1819
* [logbtwo](../opcodes/logbtwo.md)
1920
* [polar](../opcodes/polar.md)
21+
* [polynomial](../opcodes/polynomial.md)
2022
* [pow](../opcodes/pow.md)
2123
* [powershape](../opcodes/powershape.md)
2224
* [powoftwo](../opcodes/powoftwo.md)
@@ -25,3 +27,5 @@ Opcodes that perform mathematical functions are:
2527
* [real](../opcodes/real.md)
2628
* [round](../opcodes/round.md)
2729
* [sqrt](../opcodes/sqrt.md)
30+
* [taninv2](../opcodes/taninv2.md)
31+

docs/math/opeqfunc.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
# **Opcode Equivalents of Functions**
1+
# **Opcode Equivalents of Arithmetic Operations**
22

3-
Opcodes that perform the equivalent of mathematical functions are:
3+
Opcodes that perform the equivalent of arithmetic operations are:
44

5-
* [chebyshevpoly](../opcodes/chebyshevpoly.md)
65
* [divz](../opcodes/divz.md)
76
* [mac](../opcodes/mac.md)
87
* [maca](../opcodes/maca.md)
9-
* [polynomial](../opcodes/polynomial.md)
108
* [pow](../opcodes/pow.md)
119
* [product](../opcodes/product.md)
1210
* [sum](../opcodes/sum.md)
13-
* [taninv2](../opcodes/taninv2.md)
11+
12+

docs/spectral/realtime.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,11 @@ A number of opcodes are designed to generate and process streaming partials trac
8787
[tabifd](../opcodes/tabifd.md)
8888

8989
See the [Stacks section](../control/stacks.md) for information on the stack opcodes which can stack f-signals.
90+
91+
The following opcodes implement streaming phase vocoder analysis/synthesis for direct pitch and
92+
timescaling:
93+
94+
* [filescal](../opcodes/filescal.md)
95+
* [mincer](../opcodes/mincer.md)
96+
* [mp3scal](../opcodes/mp3scal.md)
97+
* [temposcal](../opcodes/temposcal.md)

docs/spectral/stft.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
# **Short-time Fourier Transform (STFT) Resynthesis**
1+
# **Phase Vocoder**
22

33
> :memo: **Use of PVOC-EX files with the old Csound pvoc opcodes**
44
> All the original pvoc opcodes can now read a PVOC-EX file, as well as the native non-portable file format. As the PVOC-EX file uses a double-size analysis window, users may find that this gives a useful improvement in quality, for some sounds and processes, despite the fact that the resynthesis does not use the same window size.
55
>
66
> Apart from the window size parameter, the main difference between the original .pv format and PVOC-EX is in the amplitude range of analysis frames. While rescaling is applied, so that no significant difference in output level is experienced, whichever file format is used, some slight loss of amplitude can still arise, as the double window usage itself modifies frame amplitudes, of which the resynthesis code is unaware. Note that all the original pvoc opcodes expect a mono analysis file, and multi-channel PVOC-EX files will accordingly be rejected.
77
8-
Opcodes the implement STFT resynthesis are:
8+
These are the original phase vocoder resynthesis opcodes in
9+
Csound. They have been superseeded by [streaming spectral
10+
analysis](../spectral/realtime.md), which is both more efficient
11+
and more flexible to use.
912

10-
* [filescal](../opcodes/filescal.md)
11-
* [mincer](../opcodes/mincer.md)
12-
* [mp3scal](../opcodes/mp3scal.md)
13-
* [temposcal](../opcodes/temposcal.md)
1413
* [pvadd](../opcodes/pvadd.md)
1514
* [pvbufread](../opcodes/pvbufread.md)
1615
* [pvcross](../opcodes/pvcross.md)

mkdocs.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ nav:
158158
- Amplitude Converters: 'math/amp.md'
159159
- Arithmetic and Logic Operations: 'math/artlogic.md'
160160
- Comparators and Accumulators: 'sigmod/compaccum.md'
161+
- Complex number Operations: 'math/complex.md'
161162
- Mathematical Functions: 'math/mathfunc.md'
162163
- Opcode Equivalents of Functions: 'math/opeqfunc.md'
163164
- Random Functions: 'math/rndfunc.md'
@@ -180,12 +181,12 @@ nav:
180181
- Slider Banks: 'midi/sliderbk.md'
181182
- Spectral processing:
182183
- 'spectral/top.md'
183-
- Short-time Fourier Transform (STFT) Resynthesis: 'spectral/stft.md'
184-
- Linear Predictive Coding (LPC) Resynthesis: 'spectral/lpcresyn.md'
185-
- Non-standard Spectral Processing: 'spectral/nonstand.md'
186-
- Tools for Real-time Spectral Processing (pvs opcodes): 'spectral/realtime.md'
184+
- Streaming Spectral Processing: 'spectral/realtime.md'
185+
- Linear Predictive Coding (LPC): 'spectral/lpcresyn.md'
186+
- Phase Vocoder Resynthesis: 'spectral/stft.md'
187187
- ATS Spectral Processing: 'spectral/ATS.md'
188188
- Array-based spectral opcodes: 'spectral/arrays.md'
189+
- Non-standard Spectral Processing: 'spectral/nonstand.md'
189190
- Strings:
190191
- 'strings/top.md'
191192
- String Manipulation Opcodes: 'strings/manipulate.md'

0 commit comments

Comments
 (0)