本文整理汇总了C#中IFilter.Load方法的典型用法代码示例。如果您正苦于以下问题:C# IFilter.Load方法的具体用法?C# IFilter.Load怎么用?C# IFilter.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFilter
的用法示例。
在下文中一共展示了IFilter.Load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FrequencyResponseFromQuadratureTimeDomain
/// <summary>
/// Sweeps across a filter in quadrature domains (sine and cosine) to find the
/// frequency response. Is interesting because this is a simulation of a real filter,
/// which may be the only way to analyze a black box object that implements IFilter.
/// </summary>
public FrequencyResponseFromQuadratureTimeDomain(IFilter Filter,
double startFreq, double stopFreq, double operateFreq, double runTime, int sampleRate)
{
samplerate = (int)sampleRate;
numPoints = (int)(runTime * operateFreq);
opFreq = operateFreq;
sweep = new FrequencySweep(startFreq, stopFreq, 1 / operateFreq, numPoints);
iFilter = (IFilter)Filter.Clone();
qFilter = (IFilter)Filter.Clone();
iFilter.Load(0.0);
qFilter.Load(1.0);
}
示例2: GetResponse
/// <summary>
/// Calculate the step response of an IFilter object using an arbitrary length.
/// </summary>
/// <param name="filter">The filter to use when calculating the step response.</param>
/// <param name="length">The length of the impulse response to calculate.</param>
/// <returns>The step response with the provided length.</returns>
public static double[] GetResponse(IFilter filter, int length)
{
double[] response = new double[length];
filter.Load(0);
response[0] = filter.GetOutput(1);
for (int i = 1; i < length; i++)
response[i] = filter.GetOutput(1);
return response;
}