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

sine_freq in the SineGenerator class has inconsistent values #225

Closed
anupam-prasad opened this issue May 5, 2021 · 1 comment
Closed
Assignees

Comments

@anupam-prasad
Copy link
Collaborator

anupam-prasad commented May 5, 2021

The default value for sine_freq in the class constructor for SineGenerator is 5, whereas it is 50 in the built-in sine_wave_function method. Won't the first value always override the second one when it is defined this way?

def __init__(self, sfreq = 500, sine_freq=5):
        super().__init__()
        self.set_metadata("SineGenerator","time","s",("Voltage"),("V"),"Simple sine wave generator")
        self.set_generator_function(generator_function=self.sine_wave_function, sfreq=sfreq, sine_freq=sine_freq)

def sine_wave_function(self, time, sine_freq=50):
        """A simple sine wave generator"""
        amplitude = np.sin(2 * np.pi * sine_freq * time)
        return amplitude 
@anupam-prasad
Copy link
Collaborator Author

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

1 participant