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

Fourier #300

Draft
wants to merge 4 commits into
base: development
Choose a base branch
from
Draft

Fourier #300

wants to merge 4 commits into from

Conversation

BalzaniEdoardo
Copy link
Collaborator

Add a Fourier basis.

This PR adds a Fourier basis. The API is as follows:

import nemos as nmo
import numpy as np
import matplotlib.pyplot as plt

# this configuration exclude the 0 frequency creating 2*n_frequencies bases.
bas = nmo.basis.FourierEval(n_frequencies=5)
out = bas.compute_features(np.linspace(0, 1, 200))

plt.figure()
plt.title("No 0 frequency")
plt.plot(out)
plt.show()

# this configuration exclude the 0 frequency creating 2*n_frequencies bases + 1.
bas = nmo.basis.FourierEval(n_frequencies=5, include_constant=True)
out = bas.compute_features(np.linspace(0, 1, 200))

plt.figure()
plt.title("Include 0 frequency")
plt.plot(out)
plt.show()

@BalzaniEdoardo BalzaniEdoardo marked this pull request as draft January 23, 2025 21:44
@billbrod billbrod mentioned this pull request Jan 28, 2025
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