I'm trying to plot some sine waves (code example in plain js here).
When freq is "low" (
freq = 10 hz in that case), the plot is quite nice:
The problem is when I increase the freq (try to set
var freq = 50 for example):
lots of ripples, it becomes distorted and not so good as plot. If I increment it more, even worse (
var freq = 8030 for example is terrible).
When I see those kind of graph on pro systems, they are displayed just fine.
How would you improve it? FFT, splines, whatever? Which is the right approch?
I don't really need accurancy (i.e. for waveform analysis or whatever), just plot it nicely (as in Desmos https://www.desmos.com/calculator/eodkjlywjh, for example).