Old 04-21-2014, 06:17 PM   #1
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
Default JS FFT plugin to export frequency bands?

Hello all,

is it possible to create a JS FX where I could hard-code a bunch of frequency ranges and have each band output to a different channel?
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Argitoth is offline   Reply With Quote
Old 04-22-2014, 09:43 AM   #2
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

Look at the 3Band, 4Band, and 5Band Splitter/Joiner plugins in the Effects/LOSER folder. Do one of those do the job?

In other words, even though these are first-order filters and aren't FFT, are they enough to get the job done? If you want high-order, even FFT needs to be done carefully. E.g. if you simply zero out any bins that aren't going to a certain channel, then you'll introduce ringing.

Last edited by SaulT; 04-22-2014 at 10:08 AM.
SaulT is offline   Reply With Quote
Old 04-22-2014, 11:27 AM   #3
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
Default

I need up to 24 bands, needs to be linear phase. The 5 band splitter might be an example of what I could use, the only problem is that I may need to get in-between frequency ranges, for example 80 to 120 and 260 to 340, NOT 0 to 120 and 120 to 340, you know? Edit: This could be simulated by simply ignoring in-between splits, so in essence I'd need a 48 band splitter.

Let me see what band splitter can do...
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template

Last edited by Argitoth; 04-22-2014 at 11:50 AM.
Argitoth is offline   Reply With Quote
Old 04-22-2014, 12:45 PM   #4
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
Default

Hmm, ok, so it looks like band splitter is exactly what I need except I need to split the sound into its sinusoidal components, and band splitter is unable to capture single frequencies. I imagine it's using standard bandpass filters. So I need something like band splitter except it needs 24 bands and brickwall filtering (FFT/linear phase filter) and have a sufficient window size to ensure no buzzing/artifacts.

Edit: I don't need "in-between" frequency ranges. I actually do want 0 to 150, 150 to 300, 300 to 600, etc.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template

Last edited by Argitoth; 04-22-2014 at 12:57 PM.
Argitoth is offline   Reply With Quote
Old 04-22-2014, 01:20 PM   #5
gwok
Human being with feelings
 
gwok's Avatar
 
Join Date: Jun 2010
Location: canada
Posts: 3,396
Default

reafir>subract mode>precise?
gwok is offline   Reply With Quote
Old 04-22-2014, 01:56 PM   #6
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
Default

Quote:
Originally Posted by gwok View Post
reafir>subract mode>precise?
highly impractical. if ReaFIR could be edited via text, then maybe, but hand-selecting each band is impossible.

actually I just learned I need something more like 100 bands. multiples of 100hz up to 10,000hz
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Argitoth is offline   Reply With Quote
Old 04-22-2014, 01:56 PM   #7
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

Well, I'm imagining FIR filters... which is actually doable, and with a pretty steep roll-off if you don't mind the computation time and potential sample delay involved. 24 parallel FIR filters of what I imagine to be at least a hundred taps each?
SaulT is offline   Reply With Quote
Old 04-22-2014, 05:09 PM   #8
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
Default

wait, so what's the window size of 24 FIR filters? I thought we do things in "window sizes" when working with FFT.

I intend to use this effect offline only. Load as effect, then hit the render button... or just use the batch processor dialog and load the effect there.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Argitoth is offline   Reply With Quote
Old 04-23-2014, 04:27 PM   #9
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

With FFT, you are basically analyzing a snapshot with n number of bins in it. The higher the number of bins, the better the frequency resolution, but the worse it does in the time domain... that's because you have to fill those bins before you can take the snapshot. With linear phase FIR filters there is a sample delay of n/2 samples, where n is the number of taps. More taps means better frequency resolution, but you suffer in the time domain - you have to wait for the samples to make their way to the middle of the filter.

Sooo, "window size" and "number of bins" with FFT is similar to "number of taps" with a FIR filter. Both are perfectly suitable for offline rendering, because you no longer have to worry about time delay. The question is one of implementation.

The perfect "brickwall" filter doesn't exist - there are always trade-offs. With FFT, my understanding is that even if you want to isolate a frequency you still can't just zero out the frequencies you don't want - that can cause artifacts and ringing. You have to have a "roll-off" on either side of the target frequency. With FIR, you have to increase your number of taps to get a steeper and more precise filter, but if you have too many (over 1000? more?) you can have pre-ringing.

While I understand how to create a lowpass windowed sinc filter, I do not currently know how to turn that into a bandpass filter. The information is out there, somewhere, but I haven't come across it yet. Working on it.

EDIT - Seriously, like 5 minutes after posting that, I found the method. Funny how that works. I'll start working on a way to implement it.

Last edited by SaulT; 04-23-2014 at 04:58 PM.
SaulT is offline   Reply With Quote
Old 04-23-2014, 05:11 PM   #10
reapercurious
Human being with feelings
 
reapercurious's Avatar
 
Join Date: Jul 2007
Posts: 1,890
Default

sounds brilliant SaulT

just the other day i manually set up a massive routing array with reafirs to get this effect because i was manually trying to create a vocoder.

so, essentially this is the business end of a vocoder with individual channel outputs for each band. all thats missing is the sidechain gate.

do want.
reapercurious is offline   Reply With Quote
Old 04-23-2014, 05:28 PM   #11
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
Default

I discovered that it is very important, when trying to isolate harmonics of an acoustic wave (with noise inbetween each harmonic) that you limit the bandwidth of each band. With 100 band, I could isolate 50 harmonics (it will be a band of noise, then a band of a harmonic, noise, harmonic, noise, harmonic).

I am essentially trying to divide a sound 51 times. 50 individual harmonics, plus 1 that will contain ALL that is not in the other 50; so, basically 1 noise channel and 50 harmonic channels.

Yes, acoustic waves are complex, yes they may not stay in tune thus harmonics may jump in and out of a specified band, but I will be working with acoustic waves that are almost as perfect as synthesized saw wavs, so complexity of the sound is not a concern. A simple implementation is all I need!

Edit: BTW, for a reference of sound quality I am trying to achieve -- adobe audition's FFT/spectrogram editor provides sufficient sound quality when cutting/pasting frequency bands.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template

Last edited by Argitoth; 04-23-2014 at 05:41 PM.
Argitoth is offline   Reply With Quote
Old 04-24-2014, 08:27 AM   #12
toddhisattva
Human being with feelings
 
toddhisattva's Avatar
 
Join Date: Jun 2008
Location: Austin
Posts: 289
Default Coralation

Maybe what you want to do is a correlation with a (co)sine at each of your target frequencies?

http://www.dspguide.com/ch7/3.htm
toddhisattva is offline   Reply With Quote
Old 04-24-2014, 10:23 AM   #13
GregHolmes
Human being with feelings
 
GregHolmes's Avatar
 
Join Date: Sep 2009
Location: Ontario, Canada
Posts: 399
Default

That link states "Correlation is the optimal technique for detecting a known waveform in random noise", which got me thinking about a plugin that would accept a complex signal (music/speech) and a simple signal (sine at certain freq), and output the simple signal at a level depending on when/if it occurs in the complex signal. Then I thought about vocoders, which led to:

New Correlation Vocoder
http://scitation.aip.org/content/asa...1121/1.1910126

I used to experiment with signal processing on the Fairlight CMI.
__________________
Greg Holmes | play:GregHolmes.com | work:GHServices.com
GregHolmes is offline   Reply With Quote
Old 04-24-2014, 06:06 PM   #14
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
Default

I'd be willing to pay anyone interesting in helping me create this js effect. PM me if your interested.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Argitoth is offline   Reply With Quote
Old 05-12-2014, 04:08 AM   #15
reapercurious
Human being with feelings
 
reapercurious's Avatar
 
Join Date: Jul 2007
Posts: 1,890
Default

i think all you need is the front half of a vocoder plugin, and you could give each band its own channel out.

the trouble is porting the code to js, i dont think theres a vocoder in JS yet.
reapercurious is offline   Reply With Quote
Reply

Thread Tools
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


All times are GMT -7. The time now is 03:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.