Created
May 14, 2018 18:31
-
-
Save amilajack/dba229f284d2f0bd2467c169ee12096c to your computer and use it in GitHub Desktop.
FFT MATH 127
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.clear() | |
const l = 1; | |
const j = 1; | |
const m = 2; | |
const k = 2; | |
const d = 2; | |
const expression = [] | |
const baseExprStepB = "x(j*m + k*r)⍵\^{-r*k*j}"; | |
const baseExprStepC = "x(j*m + k*r + l)⍵^{-r*k*j}"; | |
const usingB = false; | |
String.prototype.replaceAll = function (find, replace) { | |
const str = this; | |
return str.replace(new RegExp(find, 'g'), replace); | |
}; | |
for (let r = 0; r < d; r++) { | |
expression.push( | |
(usingB ? baseExprStepB : baseExprStepC) | |
.replaceAll('j', j) | |
.replaceAll('k', k) | |
.replaceAll('m', m) | |
.replaceAll('l', l) | |
.replaceAll('r', r) | |
) | |
} | |
// y(jk + l) = | |
usingB | |
? console.log(`y(${j*k}) = ${expression.join(' + ')}`) | |
: console.log(`y(${j*k + l}) = ${expression.join(' + ')}`) | |
function soo(str) { | |
return str | |
.replaceAll('j', j) | |
.replaceAll('k', k) | |
.replaceAll('m', m) | |
.replaceAll('l', l) | |
.replaceAll('r', r) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment