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
989 B
43 lines
989 B
6 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Text;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
namespace Signal_Generator
|
||
|
{
|
||
|
class FmSignal : IAnalogSignal
|
||
|
{
|
||
|
private double ampl = 0;
|
||
|
private double freq = 0;
|
||
|
private IAnalogSignal modSignal;
|
||
|
|
||
|
public string ParamsToString
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
return this.ToString() +
|
||
|
" | А = " + ampl +
|
||
|
" | f = " + freq;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return "FM signal";
|
||
|
}
|
||
|
|
||
|
public FmSignal(double ampl, double freq, IAnalogSignal modSignal)
|
||
|
{
|
||
|
this.ampl = ampl;
|
||
|
this.freq = freq;
|
||
|
this.modSignal = modSignal;
|
||
|
}
|
||
|
|
||
|
public double currentAmplitude(double t)
|
||
|
{
|
||
|
return ampl * Math.Sin(2 * Math.PI * freq * t + modSignal.currentAmplitude(t));
|
||
|
}
|
||
|
}
|
||
|
}
|