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

Implementation of Direct Scale Transform Feature #1434

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

dhunstack
Copy link
Contributor

[feat] Complete Implementation of Direct Scale Transform

  • Added parameters in header file
  • Added configure function
  • Added first order difference and matrix multiplication code

[feat] Add tests for Direct Scale Transform
Add the following tests:

  • Invalid Parameters Test
  • Invalid Inputs Test
  • Zero Input Test
  • Regression Test to compare with original Python implementation

- Added parameters in header file
- Added configure function
- Added first order difference and matrix multiplication code

Signed-off-by: Anmol Mishra <[email protected]>
Add the following tests:
 - Invalid Parameters Test
 - Invalid Inputs Test
 - Zero Input Test
 - Regression Test to compare with original Python implementation

Signed-off-by: Anmol Mishra <[email protected]>
@dbogdanov
Copy link
Member

Let's replace the .txt files with .npy binaries for numerical data in tests.

#include "directscaletransform.h"
#include "essentiamath.h"

#define FOR(i,l,r) for(int i=l; i<r; i++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's avoid using this define for clarify.

"This code was derived from the original DST paper:\n"
"[1] Williams, W. J., and E. J. Zalubas. Helicopter transmission fault detection via "
"time-frequency, scale and spectral methods. Mechanical systems and signal processing"
"14.4 (2000): 545-559.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some reference implementation we could additionally cite here?

std::complex<Real> zi = std::complex<Real>(0, 1);
Real step = M_PI/log(N+1);
int num_rows = _C/step+1; // Number of rows. +1 because need to include the first row which is the 0th multiple of step
int P = matrix[0].size();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no guarantee on the consistency of the size of inner vectors, because we are using vector of vectors. Therefore, this should be checked.

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

Successfully merging this pull request may close these issues.

2 participants