fw: some plumbing
This commit is contained in:
parent
5088ff3ae9
commit
863391aaae
3 changed files with 9 additions and 7 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 63ff1482d42547422896418d5990a66a80e88d34
|
||||
Subproject commit 9349f519af7e9a34f2e66de0c8b1ef90b5de28fa
|
||||
|
|
@ -18,7 +18,6 @@ def generate_noisy_signal(
|
|||
test_signal_amplitude=20e-3,
|
||||
noise_level=10e-3,
|
||||
noise_spec='synth://grid_freq_psd_spl_108pt.json',
|
||||
f_nom=50.0,
|
||||
seed=0):
|
||||
|
||||
#test_data = np.random.RandomState(seed=0).randint(0, 2 * (2**test_nbits), test_duration)
|
||||
|
|
@ -31,7 +30,7 @@ def generate_noisy_signal(
|
|||
|
||||
noise_gen, noise_params = load_noise_gen(noise_spec)
|
||||
noise = noise_gen(seed, len(signal), **noise_params)
|
||||
return np.absolute(noise + f_nom + signal*test_signal_amplitude)
|
||||
return np.absolute(noise + signal*test_signal_amplitude)
|
||||
|
||||
def write_raw_frequencies_bin(outfile, **kwargs):
|
||||
with open(outfile, 'wb') as f:
|
||||
|
|
@ -84,7 +83,6 @@ def hum_cmd(args):
|
|||
test_signal_amplitude = args.signal_level/1e3,
|
||||
noise_level = args.noise_level/1e3,
|
||||
noise_spec=args.noise_spec,
|
||||
f_nom = args.nominal_frequency,
|
||||
seed = args.random_seed)
|
||||
|
||||
|
||||
|
|
@ -102,7 +100,6 @@ if __name__ == '__main__':
|
|||
hum_parser.add_argument('-n', '--noise-level', type=float, default=1.0, help='Scale synthetic noise level')
|
||||
hum_parser.add_argument('-s', '--signal-level', type=float, default=20.0, help='Synthetic noise level in mHz')
|
||||
hum_parser.add_argument('-d', '--decimation', type=int, default=10, help='DSSS modulation decimation in frequency measurement cycles')
|
||||
hum_parser.add_argument('-o', '--nominal-frequency', type=float, default=50.0, help='Nominal mains frequency')
|
||||
hum_parser.add_argument('-r', '--random-seed', type=int, default=0)
|
||||
hum_parser.add_argument('--noise-spec', type=str, default='synth://grid_freq_psd_spl_108pt.json')
|
||||
hum_parser.add_argument('out_flac', metavar='out.flac', help='FLAC output file')
|
||||
|
|
|
|||
|
|
@ -230,8 +230,13 @@ if __name__ == '__main__':
|
|||
return '#ddf7f4', None
|
||||
|
||||
with wrap('digraph G', print) as lvl1print:
|
||||
print('size="23.4,16.5!";')
|
||||
print('graph [fontsize=40];')
|
||||
print('node [fontsize=40];')
|
||||
#print('ratio="fill";')
|
||||
|
||||
print('rankdir=LR;')
|
||||
print('ranksep=1;')
|
||||
print('ranksep=5;')
|
||||
print('nodesep=0.2;')
|
||||
print()
|
||||
|
||||
|
|
@ -242,7 +247,7 @@ if __name__ == '__main__':
|
|||
print(f'bgcolor = "{highlight_color}";')
|
||||
print('pencolor = none;')
|
||||
fc, cc = vhex(objs[obj]/max_osize)
|
||||
highlight_subdir_part = f'<font face="carlito" color="{cc}" point-size="12">{highlight_head} / </font>' if highlight_head else ''
|
||||
highlight_subdir_part = f'<font face="carlito" color="{cc}" point-size="40">{highlight_head} / </font>' if highlight_head else ''
|
||||
lvl2print(f'label = <<table border="0"><tr><td border="0" cellpadding="5" bgcolor="{fc}">'
|
||||
f'{highlight_subdir_part}'
|
||||
f'<font face="carlito" color="{cc}"><b>{path.basename(obj)} ({objs[obj]}B)</b></font>'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue