OK need help here. This recomputes the entire fourier transform on any change of freq1 and freq2. using calcXformArray, which is expensive. What I really want is to just display and store the result of averageArrays in an array which I can then plot. To see the whole frequency range, you would need to sweep freq2 over the whole range.
Thanks! I think I can get the hang of reactive style if I can figure out where to store persistent results. Almost there. Some less-great things that need refactoring, getCosineArray()[0] doesn't change so could be precomputed (how do I set the x axis labels to it though?)
Did some refactoring so things are better. What I want to do now is put the 2 plots above this next to each other, so the red dot tracks the red line. I'm sure there's a better way than <table> lol