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

Possible bug in calculation of ACtivity and event count Summary indices #331

Open
towsey opened this issue Jul 10, 2020 · 4 comments
Open

Comments

@towsey
Copy link
Contributor

towsey commented Jul 10, 2020

Describe the bug

In the following method:
public static SummaryActivity CalculateActivity(double[] dBarray, TimeSpan frameStepDuration, double dbThreshold)
at line 84 of ActivityAndCover.cs, the dbThreshold argument is not used. Instead the default value of 6dB is used.
That means the user appears to have but actually has no control over this value.

Expected behavior

User should be able to set value of threshold and expect it to be used when calling this method.

Additional Details

This same method calculates both activity and event count.
The calculation of events seems unnecessarily complicated and could be simplified.

@towsey
Copy link
Contributor Author

towsey commented Jul 10, 2020

The calculation of summary indices derived from the waveform depends on a calculation of the envelope. Currently we take the max value in any frame. But the following is a better approach as it removes DC bias.
dB re full scale = 20 * log10((max-min)/65536)
This can be changed at this same time.

@atruskie
Copy link
Member

We use normalised values so the 65536 constant is incorrect there. Otherwise sounds good.

@towsey
Copy link
Contributor Author

towsey commented Jul 10, 2020

Also at line 144 in DSP_Frames.cs, the FFT window is set to Hamming whereas elsewhere the window has been set to Hanning.
string windowName = FFT.KeyHammingWindow;
The window name should default to Hanning.

@towsey
Copy link
Contributor Author

towsey commented Jul 10, 2020

It is now apparent that we are using the Hamming window in many places and Hanning in others.

towsey added a commit that referenced this issue Jul 30, 2020
Issue #331 Change bug in calculation of index: activity
atruskie pushed a commit that referenced this issue Jul 30, 2020
Issue #331 Change bug in calculation of index: activity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants