|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
namespace Signal_Generator
|
|
|
|
{
|
|
|
|
class FmSignal : AnalogSignalMethods, IAnalogSignal
|
|
|
|
{
|
|
|
|
public Collection<Parameter> paramsCollection { get; set; }
|
|
|
|
|
|
|
|
public string typeToString
|
|
|
|
{
|
|
|
|
get { return "FM сигнал"; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public new string paramsToString
|
|
|
|
{
|
|
|
|
get { return paramsToString(paramsCollection); }
|
|
|
|
}
|
|
|
|
|
|
|
|
public FmSignal(double ampl, double freq, double ampl2)
|
|
|
|
{
|
|
|
|
paramsCollection = new Collection<Parameter>();
|
|
|
|
paramsCollection.Add(new Parameter("Амплитуда несущей", ampl));
|
|
|
|
paramsCollection.Add(new Parameter("Частота несущей", freq));
|
|
|
|
paramsCollection.Add(new Parameter("Амплитуда", ampl2));
|
|
|
|
}
|
|
|
|
|
|
|
|
public double currentAmplitude(double t)
|
|
|
|
{
|
|
|
|
var c = paramsCollection.ToArray<Parameter>();
|
|
|
|
return c[0].value * Math.Sin(2 * 3.14 * c[1].value* t + c[2].value * Math.Sin(t));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|