-
Notifications
You must be signed in to change notification settings - Fork 55
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
gam::Saw output range: has DC offset and exceeds 1.0 #51
Comments
also tagging @mantaraya36 and @kybr ... |
I think that this might be expected behaviour. For a geometrically perfect sawtooth you would expect no DC and strict limits on (-1, 1). Of course, those sound awful. However, gam::Saw is bandlimited. It is designed to sound like a sawtooth and not introduce aliasing. (I think. I could be wrong.) Consider Synthesis of Quasi-Bandlimited Analog Waveforms Using Frequency Modulation (Schoffhauzer 2005). That implementation of Saw and Square/Pulse does not stay in (-1, 1) and it always has some DC offset. Also, when you look at the waveforms it makes... they don't really look like Saw or Square/Pulse. They sound right though. |
gam::Saw is bandlimited, it seems like it uses BLIT integration (http://musicdsp.org/files/waveforms.txt) I was asking if there's more proper way to map the result to [-1:1] rather than just subtracting some value like 0.5... dc offset should not matter that much but value above 1.0 seemed weird for me |
Yep, it's using BLIT integration. It might be possible to fix it to give the expected range [-1,1], but I'm not exactly sure. I suspect the odd range is because it uses a leaky integrator to kill DC and that may be distorting the wave shape due to its non-linear phase response. You might want to check out DWO::up or DWO::down. They are not exactly band limited, but have far less aliasing than a naive saw and give the expected range. |
Thank you for suggesting DWO! part of the result from program attached at the bottom is:
It seems like first few thousand samples are off-range before stabilization of the integration.
|
output of below program is:
min: -0.625428, max: 1.02889
is there a way to normalize this output to [-1.0 : 1.0] ?
The text was updated successfully, but these errors were encountered: