Signal Generators: STFT Resynthesis (Vocoding)

## pvsmaska

fr pvsmaska fsig, ifn, kdepth

### Description

Modify amplitudes of an *fsig*, using a function table, with dynamic scaling.

### Initialization

*ifn* – the ftable to use. Given that *fsig* has *N* analysis bins, table *ifn* must be of size *N* or larger. The table need not be normalized, but values should lie within the range 0 to 1. Table *ifn* can be created in the score, or within the orchestra by using **pvsinfo** to find the size of *fsig*, which is then passed to **ftgen** to create the table.

### Performance

*kdepth* – controls the degree of modification applied to *fsig*, using simple linear scaling. 0 leaves amplitudes unchanged, 1 applies the full profile of *ifn*.

**Note:** Power-of-two FFT sizes are particularly convenient when using table-based processing, as the number of analysis bins (*N* bins) is then a power-of-two plus one, for which an ftable of the same size can be created. It is important that the ftable be created with a size of *N* bins, rather than as a power of two. The latter will copy the first table value to the guard point, which is inappropriate for this opcode.

### Example

This example illustrates that the usual Csound behaviour applies to *fsigs*. The same name can be used for both input and output. In this example, an ftable is created in the score. An *fsig* FFT size of 1024 is assumed.

; Orchestra
**instr** 1
asig **buzz** 20000, 199, 50, 3 ; pulsewave source
fsig **pvsanal** asig, 1024, 256, 1024, 0 ; create fsig
kmod **linseg** 0, p3/2, 1, p3/2, 0 ; simple control sig
fsig **pvsmaska** fsig, 2, kmod ; apply weird eq to fsig
aout **pvsynth** fsig ; resynthesize,
**dispfft** aout, 0.1, 1024 ; and view the effect
**endin**
; Score
; Ftable using cubic spline to define shaped peaks
f1 0 513 8 0 2 1 3 0 4 1 6 0 10 1 12 0 16 1 32 0 1 0 436 0

### Author

Richard Dobson

Somerset, England

August, 2001

New in Csound 4.14

Signal Generators: STFT Resynthesis (Vocoding)