Skip to content

feat: add fft/base/fftpack/rfftf#12002

Draft
gunjjoshi wants to merge 1 commit intostdlib-js:developfrom
gunjjoshi:rfftf-v2
Draft

feat: add fft/base/fftpack/rfftf#12002
gunjjoshi wants to merge 1 commit intostdlib-js:developfrom
gunjjoshi:rfftf-v2

Conversation

@gunjjoshi
Copy link
Copy Markdown
Member


type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:

  • task: lint_filenames status: passed
  • task: lint_editorconfig status: passed
  • task: lint_markdown status: na
  • task: lint_package_json status: na
  • task: lint_repl_help status: na
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: na
  • task: lint_javascript_tests status: na
  • task: lint_javascript_benchmarks status: na
  • task: lint_python status: na
  • task: lint_r status: na
  • task: lint_c_src status: na
  • task: lint_c_examples status: na
  • task: lint_c_benchmarks status: na
  • task: lint_c_tests_fixtures status: na
  • task: lint_shell status: na
  • task: lint_typescript_declarations status: passed
  • task: lint_typescript_tests status: na
  • task: lint_license_headers status: passed ---

Resolves None.

Description

What is the purpose of this pull request?

This pull request:

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

None.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

Used AI to understand the implementation, reason about specific choices and to help write equations and explanations in implementation comments. Also referred it to understand the working of FFTs.


@stdlib-js/reviewers

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@gunjjoshi
Copy link
Copy Markdown
Member Author

Opened this draft PR to discuss the implementation or ask questions, if any, and to track progress.

Comment on lines +65 to +66
var TAUR = -0.5; // cos( 2π/3 )
var TAUI = 0.866025403784439; // sin( 2π/3 )
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I could have used math/base/special/sin and math/base/special/cos here, but instead I have hardcoded the exact constants used in pffft (Ref: https://github.com/marton78/pffft/blob/master/src/fftpack.c#L1308), to be as close as possible, to the actual results. Using math/base/special/sin and math/base/special/cos leads to slightly off results. If we are fine with that, I'll replace these hardcoded constants with stdlib functions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not must difference for sin, but there is some difference for cos:

In [5]: var cos = require('@stdlib/math/base/special/cos')
Out[5]: [Function: cos]

In [6]: cos((2*pi)/3)
Out[6]: -0.4999999999999998

In [7]: var cos = require('@stdlib/math/base/special/cosf')
Out[7]: [Function: cosf]

In [8]: var pi = require('@stdlib/constants/float32/pi')
Out[8]: 3.1415927410125732

In [9]: cos((2*pi)/3)
Out[9]: -0.5000000596046448

In [10]: 

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.

1 participant