Skip to content

Commit

Permalink
Merge pull request #9 from Justin-Johnson/svf-magnitude
Browse files Browse the repository at this point in the history
Implemented SVF magnitude (and phase), + refactoring
  • Loading branch information
Justin-Johnson committed Nov 23, 2021
2 parents 05ab5c4 + 2869370 commit c788797
Show file tree
Hide file tree
Showing 7 changed files with 756 additions and 1,186 deletions.
609 changes: 291 additions & 318 deletions ReEQ.jsfx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ReSpectrum.jsfx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Version: v1.0.1

The MIT License (MIT)

Copyright (c) 2020 Justin Johnson
Copyright (c) 2021 Justin Johnson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
104 changes: 63 additions & 41 deletions firhalfband.jsfx-inc
Original file line number Diff line number Diff line change
@@ -1,46 +1,68 @@
desc:FIR Filter Half Band
/*
* FIR Half band filter
* Copyright (C) 2018 Justin Johnson
* License: LGPL - http://www.gnu.org/licenses/lgpl.html
*
* Reference: http://www.labbookpages.co.uk/audio/firWindowing.html
*
* This filter is designed to do one job and do it well and as fast as JSFX can muster (almost).
*
* It's a half band low pass 65 tap FIR filter meant for use with oversampling x2.
*
* For 44.1Khz: At 88.2kHz it filters out frequencies after 22050hz which gets rid of aliasing introduced
* by zero filling when oversampling.
*
* The filter is steep and uses the following vars (44.1kHz):
*
* Fa = 0
* Fb = 22050
* length = 65
* Fs = 88200
* Att = 96db
*
* From here:
*
* http://arc.id.au/FilterDesign.html
*
* Example:
*
* // DAW sample rate 44.1kHz (left channel given, same for right channel)
* // Oversampling x 2
*
* @init
* firL.init_FIR_filter_44100();
*
* @sample
* y0 = left.do_process(spl0); // Apply application filters and other processing etc
* y1 = left.do_process(0); // Zero padding
*
* spl0 = firL.do_FIR_filter(y0) * 2; // First fir application
* firL.do_FIR_filter(y1); // Discard (crude decimation, only do this if you're
* // not generating harmonics, ie. clean EQ)
*
FIR Half band filter

The MIT License (MIT)

Copyright (c) 2021 Justin Johnson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---

Reference: http://www.labbookpages.co.uk/audio/firWindowing.html

This filter is designed to do one job and do it well and as fast as JSFX can muster (almost).

It's a half band low pass 65 tap FIR filter meant for use with oversampling x2.

For 44.1Khz: At 88.2kHz it filters out frequencies after 22050hz which gets rid of aliasing introduced
by zero filling when oversampling.

The filter is steep and uses the following vars (44.1kHz):

Fa = 0
Fb = 22050
length = 65
Fs = 88200
Att = 96db

From here:

http://arc.id.au/FilterDesign.html

Example:

// DAW sample rate 44.1kHz (left channel given, same for right channel)
// Oversampling x 2

@init
firL.init_FIR_filter_44100();

@sample
y0 = left.do_process(spl0); // Apply application filters and other processing etc
y1 = left.do_process(0); // Zero padding

spl0 = firL.do_FIR_filter(y0) * 2; // First fir application
firL.do_FIR_filter(y1); // Discard (crude decimation, only do this if you're
// not generating harmonics, ie. clean EQ)

*/

@init
Expand Down

0 comments on commit c788797

Please sign in to comment.