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

input structure for custom functions #54

Open
peendebak opened this issue Dec 23, 2017 · 2 comments
Open

input structure for custom functions #54

peendebak opened this issue Dec 23, 2017 · 2 comments

Comments

@peendebak
Copy link

What is the reason for the npts argument of custom functions? E.g.

    def sine(freq, ampl, off, SR, npts):
        time = np.linspace(0, npts/SR, npts)
        freq *= 2*np.pi
        return (ampl*np.sin(freq*time)+off)

A format more user friendly seems to be:

    def sine(freq, ampl, off, times):
        freq *= 2*np.pi
        return (ampl*np.sin(freq*times)+off)

@WilliamHPNielsen @lucblom

@WilliamHPNielsen
Copy link
Contributor

The short answer: It eases things on the backend when forging (converting to arrays) that the sample rate and number of points are explicitly put in. I don't want to derive a sample rate from the times nor do I want to make sure that the times are well-behaved.

@WilliamHPNielsen
Copy link
Contributor

Aaaaand... I'm not so sure anymore. I actually think it's a good idea.

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

No branches or pull requests

2 participants