You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
994 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Signal_Generator
{
class SinusoidalSignal : IAnalogSignal
{
private double ampl = 0;
private double freq = 0;
private double phase = 0;
public string ParamsToString
{
get
{
return this.ToString() +
" | A = " + ampl +
" | f = " + freq +
" | phi = " + phase;
}
}
public override string ToString()
{
return "SIN signal";
}
public SinusoidalSignal(double ampl, double freq, double phase = 0)
{
this.ampl = ampl;
this.freq = freq;
this.phase = phase;
}
public double currentAmplitude(double t)
{
return ampl * Math.Sin(2 * Math.PI * freq * t + phase);
}
}
}