Fixed some bugs where I was treating sample data as an integer. Allows use with UHD without multiplying everything up by 64K. =)
Also changed the reference level printout to show dB instead of sample value. This seems more useful. 0dB is full scale.
This commit is contained in:
@@ -2,12 +2,15 @@
|
||||
#from string import split, join
|
||||
#from math import pi, floor, cos, acos
|
||||
import math, time
|
||||
#this implements CPR position decoding. local only for now.
|
||||
#this implements CPR position decoding.
|
||||
|
||||
latz = 15
|
||||
nbits = 17
|
||||
my_lat = 37.76225 #update these later!
|
||||
my_lon = -122.44254
|
||||
#my_lat = 37.76225 #update these later!
|
||||
#my_lon = -122.44254
|
||||
#ER
|
||||
my_lat = 37.40889176297184
|
||||
my_lon = -122.07765340805054
|
||||
|
||||
|
||||
def nz(ctype):
|
||||
@@ -229,8 +232,8 @@ def range_bearing(loc_a, loc_b):
|
||||
|
||||
avg_lat = (a_lat + b_lat) / 2.0
|
||||
|
||||
R1 = earth_radius_mi*(1.0-esquared)/pow((1.0-esquared*pow(math.sin(avg_lat),2)),1.5)
|
||||
|
||||
R1 = earth_radius_mi*(1.0-esquared)/pow((1.0-esquared*pow(math.sin(avg_lat),2)),1.5)
|
||||
|
||||
R2 = earth_radius_mi/math.sqrt(1.0-esquared*pow(math.sin(avg_lat),2))
|
||||
|
||||
distance_North = R1*delta_lat
|
||||
|
||||
Reference in New Issue
Block a user