Online documentation for AudioProcessor
Generated 2006-03-17
Configurable audio processor (part of Media/Audio/Analysis framework).
Description
Audio processing component which can receive audio frames (via sink), apply various
processing steps to the frame, and then output it to another audio component (via source).
Installation
See AudioCaptureManager component for video capture requirements.
Configuration
Configured by setting configuration property.
Allows value of the form "PROCESSOR1(ARG1,ARG2,...),PROCESSOR2(ARG1,...),...".
Available processors are:
- "Abs()" - make each sample absolute (i.e. negative values made positive).
Generally "Square()" is a better choice.
- "Square()" - make each sample the square of the input - good for determining
noise/energy level in the sound with a following AudioAverage component.
- "Subsample(N)", e.g. "Subsample(4)" - emits frames with each
sample the average of N input samples. Note: this simple averaging will
result in aliasing artefacts in the final sound; a better subsampling
with low-pass filtering should be implemented and used in sonically
demanding applications.
- "Window(ALPHA,MAXLENSECONDS)", e.g. "Window(0.02,1)" - emits frames with
a hamming-style window
(alpha+(1-alpha)*(1+cos(2*pi*isample/framesize))/2) applied to the
frame. The true hamming window has alpha=0.02. This should be done
before any operation which convert to frequency domain (e.g.
"FrequencyMatch") to reduce the effects of the sound being effectively
truncated at the beginning and end of the frame.
- "Gain(GAIN)", e.g. "Gain(10)" - emits frames with each
sample scaled by the specified amount (and clipped in short
representation if off-scale).
- "FrequencyMatch(F0, F1, F2, ...)", e.g. "FrequencyMatch(0, 100,
200)" - emits frames with each
sample being the amount of energy in the input frame at the specified
frequency. The frequency 0 is used to request total frame energy.
Energies are scaled to be per-sample. Configuration
syntax will output three 'samples', the total evergy per sample
(average), the energy at 100Hz and the energy at 200Hz. The selectivity
of this process will depend on the number of cycles per frame.
- A few notes... normal concert A is 440Hz. There are 12
semitones per octave (A A# B B C C# D# E F F# G G#) in the european
scale. One octave is a factor of 2 frequency. Semitones (are
approximately) equal ratio steps, i.e. 12th root of 2, =
1.0594630943592952645618252949463, or 5.9463% change in frequency.
Frequency ratios in the full scale are:
- A 1
- A# 1.0594630943592952645618252949463
- B 1.1224620483093729814335330496792
- C 1.1892071150027210667174999705605
- C# 1.2599210498948731647672106072782
- D 1.3348398541700343648308318811845
- D# 1.4142135623730950488016887242097
- E 1.4983070768766814987992807320298
- F 1.5874010519681994747517056392723
- F# 1.6817928305074290860622509524664
- G 1.781797436280678609480452411181
- G# 1.8877486253633869932838263133351
- A' 2
- Frequencies for A below concert A to concert A are:
- A 220Hz
- A# 233.08188075904495820360156488812
- B 246.94165062806205591537727092938
- C 261.6255653005986346778499935232
- C# 277.18263097687209624878633360116
- D 293.66476791740756026278301386048
- D# 311.12698372208091073637151932598
- E 329.62755691286992973584176104638
- F 349.22823143300388444537524063984
- F# 369.99442271163439893369520954252
- G 391.99543598174929408569953045982
- G# 415.3046975799451385224417889337
- A' 440Hz
- A# 466.1637615180899164072031297762
- B 493.8833012561241118307545418586
- C 523.2511306011972693556999870464
- C# 554.3652619537441924975726672022
- D 587.3295358348151205255660277208
- D# 622.2539674441618214727430386518
- E 659.2551138257398594716835220926
- F 698.4564628660077688907504812796
- F# 739.988845423268797867390419085
- G 783.9908719634985881713990609196
- G# 830.6093951598902770448835778674
- A'' 880Hz
- e.g.
Format(float),Window(0.02),FrequencyMatch(0,587.3).
- Consider using this with an AudioSelectValue component
to extract the required value from the output frame.
- "Format(float | short)", e.g. "Format(float)" - emits frames in
the requested format.
Usage
Typically, link to sink from the source property of a AudioCaptureDevice component
(created by an AudioCaptureManager component) or from the source property of
a chained AudioProcessor component to a AudioSelectValue or AudioAverage component
which exposes the final processing result.
View the component web page using the URL in the configUrl property, which includes
some visualisation facilities.
Technical Details
Part of the audioframework set of components; extends AbstractAudioProcessor.