diff --git a/sound_meter/NSRT_MK4_change_config.py b/sound_meter/NSRT_MK4_change_config.py index c6d34d7..4671afd 100644 --- a/sound_meter/NSRT_MK4_change_config.py +++ b/sound_meter/NSRT_MK4_change_config.py @@ -19,6 +19,8 @@ write_fs(frequency: int) -> sampling freq ''' import nsrt_mk3_dev +from nsrt_mk3_dev import Weighting + nsrt = nsrt_mk3_dev.NsrtMk3Dev('/dev/ttyACM0') @@ -27,6 +29,14 @@ nsrt = nsrt_mk3_dev.NsrtMk3Dev('/dev/ttyACM0') nsrt.write_tau(60) ##################### +##################### +#change Weighting curve +# - Weighting.DB_A (A-weighting - most common for environmental noise) +# - Weighting.DB_C (C-weighting - for peak measurements) +# - Weighting.DB_Z (Z-weighting - linear/flat response) +nsrt.write_weighting(Weighting.DB_A) +##################### + freq_level = nsrt.read_fs() #current sampling frequency time_constant = nsrt.read_tau() #reads the current time constant leq_level = nsrt.read_leq() #current running LEQ and starts the integration of a new LEQ. diff --git a/sound_meter/NSRT_mk4_get_data.py b/sound_meter/NSRT_mk4_get_data.py index adb6def..a1c00c5 100644 --- a/sound_meter/NSRT_mk4_get_data.py +++ b/sound_meter/NSRT_mk4_get_data.py @@ -5,7 +5,7 @@ ___) | |_| | |_| | |\ | |_| | |____/ \___/ \___/|_| \_|____/ -python3 /var/www/nebuleair_pro_4g/sound_meter/get_data.py +python3 /var/www/nebuleair_pro_4g/sound_meter/NSRT_mk4_get_data.py Script to get data from the NSRT_MK4 Sound Level Meter @@ -42,7 +42,7 @@ rtc_time_str = row[1] # '2025-02-07 12:30:45' freq_level = nsrt.read_fs() #current sampling frequency time_constant = nsrt.read_tau() #reads the current time constant leq_level = nsrt.read_leq() #current running LEQ and starts the integration of a new LEQ. -weighting = nsrt.read_weighting() #weighting curve that is currently selected +weighting = nsrt.read_weighting() #weighting curve that is currently selected ( A ou C) weighted_level = nsrt.read_level() #current running level in dB. #print(f'current sampling freq : {freq_level} Hz')