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

Internal limited gaussian distribution function should not clip edge values #319

Closed
3 tasks
w7sst opened this issue Jun 9, 2024 · 0 comments · Fixed by #322
Closed
3 tasks

Internal limited gaussian distribution function should not clip edge values #319

w7sst opened this issue Jun 9, 2024 · 0 comments · Fixed by #322
Assignees
Labels
bug Something isn't working

Comments

@w7sst
Copy link
Owner

w7sst commented Jun 9, 2024

Description

The internal gaussian distribution function, RndGaussLim(AMean, ALim), currently uses a clipping algorithm to eliminate values above and below the specified limit argument. This creates an unwanted spike on the edges of the probability distribution curve. The improved algorithm is to eliminate these over-the-limit values by dropping them.

This function is used in the implementation of the following behaviors:

  • delay time for a calling station to wait before sending next transmission.
  • when creating a station, its Pitch is computed using Gaussian Limit function.
    • For Single Calls, Pitch is in range [-50, 50] (e.g. RndGaussLim(0, 50))
    • For other modes, Pitch is set to a value in the range [-300, 300] (e.g. RndGaussLim(0, 300)
  • when creating Qrm stations, their Pitch is set to a value in the range [-300, 300] (e.g. RndGaussLim(0, 300))

Steps To Reproduce

This problem was found by code inspection and cannot be readily reproduced with the application.

Expected behavior

Values outside of the limited gaussian distribution should be eliminated, not clipped.

Actual Behavior

The current behavior is clipping these values. This may cause a higher percentage appearance of these edge values.

Version information

  • Morse Runner version: found in 1.84, but has probably been in the code for a long time, perhaps since 1.68.

Additional context

This article has an example showing the effects of clipping a limited gaussian distribution.

BTW, I discovered this problem while looking at a reported possible audio clipping problem. The user was using a bluetooth headset during copy. Initially my thought was centered around clipping of the audio signal. This was not the case. However, I stumbled across the implementation of RndGaussLim(AMean, ALimit) and discovered it was using a clipping algorithm (min/max) which clips the value at the two end values. This technique results in a non-gaussian distribution.

Tasks

  • Coding
  • Code review and integration
  • Validation
@w7sst w7sst added the bug Something isn't working label Jun 9, 2024
@w7sst w7sst added this to the v1.85 - next release milestone Jun 9, 2024
@w7sst w7sst self-assigned this Jun 9, 2024
@w7sst w7sst closed this as completed in f6379dc Jun 14, 2024
@w7sst w7sst linked a pull request Jun 14, 2024 that will close this issue
w7sst added a commit that referenced this issue Jun 14, 2024
- The internal RndGaussLim() function was clipping values outside of the
specified limits. This resulted in a non-gaussian distribution.
- The fix is now discarding any over-limit values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant