What does this capacitor do?

Designing hardware that use VLSI Solution's devices as the system controller for the entire design.
Post Reply
zulunation
Senior User
Posts: 33
Joined: Mon 2012-02-06 23:04

What does this capacitor do?

Post by zulunation »

Hello

I am using VS1053b to record from LineIN.

I have connected sine signal generator to Line1 input and recording the sine signal.
I am using this schematics.
The sine signal recorded is fine.
I noticed that if i remove C11 capacitor then only positive period is recorded (like sine wave passes through diode bridge)

Why this is happening?
Thanks
Attachments
vs_stereo.jpg
vs_stereo.jpg (116.7 KiB) Viewed 311 times
User avatar
pasi
VLSI Staff
Posts: 2006
Joined: Thu 2010-07-15 16:04

Re: What does this capacitor do?

Post by pasi »

The "zero-point" of the vs10xx Analog to Digital converter (and the analog outputs as well) is at the RCAP voltage, normally 1.24V, potentially 1.65V if the higher reference has been configured. The audio signal revolves around this zero-point. In the ADC input, the voltage at the pin should not go below GND or above AVDD / 2xRCAP (whichever is lower).

If you apply a signal that is below GND or above the supply voltage of the pin, it clips to the protection diodes of the pin. If you drive with enough current drive, this could also cause a latch-up state and you can only recover by removing all power from the chip. (Search for "latch-up".) If persistent for too long, latch-up will heat up the chip, eventually breaking it.

C11 is a DC-block capacitor. It allows a signal between -X and X on the other side to generate a voltage between GND and 2X on the other side. Essentially it's a high-pass filter, which removes the DC offset.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
zulunation
Senior User
Posts: 33
Joined: Mon 2012-02-06 23:04

Re: What does this capacitor do?

Post by zulunation »

Thanks for reply,

SO the signal must not exceed the certain limits.
As i understood the input signal is shifted by 1.24V up. So the input 0 volts are become 1.24 V. And ADC gives
0x00 code for that. This is done because ADC does not provide negative numbers. Everything which is less than 1.24 will be negative. AM I right?

So if the sine signal has a small DC than it will be shifted not to 1.24 but to 1.24 + offset voltage.
But if it does not goes outside the range it will still be sampled ok even without blocking capacitor.
Correct?
User avatar
pasi
VLSI Staff
Posts: 2006
Joined: Thu 2010-07-15 16:04

Re: What does this capacitor do?

Post by pasi »

The ADC does provide negative numbers for voltages that are below the reference (RCAP), and positive for the values above the reference (RCAP). RCAP is 1.24V by default.

The voltage in any chip pin must not exceed the specifications (not below GND, and not above AVDD in the case of an analog input pin).

Practically, the voltage at the line input pin must be between 0V and 2*RCAP for conversion result values between -32768 and +32767.

If the sine wave "fits" into this range, it's will be correctly converted without the DC block (highpass). Some generators have an "offset" configuration, where you can configure the value to 1.24V (so that the voltage doesn't go below GND).
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Hannu
Senior User
Posts: 396
Joined: Mon 2016-05-30 11:54
Location: Finland
Contact:

Re: What does this capacitor do?

Post by Hannu »

From ADC point of view 0 is RCAP and positive and negative numbers are available as Pasi mentioned. If you short line input connector to ground, ADC will give you 0 because it is after DC-block capacitor. And the voltage between ADC and DC-block cap (C11) is RCAP voltage.

I hope picture below helps.
dc_offset.jpg
dc_offset.jpg (489.99 KiB) Viewed 299 times
zulunation
Senior User
Posts: 33
Joined: Mon 2012-02-06 23:04

Re: What does this capacitor do?

Post by zulunation »

Thanks, I have understood how it works.

I am trying to calibrate my board. I pass a sine signal to line in with known amplitude.
I watch the recorded signal with Sound Forge program.
It has the dB scale. I have checked that Sound Forge calculated the value in decibels using the formula:

DB = 20 * log(Signal level/32768).

So i am trying to calculate the expected sine peak value using the formula:

SF = 20 * log(Vinput/2 * Vcap)

It seems correct but gives slightly wrong value.
My Vcap is 1.22 V. I have checked with voltmeter.
Vinput is the sine signal amplitude.

When i pass 200mV amplitude sine signal the calculated value should be -21.7 dB.
But in sound forge i see -18.9 dB

Is my formula correct?
Maybe ADC is not linear?
Hannu
Senior User
Posts: 396
Joined: Mon 2016-05-30 11:54
Location: Finland
Contact:

Re: What does this capacitor do?

Post by Hannu »

Your calculation is seems correct.

If signal level is RMS, and your signal is 200 mV peak, difference is about 3 dB which would mean sqrt(2) difference which would match RMS <-> peak difference. I've attached a small wav file. The peak is on -20 dBFS and RMS would be -23 dBFS If you want to check sound forge.
Attachments
test_file.wav
1k -20 dB peak
(104.49 KiB) Downloaded 17 times
User avatar
pasi
VLSI Staff
Posts: 2006
Joined: Thu 2010-07-15 16:04

Re: What does this capacitor do?

Post by pasi »

Note that the analog to digital conversion value is not exactly scaled to fill the GND-to-2xRCAP range. You won't get exactly -32768 when the line input is at the GND potential.

The digital gain, however, is always fixed, unlike the RCAP value, which varies from IC to IC and also varies with temperature. The temperature curve is a paraboloid, but fortunately, the top is around the room temperature, so you don't usually need to account for temperature variation of the reference.

Btw, the formula you used is actually:
SF = 20 * log(Vinput/(2 * Vcap)) = -21.73dB
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Post Reply