Comments (5)
If
rate
is integral multiple offreq
It isn't for most values of freq
... but let's assume it is.
If freq
is set to 441Hz, and rate
is set to 44100 samples per second, then omega
will be:
2 * PI * 441 / 44100 = 0.06283185307179585
Then sn
and cs
will be:
Sin(0.06283185307179585) = 0.06279051952931336
Cos(0.06283185307179585) = 0.9980267284282716
That being said, now that I'm looking at the code, if freq
<= 0 or >= rate/2
, then it looks like your logic is right -- sn
will be 0, which gets a divide by zero. If I trace the sources of freq
, I can see that a user could pass in a 0 for basslpf
in the advanced options, and cause that to happen.
So I think the clamp should probably be fixed.
from sndfilter.
I just run into the case that freq >= rate/2
with default settings with all presets other than LARGEHALL1
and LARGEHALL2
. With the same input, only LARGEHALL1
and LARGEHALL2
work, all other presets will zero out the samples because of the divide by zero issue.
from sndfilter.
I don't have time to fix at the moment, but a quick fix is to simply change the biquad coefficients to be a passthrough. In order to do that, you set b0
to 1
, and the rest (b1
, b2
, a1
, a2
) to 0
.
from sndfilter.
I don't have time to fix at the moment, but a quick fix is to simply change the biquad coefficients to be a passthrough. In order to do that, you set
b0
to1
, and the rest (b1
,b2
,a1
,a2
) to0
.
I set alpha
to 1 when sn
is 0, which seemed to work as expected.
from sndfilter.
thanks, sorry it took so long to fix, I don't check here often but I had some free time today
from sndfilter.
Related Issues (13)
- Reverb performance issue HOT 5
- IIR filter math wrong? HOT 1
- reverb algorithm performance HOT 1
- Expander/Upward compressor HOT 1
- Sidechain compression?
- How to control wetness/dryness of reverb without repopulating entirely? HOT 1
- Possible bug in down sample function in reverb? HOT 5
- Biquad filter is hard clipping the audio
- Something is weird with the compressor?
- Request Audio Wav sample test
- License issue? HOT 4
- using a compressor on streaming audio HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sndfilter.