Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Logarithmic Spectrum Analyzer

For general discussion related FlowStone

Logarithmic Spectrum Analyzer

Postby SBAudio » Mon Apr 14, 2014 5:33 am

Hello everybody! First time poster, long time creeper here (and synthmaker too) 8-), and I figured It was finally time to ask for help.

So basically, I'm making a spectrum analyzer and I can't seem to figure out how to transform the frequency axis from linear to logarithmic. I'm not using the graph lines module, but using a draw loop to assign values from the FFT to color intensity of single lines. If anyone can give me some pointers, I'd be eternally grateful!

-Luke
Attachments
Display.fsm
(83.16 KiB) Downloaded 881 times
SBAudio
 
Posts: 6
Joined: Tue Jan 14, 2014 10:40 pm

Re: Logarithmic Spectrum Analyzer

Postby KG_is_back » Tue Apr 15, 2014 1:11 pm

Here you go. I reworked your x-indexing system a little. The draw loop outputs 0-1 (1/N) being the step), which is in case of linear scale multiplied by width and in case of logarithmic scaled by y=log10(1+x*9) which also outputs 0-1 but logarithmically scaled. That is also multiplied by width and viola...log scaled window. Also I had to redo the line widths, bacause in case of lin scaled the bar should be 1/N wide, but in case of logarithmic the width varies (lower bars are thicker than higher ones).
Attachments
Display_linlog.osm
(21.96 KiB) Downloaded 841 times
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Logarithmic Spectrum Analyzer

Postby KG_is_back » Tue Apr 15, 2014 1:33 pm

However the problem with your method is, that lines are drawn from center to sides...this is OK when drawing linear graphs but in logarithmic the width of the line to left should be different than width to right. So it is better to use rectangles instead of lines. Here - this one uses rectangles instead of lines - the width of all rectagles is width of the window, but ther x-offset changes. Rectangles of high frequencies overlap the right-side of the rectangle, so no rectangle-width correction is needed.
Attachments
Display_linlog.osm
(21.83 KiB) Downloaded 917 times
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Logarithmic Spectrum Analyzer

Postby tester » Tue Apr 15, 2014 2:23 pm

This will not start in synthmaker, it uses FS components.
Loads only in FS, so it's better to rename ext to fsm.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: Logarithmic Spectrum Analyzer

Postby SBAudio » Tue Apr 15, 2014 3:26 pm

Thanks for explaining, I understand much better now! I think using lines was messing with my head or something, but yours works great!
SBAudio
 
Posts: 6
Joined: Tue Jan 14, 2014 10:40 pm


Return to General

Who is online

Users browsing this forum: No registered users and 68 guests