Dogs On Acid :: The world’s largest dance music forum : Drum and Bass / Jungle / Electronic Music message board with news, reviews, dub plates, audio, video, free mixes, merchandise, mp3 store, clothing..........
Registered Member Not Registered Yet
Sign in Register Now
Members online: 3820 Posts on The Board: 9,526,544
Record number online: 33900 Posts on The Grid: 1,083,583
Recruited members: 117,896 Total number of posts: 10,999,544

Go Back  Dogs On Acid > The Grid Reload this Page > question about audio frequency log scale (maths)
 
 
« Previous Thread | Next Thread »
Author
Thread Reply
Registered User
 
Join Date: Apr 2004
Posts: 5,979
Rep Power: 217 parsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond repute
09-27-2011 10:06 AM
question about audio frequency log scale (maths)
So I'm writing a little program to generate a pitch sweepable sine wave.
It's easy enough to make it linear.
I have a seekbar with values from 20hz to 20khz, but I want to make it a log scale and I'm completely lost.


What's the equation to find the next interval (up or down) from a given frequency.

Or maybe, a better question, is how do convert and arbitrary linear scale to a log scale relevant to frequency?

My brain is now boogaloo
__________________

Youtube Glitch OST: Waay better than it sounds. a mixture of stuff from alva noto to ligeti to undersea recordings

doa thread here
parsley is offline  
Reply With Quote #1
Finger rollin rhythm
 
Join Date: May 2005
Age: 31
Posts: 555
Rep Power: 103 DrTiTus is a name known to allDrTiTus is a name known to allDrTiTus is a name known to allDrTiTus is a name known to allDrTiTus is a name known to allDrTiTus is a name known to all
Send a message via ICQ to DrTiTus Send a message via Yahoo to DrTiTus
09-28-2011 01:57 AM
Quote:
Originally Posted by parsley View Post
I have a seekbar with values from 20hz to 20khz, but I want to make it a log scale and I'm completely lost.

What's the equation to find the next interval (up or down) from a given frequency.

Or maybe, a better question, is how do convert and arbitrary linear scale to a log scale relevant to frequency?
The logarithm represents the exponent that 10 is raised to. That is, 100 = 10 to the power of 2, therefore log 100 = 2.

Similarly, 1000 = 10^3 so log 1000 = 3.

You would have an exponential function f(x) := 2*10^x
If you take values of x from 1 to 4 you'd get the familiar 20-20kHz sweep.
f(1) = 2*10^1 = 20 Hz
f(2) = 2*10^2 = 200 Hz
f(3) = 2*10^3 = 2 kHz
f(4) = 2*10^4 = 20 kHz

Rather than sweeping from 20 to 20 000 by a step of 1, you would sweep from 1 to 4 with a step of 0.01 (or whatever values are appropriate for the rate of change).

I hope that's of some use!
__________________
DrTiTus is offline  
Reply With Quote #2
Registered User
 
Join Date: Apr 2004
Posts: 5,979
Rep Power: 217 parsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond reputeparsley has a reputation beyond repute
09-28-2011 07:29 AM
Quote:
Originally Posted by DrTiTus View Post
The logarithm represents the exponent that 10 is raised to. That is, 100 = 10 to the power of 2, therefore log 100 = 2.

Similarly, 1000 = 10^3 so log 1000 = 3.

You would have an exponential function f(x) := 2*10^x
If you take values of x from 1 to 4 you'd get the familiar 20-20kHz sweep.
f(1) = 2*10^1 = 20 Hz
f(2) = 2*10^2 = 200 Hz
f(3) = 2*10^3 = 2 kHz
f(4) = 2*10^4 = 20 kHz

Rather than sweeping from 20 to 20 000 by a step of 1, you would sweep from 1 to 4 with a step of 0.01 (or whatever values are appropriate for the rate of change).

I hope that's of some use!
thats what i needed. that really helps it was very hard to find this information distilled like that. you are an absolute gent.
__________________

Youtube Glitch OST: Waay better than it sounds. a mixture of stuff from alva noto to ligeti to undersea recordings

doa thread here
parsley is offline  
Reply With Quote #3
 
Reply
 
« Previous Thread | Next Thread »
Thread Tools
Search this Thread
Search this Thread:

Advanced Search
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 

Similar Threads
Thread Thread Starter Forum Replies Last Post
maths question Mateyboy The Board 10 08-30-2010 11:56 AM
Maths Question chinablue The Board 26 01-02-2010 08:07 AM
Very Simple Maths Question finjetsu The Board 14 11-22-2007 04:15 PM
Maths (probability question)???? skribla The Board 30 04-18-2007 11:19 AM
Maths Question Editz The Board 14 08-25-2005 09:50 PM