-
Notifications
You must be signed in to change notification settings - Fork 7
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
Waveform Source outputs a constant function if frequency is too low #36
Comments
Can you share the sample rate and waveform rate that caused this. There is a little note about the resolution parameter here. Was resolution on automatic or something else?
|
Resolution was automatic; sample rate 1e6; frequency < 0.5 causes constant output. |
This is coded for; the stepUpdate function aborts and allows the step size to be 0 if the table size would exceed a million: https://github.com/pothosware/pothos-comms/blob/master/waveform/WaveformSource.cpp#L191 Is there a proper way to display to the user that this is an invalid frequency? |
The table lookup has a limited resolution. Small enough and eventually you cant allocate enough space for the table. std::sin and cos can be expensive, so the table is a nice optimization, but I can see where it breaks down. We might need a block that doesn't use a table, but performs the live calculation. Or make that a configurable option at least in the waveform source. Anyway, for this its probably best to log a warning when the calculated _step is significantly different than the (_freq/_rate). I want to throw a range error, but theres some need here to be careful that the error is only thrown after the freq, rate, and resolution are applied. We could accidentalaly cause the error while still applying settings. The FIR designer actually has a similar design, and it uses |
Note: could also use a sin/cos table rather than a waveform table. |
|
A quick debug shows that
_step
becomes zero, so_index
is never increased in the work function.The text was updated successfully, but these errors were encountered: