Use Non-Frames Version Previous Page Next Page
Signal Modifiers: Amplitude Modifiers

clip

  ar      clip       asig, imeth, ilimit[, iarg]

Description

Clips an a-rate signal to a predefined limit, in a "soft" manner, using one of three methods.

Initialization

imeth - selects the clipping method. The default is 0. The methods are:

ilimit - limiting value

iarg (optional) - when imeth = 0, indicates the point at which clipping starts, in the range 0 - 1. Not used when imeth = 1 or imeth = 2. Default is 0.5.

Performance

asig - a-rate input signal

The Bram de Jong method (imeth = 0) applies the algorithm:

|x| > a: f(x) = sin(x) * (a+(x-a)/(1+((x-a)/(1-a))2 |x| > 1: f(x) = sin(x) * (a+1)/2

This method requires that asig be normalized to 1.

The second method (imeth = 1) is the sine clip:

|x| < limit: f(x) = limit * sin(π*x/(2*limit)) f(x) = limit * sin(x)

The third method (imeth = 0) is the tanh clip:

|x| < limit: f(x) = limit * tanh(x/limit)/tanh(1) f(x) = limit * sin(x)

Note: Method 1 appears to be non-functional at release of Csound version 4.07.

Examples

  a1      soundin
  a2      oscil      25000, 1
  asig    clip       a1+a2, 0, 30000, .75
          out        asig

Author

John ffitch
University of Bath, Codemist Ltd.
Bath, UK
August, 2000
New in Csound version 4.07


Use Non-Frames Version Previous Page Next Page
Signal Modifiers: Amplitude Modifiers