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

FFTphase function #58

Closed
aquilesr opened this issue Feb 13, 2023 · 5 comments · Fixed by #64
Closed

FFTphase function #58

aquilesr opened this issue Feb 13, 2023 · 5 comments · Fixed by #64

Comments

@aquilesr
Copy link

This would be a very useful function to be able to recreate the shape of a wave

@swharden
Copy link
Owner

Hi @aquilesr, can you clarify the feature request? Linking to another library that does something similar, or a web page demonstrating this type of analysis would be very helpful.

Thanks!

@swharden
Copy link
Owner

Note that you can create your own array of complex numbers, apply the FFT, then read the result. My understanding is that the imaginary component of the resulting data represents phase.

https://github.com/swharden/FftSharp#fft-using-complex-numbers

@aquilesr
Copy link
Author

aquilesr commented Feb 13, 2023 via email

@swharden swharden reopened this Feb 13, 2023
@swharden swharden changed the title It remains to create the FFTphase function FFTphase function Feb 13, 2023
@swharden
Copy link
Owner

@swharden
Copy link
Owner

Took a while to get to it, but I'm adding this feature in now.

Note that one can measure phase like this:

double[] values = /* your data */
Complex[] fft = FftSharp.Transform.FFT(values);
double[] phases = fft.Select(x=>Math.Atan2(x.Imaginary, x.Real)).ToArray();

swharden added a commit that referenced this issue May 16, 2023
swharden added a commit that referenced this issue May 16, 2023
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 a pull request may close this issue.

2 participants