ejmahler / RustFFT

RustFFT is a high-performance FFT library written in pure Rust.
Apache License 2.0
678 stars 47 forks source link

More function supports like fftfreq #138

Open eweca-d opened 5 months ago

eweca-d commented 5 months ago

Thank you for this great crate! Do you have any plan to extend the functions like fftfreq and fftshift? It would be better to add more functions like what numpy.fft did. For example, the fftfreq can be helpful in the cases of drawing the frequency-amplitude curve. I have to write it everywhere if I need it right now. If it is approved, I can help to do it.

ejmahler commented 4 months ago

I've never heard of this. Do you have a link to a wikipedia article or some other resource I can check out?

eweca-d commented 4 months ago

I've never heard of this. Do you have a link to a wikipedia article or some other resource I can check out?

You can find the function in "https://numpy.org/doc/stable/reference/generated/numpy.fft.fftfreq.html" and its source Python code. It is very simply and just to generate the frequencies of "k/(N*T), k=0, 1, 2...N - 1" which is the sampled frequencies. It could be helpful to plot the frequency-amplitude figure.