Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename AMPLITUDE environment variables to MAGNITUDE #251

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions OrcanodeMonitor/Core/FfmpegCoreAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static double MaxSilenceMagnitude
{
get
{
string? maxSilenceMagnitudeString = Environment.GetEnvironmentVariable("ORCASOUND_MAX_SILENCE_AMPLITUDE");
string? maxSilenceMagnitudeString = Environment.GetEnvironmentVariable("ORCASOUND_MAX_SILENCE_MAGNITUDE");
double maxSilenceMagnitude = double.TryParse(maxSilenceMagnitudeString, out var magnitude) ? magnitude : _defaultMaxSilenceMagnitude;
return maxSilenceMagnitude;
}
Expand All @@ -91,7 +91,7 @@ public static double MinNoiseMagnitude
{
get
{
string? minNoiseMagnitudeString = Environment.GetEnvironmentVariable("ORCASOUND_MIN_NOISE_AMPLITUDE");
string? minNoiseMagnitudeString = Environment.GetEnvironmentVariable("ORCASOUND_MIN_NOISE_MAGNITUDE");
double minNoiseMagnitude = double.TryParse(minNoiseMagnitudeString, out var magnitude) ? magnitude : _defaultMinNoiseMagnitude;
return minNoiseMagnitude;
}
Expand Down
12 changes: 6 additions & 6 deletions docs/Design.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ The following state will be stored per orcanode:

**ORCASOUND_MIN_INTELLIGIBLE_SIGNAL_PERCENT**: The minimum percentage of total magnitude across all frequencies outside the hum range vs magnitude in hum range (multiples of 60 Hz), needed to determine that an audio stream is intelligible. Default: 150

**ORCASOUND_MAX_SILENCE_AMPLITUDE**: The maximum amplitude at which an stream stream might still be considered unintelligible due to silence. Default: 20
**ORCASOUND_MAX_SILENCE_MAGNITUDE**: The maximum magnitude at which a stream stream might still be considered unintelligible due to silence. Default: 20

**ORCASOUND_MIN_NOISE_AMPLITUDE**: The minimum amplitude at which an stream stream might still be considered intelligible. Default: 15
**ORCASOUND_MIN_NOISE_MAGNITUDE**: The minimum magnitude at which a stream stream might still be considered intelligible. Default: 15

These amplitude thresholds work together to implement hysteresis in the noise detection:
- Amplitudes below MIN_NOISE_AMPLITUDE are always considered silent.
- Amplitudes above MAX_SILENCE_AMPLITUDE are always considered noisy.
- Amplitudes between these thresholds maintain their previous state to prevent rapid oscillation between states.
These magnitude thresholds work together to implement hysteresis in the noise detection:
- Magnitudes below ORCASOUND_MIN_NOISE_MAGNITUDE are always considered silent.
- Magnitudes above ORCASOUND_MAX_SILENCE_MAGNITUDE are always considered noisy.
- Magnitudes between these thresholds maintain their previous state to prevent rapid oscillation between states.

## Web page front end

Expand Down
Loading