# converting peak-to-peak to dbm

Status
Not open for further replies.

#### mik3ca

##### Member
Ok, so I created a standard amplifier circuit with an LM386 except that I used a pot in the gain section in an attempt to reduce distortion but that only helped to a degree but not enough. I even tried reducing the audio input capacitor from 10uF to 1uF and that didn't work.

So now I think my problem is the input is too high. I'm using 7.2V into the +ve supply of the amp, and with the ISD1700 chipcorder as input I have a choice of 7 different volume levels each 4db apart in volume.

How do I convert this db value to a peak-to-peak value so I can adjust the LM386 accordingly? Would I be forced to use the lowest volume (at 4db i think)? or do I go higher?

#### MikeMl

##### Well-Known Member
The minimum gain of a LM386 is 20, so to get ~4Vp-p across the speaker, the input level only needs to be 4/20 = 200mVp-p. You will likely need an attenuator between your input device and the LM386, like this (taken from the data sheet):

#### mik3ca

##### Member
Between analog out of chipcorder and the opamp +ve input I have a 10uF cap.
I also have a voltage divider there too where the resistor going to VCC is from 470k to 770K (470K + 300K pot) and resistor from +ve to ground is 10K. I bet I need to change those values somehow but If I remember, putting a resistors in series in an audio line makes sound quality not as great? Anyway, I want to try the voltage divider setup first to see if that works better.

#### ChrisP58

##### Well-Known Member
Between analog out of chipcorder and the opamp +ve input I have a 10uF cap.
I also have a voltage divider there too where the resistor going to VCC is from 470k to 770K (470K + 300K pot) and resistor from +ve to ground is 10K. I bet I need to change those values somehow but If I remember, putting a resistors in series in an audio line makes sound quality not as great? Anyway, I want to try the voltage divider setup first to see if that works better.
Pure resistance in the audio path has no impact on audio quality. A potentiometer (like Mike shows in post 2) or a pair of resistors set up as a voltage divider, will attenuate the audio level, but won't distort it.

#### Pommie

##### Well-Known Member
What are you using as analogue out? Sp+, sp-, AUX/AUD and if the later have you set it to current or voltage output?

Mike.

#### KeepItSimpleStupid

##### Well-Known Member
Pure resistance in the audio path has no impact on audio quality. A potentiometer (like Mike shows in post 2) or a pair of resistors set up as a voltage divider, will attenuate the audio level, but won't distort it.
Mostly true. Adding a resistor (e.g. 470 ohms) in series with the speaker output (125 W into 8 ohms) to drive a headphone won't distort, but will add some background hiss.

#### Nigel Goodwin

##### Super Moderator
Adding a resistor (e.g. 470 ohms) in series with the speaker output (125 W into 8 ohms) to drive a headphone won't distort, but will add some background hiss.
Pretty imaginary - it's not the resistor adding any hiss you might hear, simply that you can hear the existing hiss through the headphones because it's quiet with the headphones on.

I don't see as he's going to pay any attention to any advice we give, this is the second thread (at least) he's posted on the same subject, and he ignored all the advice in the previous thread and continues to do stupid things then ask why it doesn't work.

He's repeatedly been told the input was too high, and to follow the circuit on the datasheet - but he's still completely ignoring it.

#### mik3ca

##### Member
What are you using as analogue out? Sp+, sp-, AUX/AUD and if the later have you set it to current or voltage output?
I'm using AUX/AUD output. I'm not sure how to configure current or voltage output via SPI but on the device I turned feed-through and monitor off.

So I did more experimenting and removed the 470-770K resistor from VCC to +ve input but I still left in the 10K to ground, so in effect, I'm using the standard attenuator setup with volume set to max.

My input capacitor is 10uF electrolytic. should I lower this value a bit? I'm afraid if I lower it too much then not enough audio will get through.

Then I ran more tests and noted that if the volume level (on scale of 0 to 7) is below about 4 then I hear continuous oscillation even if in my gain circuitry (of a resistor and capacitor in series connected between pins 1 and 8) the resistor is 20K. If I make the volume level higher than 4, then I actually hear the music but somewhat distorted, but it was better than before.

Could it be my output filter thats a bit messy? I'm using 4.7nF and 10 ohm resistor in series connected directly to the output of the opamp, but then doesn't this zobel network (I think thats the name of the filter) depend on the actual output device used? (speaker, earphone etc?)

#### mik3ca

##### Member
He's repeatedly been told the input was too high, and to follow the circuit on the datasheet - but he's still completely ignoring it.
This is why I now included the use of the digital volume control included with the chipcorder sound chip. so then I can test things when volume is down to minimal. I already made PCBs for this and I'm sure with a bit of fine hardware tuning I'll get better results. I already made a decent step with disconnecting the pull-up resistor that I mentioned in my last thread.

#### Nigel Goodwin

##### Super Moderator
This is why I now included the use of the digital volume control included with the chipcorder sound chip. so then I can test things when volume is down to minimal. I already made PCBs for this and I'm sure with a bit of fine hardware tuning I'll get better results. I already made a decent step with disconnecting the pull-up resistor that I mentioned in my last thread.
You need to build it properly, randomly bodging things in the hope it will miraculously start working isn't going to happen. The LM386 circuit is posted above (yet again), use that, don't add extra bits on for no reason, and don't take parts out. If you don't want a physical pot, then replace the pot with two resistors, but use a pot first and measure the two values when you've adjusted it to where you want.

#### mik3ca

##### Member
ok, there is one thing I somewhat did neglect. Now I just added a 1000uF capacitor almost right next to the op amp IC and things work much better.

I thought I already solved that issue with a 47uF capacitor on the PCB. I did use a 6 inch cable to connect the amp section to the rest of the circuit but that cable must have made it worse

#### AnalogKid

##### Well-Known Member
How do I convert this db value to a peak-to-peak value so I can adjust the LM386 accordingly? ?
A dB is a ratio, not a specific value, so a quantity stated in dB makes sense only if you know what it is in relation to, called the reference level. As originally worked out by Bell (the "bel" in decibel), 0 dB = 1 milliwatt of electrical energy dissipated in a 600 ohm resistor. Rearranging Watt's Law, that means that 0 dB = 0.7746 Vrms, 1.095 Vpeak, 2.191 Vp-p. This is a 0 dB signal, sometimes shown as 0 dBm to indicate that the reference for the ratio is one milliwatt. There are many other dB references and abbreviations. For example, in a broadcast television studio in the 70's, a signal that showed 0 dB on a VU meter was actually +8.0 dBm.

"Consumer level" audio runs 10 dB below this the standard reference, so a "line level" signal out of a CD player is -10dBm at full volume, or 0.2447 Vrms, 0.692 Vp-p, often rounded up to 0.7 V.

For other signals, and to figure the dB value for the difference between any two voltage levels:

(value) dB = 20 x log(V2 / V1)

dB / 20 = log (V2 / V1)

10 ^ (dB / 20) = V2 / V1

V2 = V1 x (10 ^ (dB / 20))

A signal that is 4 dB less than another signal has a 1.585 times lower voltage value.

ak

#### audioguru

##### Well-Known Member
No schematic.
A pot was added to the gain section of the LM386 in an attempt to reduce distortion? But the datasheet of the LM386 shows distortion very low at 0.2%.
An input capacitor value of 10μF was randomly selected to produce a cutoff at 0.32Hz instead of calculating 32Hz needs only 0.1μF.
A DC voltage was added to the (+) input of the LM386 with a DC voltage divider that guarantees distortion. Why?