You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder whether line 16 in amdf.js does what it is supposed to do: const minPeriod = Math.round(sampleRate / maxFrequency + 0.5);
As I understand it, this expression calculates the ratio sampleRate / maxFrequency, hence the
amount of samples that would theoretically occur during one cycle of maxFrequency.
The rounding expression then basically truncates all digits right of the decimal point and adds 1.
For the calculation of maxPeriod this makes sense, since one doesn't want to miss a signal at minimum frequency, so the rounded maxPeriod should definitely not be smaller than the "floating-point" maxPeriod.
Doesn't that mean for minPeriod conversely, that it's rounded value should definitely not be greater than the fractional value?
Example: With sampleRate = 44100 and maxFrequency = 400, the ratio sampleRate/maxFrequency is 110,25.
According to the rounding mechanism in line 16 that would yield minPeriod = 111.
In my opinion this should yield 110.
The text was updated successfully, but these errors were encountered:
I wonder whether line 16 in amdf.js does what it is supposed to do:
const minPeriod = Math.round(sampleRate / maxFrequency + 0.5);
As I understand it, this expression calculates the ratio sampleRate / maxFrequency, hence the
amount of samples that would theoretically occur during one cycle of maxFrequency.
The rounding expression then basically truncates all digits right of the decimal point and adds 1.
For the calculation of maxPeriod this makes sense, since one doesn't want to miss a signal at minimum frequency, so the rounded maxPeriod should definitely not be smaller than the "floating-point" maxPeriod.
Doesn't that mean for minPeriod conversely, that it's rounded value should definitely not be greater than the fractional value?
Example: With sampleRate = 44100 and maxFrequency = 400, the ratio sampleRate/maxFrequency is 110,25.
According to the rounding mechanism in line 16 that would yield minPeriod = 111.
In my opinion this should yield 110.
The text was updated successfully, but these errors were encountered: