Commit 8164fabb authored by Matthieu Cattin's avatar Matthieu Cattin

test09: Fix bug in attenuation conversion to dB.

Was using natural log instead of base 10 log. In python log() is natural log!
Tolerance values were converted using: new = 20*log10(e^(old/20))

Note that this wasn't affecting the test as the tolerance values were calculated
with the same (wrong) formula.
parent 25adefad
......@@ -67,22 +67,22 @@ points = [[10E3 , 0 , 1],
[18E6 , 0 , 2],
#[20E6 , 0 , 2],
[22E6 , 0 , 2],
[24E6 , -0.5, 2],
[26E6 , -1 , 2],
[28E6 , -2 , 2],
[30E6 , -3.5, 2],
#[32E6 , -4.5, 2],
#[34E6 , -6.5, 2],
#[36E6 , -8.5, 2],
#[38E6 , -10.5, 2],
[40E6 , -13.5, 2],
#[42E6 , -15 , 2],
#[44E6 , -17.5, 2],
#[46E6 , -20 , 2],
#[48E6 , -22.5, 2],
#[50E6 , -31 , 3],
[60E6 , -38 , 3],
[80E6 , -66 , 3]]
[24E6 , -0.217, 2],
[26E6 , -0.434, 2],
[28E6 , -0.869, 2],
[30E6 , -1.52, 2],
#[32E6 , -1.95, 2],
#[34E6 , -2.82, 2],
#[36E6 , -3.69, 2],
#[38E6 , -4.56, 2],
[40E6 , -5.86, 2],
#[42E6 , -6.51, 2],
#[44E6 , -7.6, 2],
#[46E6 , -8.68, 2],
#[48E6 , -9.77, 2],
#[50E6 , -13.46, 3],
[60E6 , -16.5, 3],
[80E6 , -28.66, 3]]
def open_all_channels(fmc):
......@@ -255,7 +255,7 @@ def main (default_directory='.'):
for ch in range(NB_CHANNELS):
vref = ch_ampl[ch][0]
print "Channel %d vref=%f"%(ch, vref)
ch_att[ch] = [(20*log(item/vref)) for item in ch_ampl[ch]]
ch_att[ch] = [(20*log10(item/vref)) for item in ch_ampl[ch]]
# Check that frequency response is in the limits
print "\nFrequency response check."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment