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