TU ANUNCIO / YOUR PUBLICITY

AQUÍ PODRÍA ESTAR TU ANUNCIO: / HERE COULD BE YOUR AD E-mail

sábado, 9 de septiembre de 2017

Estadística cartográfica. El centrado.

Continúa de: / Continues from:
http://carreteras-laser-escaner.blogspot.com/2017/05/estadistica-cartografica.html

Siguiendo con el ejemplo del arquero supongamos que tenemos la siguiente situación:
Following the example of the archer, suppose that we have the following situation:


La diana de la derecha corresponderá al arquero olímpico y la de la izquierda al arquero principiante. Está claro que reduciríamos el error si desplazáramos el centro de masas de los disparos al centro de la diana. 

Cuando el valor de la unidad a evaluar es único (el centro) está claro que simplemente añadiremos un desplazamiento:

The target on the right will correspond to the Olympic goalkeeper and the one on the left to the beginner goalkeeper. It is clear that we would reduce the error if we moved the center of mass of the shots to the center of the target.

When the value of the unit to be evaluated is unique (the center) it is clear that we will simply add a displacement:

Medición buscada = Medición obtenida + desplazamiento
Measurement sought = Measurement obtained + displacement

Mb = Mo + d

Cuando en lugar de tener que ponderar un valor hay que ponderar un rango de valores 

When instead of having to weigh a value one must consider a range of values



Podemos ir complicando esta ecuación según sean más los valores a comparar. Es decir si "d" es función de la medición. d pasa  a ser d(M)
We can complicate this equation depending on the values to be compared. That is, if "d" is a function of the measurement. d happens to be d (M)

Mb = Mo + d(M)

Si comparásemos entre dos estados podríamos tener:
If we compare between two states we could have:

Mb = a·Mo + b

Entre tres estados la función más simple sería:
Among three states the simplest function would be:

Mb = a·Mo2 +b· Mo + c

Entre cuatro estados:
Among four states:

Mb = a·Mo3 + b·Mo2 + c· Mo + d

Etcétera.

Para ello, tendríamos que tomar diferentes Mi , extrapolar sus medias Mb y con respecto a varias Mo y deducir {a, b, ...}

Aumentaríamos la precisión obteniendo los polinomios de regresión en lugar de los polinomios pasantes. Claro está que tendríamos que tener más parejas [MoMb] que coeficientes.

For this, we would have to take different Mi, extrapolate their Mb means and with respect to several Mo and deduce {a, b, ...}

We would increase the precision by obtaining the regression polynomials. Of course we would have to have more partners [Mo, Mb] than coefficients.

Caso práctico, la estimación del ruido con un dispositivo Android 

Case study, estimating noise with an Android device


Empezaremos a estudiar una de las posibles mediciones que se pueden hacer con un dispositivo con Android, el ruido. Tenemos un aparato con micrófono y no es muy difícil encontrar un código en Android para realizar mediciones de ruido. Podemos ver un buen artículo en: http://androcode.es/2012/01/tutorial-medidor-de-decibelios/
We begin a study of the possible measurements can be made with an Android: noise. We have a device with a microphone and it is not very difficult to find a code in Android to make noise measurements. We can see a good article in: http://androcode.es/2012/01/tutorial-medidor-de-decibelios/

Simplificando, tenemos un clase "MediaRecorder" y una función accesible en dicha clase: ".getMaxAmplitude()". Si creamos la variable AMPLI y queremos tener el resultado en dB utilizaremos la siguiente función: 
Simplifying, we have a "MediaRecorder" class and an accessible function in that class: ".getMaxAmplitude ()". If we create the variable AMPLI and want to have the result in dB we will use the following function:
dB = 20·log10(AMPLI / 32768.0)

Resulta demasido fácil. Como siempre, no hay que creerse a la primera todo lo que dice Internet. Si se puede, hay que experimentar un poco. Basta con tener dos dispositivos diferentes para darnos cuenta de que miden diferente. Si además teneos un sonómetro calibrado veremos que tienen bastante error. De esta manera obtendremos las parejas [MoMb].

It is too easy. As always, you do not have to believe everything the Internet says. If you can, you have to experiment a bit. It is enough to have two different devices to realize that they measure differently. If you also have a calibrated sound level meter we will see that they have enough error. In this way we will obtain the pairs [Mo, Mb].

A continuación exponemos en una gráfica los resultados comparados e con dos dispositivos y un sonómetro con varias mediciones en rangos de 30 a 90 dB.
Next, we show on a graph the results compared with two devices and a calibrated sound level meter with several measurements in ranges of 30 to 90 dB.

En rojo, valores del sonómetro, en azul y verde, cada dispositivo

La fuente de ruido fue escalonandose y se hicieron las comparaciones cuando el sonómetro marcaba los valores de 35.8, 35.8, 42.1, 47.8, 51.0, 56.0, 60.2, 63.5, 66.8 y 71.2 dB.
Se tomaron 30 medidas en cada escalón.

The noise source was put to work and the comparisons were made when the sound level meter marked the values of 35.8, 35.8, 42.1, 47.8, 51.0, 56.0, 60.2, 63.5, 66.8 and 71.2 dB.
30 measurements were taken in each step.

Si nos fijamos en cualquiera de los grupos de datos y los ordenamos de mayor a menor,
If we look at any of the data groups and order them from largest to smallest,


No esperábamos que se asemejase tanto a una distribución normal.
De aquí lo más relevante, partiendo del artículo anterior sería el buscar la manera de ir disminuyendo el error.
We did not expect it to resemble a normal distribution so much.
From here the most relevant, starting from the previous article would be to find a way to decrease the error.

Errores de partida: / Starting errors:


Inicialmente estos son los errores máximos y medios de cada dispositivo (en valores absolutos)
Initially these are the maximum and average errors of each device (in absolute values)

Dispositivo 1 Dispositivo 2
              Device 1     Device 2
Error máx.: 7,37422222 8,65268813
Error medio: 2,739146563 3,020950081

Si de cada grupo de mediciones hubiéramos promediado:
If we had averaged each group of measurements:

Sonometro Disp 1 Disp 2 Error1 Error2
35,8         39,17 37,74 3,37 1,94
42,1         44,72 45,06 2,62 2,96
47,8         50,47 51,91 2,67 4,11
51,0         52,65 53,68 1,65 2,68
56,0         56,90 58,07 0,90 2,07
60,2         60,34 60,86 0,14 0,66
63,5         62,66 66,22 0,84 2,72
66,8         63,40 71,51 3,40 4,71
71,2         63,83 79,17 7,37 7,97
           Disp 1 Disp 2
Error máx.: 7,37 7,97
Error medio: 2,55   3,31

Aparentemente no parece que tengan que reducir. Pero, si se obtienen las aproximaciones polinómicas y se invierten:
Apparently it does not seem that they have to reduce. But, if polynomial approximations are obtained and reversed:


Para el dispositivo 1: / For device 1:
y = -0,0092x2 + 1,744x - 11,99 se despeja x=94.78 - raiz(8983.7429+108.69565(-11.99-y))
Para el dispositivo 2: / For device 2:
y = 0,0088x2 + 0,1473x + 22,569 se despeja x=-8.3693 + raiz(70.045487-113.6364(22.569-y))


Siendo "y" los valores de la tabla anterior y colocando como "x" los de la nueva tabla, se obtiene:
Being "y" the values of the previous table and placing "x" those of the new table, you get:

Sonometro    Disp 1 disp2 Error1 Error2
sound level meter
35,8         36,27 33,98 0,48 1,82
42,1         41,67 42,87 0,42 0,77
47,8         47,93  49,97 0,13 2,18
51,0         50,53  51,67 0,46 0,68
56,0         56,10 55,69 0,10 0,31
60,2         61,28  58,12 1,08 2,08
63,5         65,28  62,55 1,78 0,94
66,8         66,69 66,67 0,10 0,13
71,2         67,52 72,26  3,68 1,06
Disp 1 Disp 2
Error máx.: 3,68 2,18
Error medio: 0,92 1,11

Hemos pasado de grandes errores de casi 8dB (recordemos la escala logarítmica de los decibelios) a errores de 1dB. Para ello hemos tomado 30 mediciones en cada valor de ruido y realizado una aproximación con un polinomio de regresión de grado 2.
We have gone from big errors of almost 8dB (remember the logarithmic scale of the decibels) to 1dB errors. For this we have taken 30 measurements in each noise value and performed an approximation with a regression polynomial of degree 2.

Para este artículo nos hemos aprovechado de la capacidad de las hojas de cálculo de calcular rápidamente los polinomios de regresión.
For this article we have taken advantage of the ability of spreadsheets to quickly calculate regression polynomials.




No hay comentarios:

Publicar un comentario