- #1
Deepsatchel
- 6
- 0
Hi everyone,
So I'm trying to basically generate a list of numbers between 20 and 20,000 (Hz) in log space that will give good resolution to parts of the audio spectrum that matter! After all that is the point of using log scale for frequency in the first place.
The list generator I have at this point gives very fine resolution between 20 and 100 Hz, and when it gets closer to 20kHz, it's counting by the thousands. A good audio log scale should expand the lows and compress the highs, but not to this degree! What I'm doing is unaltered "log," I believe. Here's exactly what my code looks like:
top = 20000
bottom = 20
bands = 12
loop i from 0 to bands
nextBand = 10^((i/bands)*log10(top-bottom+1))-1+bottom;
save the new frequency value to the list...
end loop
The result:
20, 21, 24, 30, 46, 80, 160, 341, 755, 1699, 3854, 8773, 20000.
In practice I will use many more bands. When I use 400 bands (a reasonable use case), I get 96 of them in the 20's! That is way too many. So if straight logarithmic scale is not what's normally used, then what is? I noticed pictures of Adobe Audition's spectral analyzer on Google Images had scales that seemed approximately logarithmic but expanded more in the middle than regular log.
Anyone know about this?
Thanks, Elwood
So I'm trying to basically generate a list of numbers between 20 and 20,000 (Hz) in log space that will give good resolution to parts of the audio spectrum that matter! After all that is the point of using log scale for frequency in the first place.
The list generator I have at this point gives very fine resolution between 20 and 100 Hz, and when it gets closer to 20kHz, it's counting by the thousands. A good audio log scale should expand the lows and compress the highs, but not to this degree! What I'm doing is unaltered "log," I believe. Here's exactly what my code looks like:
top = 20000
bottom = 20
bands = 12
loop i from 0 to bands
nextBand = 10^((i/bands)*log10(top-bottom+1))-1+bottom;
save the new frequency value to the list...
end loop
The result:
20, 21, 24, 30, 46, 80, 160, 341, 755, 1699, 3854, 8773, 20000.
In practice I will use many more bands. When I use 400 bands (a reasonable use case), I get 96 of them in the 20's! That is way too many. So if straight logarithmic scale is not what's normally used, then what is? I noticed pictures of Adobe Audition's spectral analyzer on Google Images had scales that seemed approximately logarithmic but expanded more in the middle than regular log.
Anyone know about this?
Thanks, Elwood