Skip to content

Commit

Permalink
mavfft_isb: add triple notch option
Browse files Browse the repository at this point in the history
allow for pre- and post-filter data labelling
  • Loading branch information
andyp1per authored and tridge committed Jul 3, 2022
1 parent 4a8b143 commit e7c725d
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tools/mavfft_isb.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ def __str__(self):
window = {}
S2 = {}
hntch_mode_names = { 0:"No", 1:"Throttle", 2:"RPM", 3:"ESC", 4:"FFT"}
hntch_option_names = { 0:"Single", 1:"Double", 2:"Dynamic", 4:"Loop-Rate"}
batch_mode_names = { 0:"Pre-filter", 1:"Sensor-rate", 2:"Post-filter" }
hntch_option_names = { 0:"Single", 1:"Double", 2:"Dynamic", 4:"Loop-Rate", 8:"AllIMUs", 16:"Triple"}
batch_mode_names = { 0:"Pre-filter", 1:"Sensor-rate", 2:"Post-filter", 4:"Pre+post-filter" }
fft_peak = int(args.fft_peak)

first_freq = None
Expand Down Expand Up @@ -282,15 +282,25 @@ def __str__(self):

if hntch_mode is not None and hntch_option is not None and batch_mode is not None:
option_label = ""
for hopt in hntch_option_names:
batch_label = ""
for hopt, hname in hntch_option_names.items():
if hopt & int(hntch_option) != 0:
if len(option_label) > 0:
option_label += "+"
option_label += hntch_option_names[hopt]
option_label += hname
if int(hntch_option) == 0:
option_label = hntch_option_names[0]
for bopt, bname in batch_mode_names.items():
if bopt & int(batch_mode) != 0:
if len(batch_label) > 0:
batch_label += "+"
batch_label += bname
if int(batch_mode) == 0:
option_label = batch_mode_names[0]
textstr = '\n'.join((
r'%s tracking' % (hntch_mode_names[hntch_mode], ),
r'%s notch' % (option_label, ),
r'%s sampling' % (batch_mode_names[batch_mode], )))
r'%s sampling' % (batch_label, )))

props = dict(boxstyle='round', facecolor='wheat', alpha=0.5)

Expand Down

0 comments on commit e7c725d

Please sign in to comment.