Open johnmgithub opened 3 years ago
Hello John,
Thanks for using the code! I am not sure if the change to the pnmask is a good idea, if I remember correctly this could lead to long term instability because of DC buildup from the CIC integrator. There is also no need to change coefficients, spectrum remains steady at 1/f independent of sample rate.
Best, Stefan
Hmm, didn't notice any issues but I haven't run the generator for more than 10 minutes or so at a time. Would it be better to have two zero entries in pnmask instead of the two 1 << 7 entries?
I'd recommend zeros, that should be sufficient to disable noise at a specific rate.
OK, thanks very much. I've updated the code section above as well.
Hi Stefan,
Just came across this, nice work! I do my programming in Java, so I made a Java version to investigate the algorithm. Code is below if of interest and contributed freely for any use. I made a slight change from your standard version, replacing the first zero entry in the pnmasks table by 1 << 7 to slightly reduce the low frequency extension and flatten off the spectrum at 5 Hz or so rather than 2.5 Hz, the aim being to keep generated levels a little more consistent across different interface low end rolloffs. I also adapted it to return single values rather than writing blocks of 16 samples.
Should there be an adaptation for different sample rates, different filter coefficient tables, perhaps?