Section 4.6.6.2, Cs4234 – Cirrus Logic CS4234 User Manual

Page 44

Advertising
background image

DS899F1

44

CS4234

4.6.6.2

Soft Ramp

The CS4234 soft ramp feature (enabled using the

DAC1-4 ATT.

and

DAC5 ATT.

bits) is activated on mute

and unmute transitions as well as any normal volume register changes. To avoid any potential audible
artifacts due to the soft ramping, the volume control algorithm implements the ramping function differently
based upon how the user attempts to control the volume.

If the user changes the volume in distant discrete steps such as what would happen if a button were
pressed on a user interface to temporarily add attenuation to or mute a channel, then the volume is
ramped from the current setting to the new setting at a constant rate set by the

MUTE DELAY[1:0]

bits.

Alternatively, if the user controls the volume through a knob or slider interface, a volume envelope is sam-
pled at a slow, not-necessarily uniform rate (typically 1-20 Hz) and sent to the CS4234. In this case the
ramping algorithm detects a short succession of volume changes attempting to track the volume envelope
and dynamically adjusts the soft-ramp rate.

If the CS4234 were to use a constant ramp rate between the volume changes it receives, its output volume
envelope may either lag behind the user-generated envelope if the ramp rate is set too low (possibly not
reaching the peaks and dulling the envelope) or the output volume envelope may cause a stair-case effect
resulting in audible zipper noise if the ramp rate is set too high. By instead adapting the soft-ramp rate to
fit the envelope given by the incoming volume samples, the envelope lag time is limited and the zipper
noise is avoided. In this mode the soft ramp algorithm linearly interpolates the volume between the volume
changes. There is a lag of one volume change sample since two samples are required to calculate the
first ramp rate.

See

Figure 30

for the soft ramp diagram. On the first volume sample received, the CS4234 only detects

the possible beginning of a volume envelope sequence and resets an envelope counter. The volume
starts ramping to the new volume setting at a constant rate controlled by the

MUTE DELAY[1:0]

setting.

If the envelope counter times out before a new volume sample is received, the next received sample is
treated in the same way as the previous sample and the ramp rate is kept constant. In this way, as long
as the volume samples are distant from each other by more than the envelope counter time out, the rate
is kept constant resulting in the soft-ramp behavior described in the button-press example.

However if the next volume sample is received before the envelope counter times out, then it is assumed
to be part of a volume envelope sequence. The envelope counter is reset and as long as new samples
are received in succession before a time out occurs, the sequence is continued. Starting at the second
volume sample of an envelope sequence, the ramp rate is adjusted using the equation shown in

Figure 30

.

Advertising