Skip to content

Commit

Permalink
[python] Add flags to analysis.room_modes
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Jul 16, 2024
1 parent cf51171 commit 2e0fb49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion run_3d.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ $engine_exe
cd "$python_dir"
python -m sim3d.process_outputs --data_dir="$sim_dir" --fcut_lowpass "$fmax" --N_order_lowpass=8 --symmetric --fcut_lowcut 20.0 --N_order_lowcut=4 --air_abs_filter="none" --save_wav --plot
python -m analysis.t60 --data_dir="$sim_dir" --fmin=20 --fmax="$fmax"
python -m analysis.room_modes --data_dir="$sim_dir"
python -m analysis.room_modes --data_dir="$sim_dir" --fmin=10 --fmax=200 --modes=10
4 changes: 2 additions & 2 deletions src/python/analysis/room_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument('--data_dir', type=str, help='run directory')
parser.add_argument('--fmax', type=float, default=0.0)
parser.add_argument('--fmin', type=float, default=10.0)
parser.add_argument('--modes', type=int, default=0)
args = parser.parse_args()

Expand Down Expand Up @@ -141,7 +142,7 @@ def main():
mode_freqs = [mode['frequency'] for mode in modes][:args.modes]
for file in files:
fs, buf = wavfile.read(file)
fmin = 1
fmin = args.fmin if args.fmin > 0 else 10
fmax = args.fmax if args.fmax > 0 else fs/2

nfft = (2**iceil(np.log2(buf.shape[0])))*2
Expand Down Expand Up @@ -170,7 +171,6 @@ def main():
plt.xscale('log')
plt.ylim((dB_max-80, dB_max+10))
plt.xlim((fmin, fmax))
# plt.margins(0, 0.1)
plt.grid(which='minor', color='#DDDDDD', linestyle=':', linewidth=0.5)
plt.minorticks_on()
plt.legend()
Expand Down

0 comments on commit 2e0fb49

Please sign in to comment.