Skip to content

Generate

Sambit Paul edited this page Jun 2, 2020 · 10 revisions

The Generate class helps to generate waveforms for certain periodic functions. As of now, the class supports generating the following functions:

  1. Sine Wave
  2. Cosine Wave
  3. Square Wave

All the signals generated here have a sampling frequency of 100Hz and signal frequency of 10Hz.

Sine Wave

sine

int Fs = 100;
Generate gp = new Generate(Fs);
int f1 = 10;
double[] out = gp.generateSineWave(f1);

Cosine Wave

cosine

int Fs = 100;
Generate gp = new Generate(Fs);
int f1 = 10;
double[] out = gp.generateCosineWave(f1);

Square Wave

square

int Fs = 100;
Generate gp = new Generate(Fs);
int f1 = 10;
double[] out = gp.generateSquareWave(f1);
Clone this wiki locally