fmanal

fmanal — AM/FM analysis from quadrature signal.

Description

This opcode attempts to extract the AM and FM signals off a quadrature signal (e.g. from a Hilbert transform).

Syntax

am, af fmanal are, aim

Performance

are -- real (cosine-phase) input signal

aim -- imaginary (sine-phase) input signal

am -- amplitude modulation envelope

af -- frequency modulation envelope

fmanal takes a signal in quadrature (real, imag) and outputs the estimate AM and FM signals. The former is the modulus of each input sample pair (|re + j*im|) and the latter the derivative of arg(re + j*im). Each sample of the output is the estimated instantaneous amplitude and frequency of the input signal.

Example

Here is an example of the fmanal opcode. It uses the file fmanal.csd.

Example 349. Example of the fmanal opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 64
nchnls = 2
0dbfs = 1

instr 1

asig oscili p4, p5
a1,a2 hilbert2 asig,1024,256
am,afm fmanal a1,a2
ktrig metro 2
printf "AM=%.3f FM=%.1f\n",ktrig,k(am),k(afm)
  outs a1, a2

endin


</CsInstruments>
<CsScore>
i1 0 10 0.5 440
</CsScore>
</CsoundSynthesizer>


Credits

Author: Victor Lazzarini
2017