Logarithmic Frequency Sweep

DSP related issues, mathematics, processing and techniques
Post Reply
User avatar
SBMastering
Posts: 17
Joined: Tue Jun 12, 2012 11:47 pm

Logarithmic Frequency Sweep

Post by SBMastering »

Hi,

Some time ago I did a linear frequency sweep in Synthmaker. I'm attaching the FSM file.

I now have a necessity for a logarithmic frequency sweep instead. Does anyone have any ideas how this might be accomplished?
Attachments
Linear Frequency Sweep.fsm
(1.61 KiB) Downloaded 1591 times
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Logarithmic Frequency Sweep

Post by trogluddite »

A simple power function should get you a nice log sweep, for example...
freq = base_freq * (2 ^ time)
...would rise by one octave from the base_freq each time 'time'; increases by one. In Ruby, the power operator is '**' not '^', so it would be... freq = base_freq * (2 ** time)
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
SBMastering
Posts: 17
Joined: Tue Jun 12, 2012 11:47 pm

Re: Logarithmic Frequency Sweep

Post by SBMastering »

I couldn't get the power operator to work in the regular code window with "^". It just turns everything into black text. I have looked all over. I'd hope to avoid doing it in Ruby because I haven't been working in Ruby much yet and this just needs this one little tweak!

I'm posting a screenshot of the sweep. Also, please check out my uploaded example on my previous post.

Image

BTW, Trog, I am going to PM you about something unrelated.
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Logarithmic Frequency Sweep

Post by Tronic »

use pow(e,n) for ^
User avatar
SBMastering
Posts: 17
Joined: Tue Jun 12, 2012 11:47 pm

Re: Logarithmic Frequency Sweep

Post by SBMastering »

Ok, I got it working with pow and increasing logarithmically. Now I'm working on trying to figure out how to get it to decrease logarithmically after it reaches it's highest point.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: Logarithmic Frequency Sweep

Post by tester »

?

What makes the "movement" logarithmic - is the signal scaling itself, not direction you go. It works like this. If you rescale your values into (0-1) range, and apply lin to log transformation, then what will change is the curve between 0 and 1, but the range remains the same (then you may rescale it back into whatever you wish). By curve I mean corresponding y values to x values. In linear case y=x (or y=nx, depending on initial scaling). In other cases - all depends on what you used.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Post Reply