hilbert2
A DFT-based implementation of a Hilbert transformer.
Syntax
Initialization
idftsize -- DFT size in samples, at least 2. Csound rounds this down to a power of two. Below, N means the rounded DFT size.
ihopsize -- number of samples between analysis frames, at least 1. Csound rounds this down to a power of two, then limits it to N. A smaller hop gives more overlap and uses more processing time.
For example, a DFT size of 150 and a hop size of 35 become 128 and 32.
Performance
sig -- input signal
c -- cosine output of sig
s -- sine output of sig
csig -- Complex array containing the analytic signal.
hilbert2 is a DFT-based implementation of the Hilbert Transform producing two outputs in quadrature (90 degree phase difference across the spectrum). Unlike the IIR-based hilbert opcode, hilbert2 has a linear frequency response. Its streaming algorithm adds a delay equal to the DFT size in samples.
Examples
Here is an example of the hilbert2 opcode. It uses the file hilbert2.csd.
| Example of the hilbert2 opcode. | |
|---|---|
See also
hilbert, Specialized Filters: Other filters
Credits
Author: Victor Lazzarini
2017