Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Decibels and how they relate to Voltage

Status
Not open for further replies.
And here is cool use of that:

Suppose we want to do a binary search and we have 2047 elements. We would like to know the next power of 2 which is 2048. We take the ln(2047)/ln(2) and get 10.998xxx.

If we up that to the nearest Int(10.98)+0.5) we get 11

2^11 is 2048

Now we can split at 1024 and do the binary search.

That is cool, But you can round up to nearest power of two (using unsigned integers) with (C code):

x = (x+7) & -8;

Edit: My mistake.. the above code rounds up to the next multiple of 8. Not the next power of 2. I leave it as it is.
 
Last edited:
Hi,

What i do is just divide by 2. So if i have 2048 sorted elements, i look at element 1024. If that is greater than what i am looking for then i know my element must lie in the lower 1024 group, but if that is less than what i am looking for then i know my element must lie in the upper 1024 group.
If it was in the lower group for example, then i divide by 2 again to get 512 so next i look at the element 512 and do the same thing.
After enough iterations i end up with either the right element or the one just above and the one just below my search element.
So no log function required, but that's good for calculating the max number of tries that will be needed to find an object i think. Maybe log base 2.
 
L. Ghostman:
Voltage and decibel relation
Just a few values:

RMS <-> dBu

1mV = -58
7.7mV = -40
24.5mV = -30
77.4mV = -20
138mV = -15
0.24V = -10
0.43V = -5
0.775V = 0
1.38V = +5
2.45V = +10
4V = +14.3
6V = +17.8
8V = +20.3
10V = +22.2
 
Since the "attenuator" is on your function generator, pressing the "attenuator" 30 dB button will decrease the output level by 30 dB.

With no attenuator buttons pushed, the function generator would be at whatever level you set the output at. The attenuator attenuates the signal, that is, decreases the level you set by the dB button you pushed. If there are multiple buttons and you pressed more than one, the output would decrease by the sum of the buttons pressed.
 
MrAl
2048 is easy try 511
I just find it's easier if initial groups are 1 to 256 and 257 to 511 rather than 0 to 255.5 and 255.1 to 511. You get the idea.
 
on the one hand that sounds daft as logic would say sound or any other signal would eventually just diminish to nothing. but from what i have read things change but never actually go, so there is as many atoms in the universe now as there ever was! was really is hard to get the head around :D

Unfortunately, the number of atoms isn't the same, every heavy atom was made from lighter atoms. So every gold atom was once many hydrogen atoms that were squashed together in a star. In fact, you're made of stardust.

You'll find lot's of examples in science where as you go through school the simplified explanation you were given are replaced with more complex ones. Don't worry about it though as it's the only way to learn the complex stuff. I still don't fully understand some scientific stuff.

Edit, and with regard to your other thread, I'll never understand those creatures with the bumpy bits.:wideyed:

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top