generate a waveform in json format