psambit9791 / jdsp

A Java Library for Digital Signal Processing
https://jdsp.dev
MIT License
247 stars 43 forks source link

Use case question #55

Closed LobsterMan123 closed 1 year ago

LobsterMan123 commented 1 year ago

Would you please tell me if by calculating the "only positive absolute values" from JDSP when doing the Fourier transform, if this is sufficient, for a physical system I have that is oscillating back and forth, to obtain the constituent frequencies of oscillations in my system?

The code I'm using to calculate the only positive absolute values is below:

_Fourier ft = new DiscreteFourier(signal); // OR _Fourier ft = new FastFourier(signal); ft.transform(); boolean onlyPositive = true; double[] out = ft.getMagnitude(onlyPositive);

Thanks.

LM

psambit9791 commented 1 year ago

@LobsterMan123 Should be fine.