public static int GetSampleRate(SampleRatesEnum sampleRate) { switch (sampleRate) { case SampleRatesEnum.Fs3K: return Fs3K; case SampleRatesEnum.Fs7K: return Fs7K; case SampleRatesEnum.Fs15K: return Fs15K; case SampleRatesEnum.Fs30K: return Fs30K; case SampleRatesEnum.Fs60K: return Fs60K; case SampleRatesEnum.Fs90K: return Fs90K; case SampleRatesEnum.Fs120K: return Fs120K; case SampleRatesEnum.Fs150K: return Fs150K; case SampleRatesEnum.Fs180K: return Fs180K; case SampleRatesEnum.Fs210K: return Fs210K; case SampleRatesEnum.Fs240K: return Fs240K; case SampleRatesEnum.Fs270K: return Fs270K; case SampleRatesEnum.Fs300K: return Fs300K; case SampleRatesEnum.Fs330K: return Fs330K; case SampleRatesEnum.Fs360K: return Fs360K; case SampleRatesEnum.Fs390K: return Fs390K; case SampleRatesEnum.Fs420K: return Fs420K; case SampleRatesEnum.Fs450K: return Fs450K; default: throw new ArgumentException(); } }
public static int GetCutoffFrequency(SampleRatesEnum sampleRate) { switch (sampleRate) { case SampleRatesEnum.Fs3K: return F1K; case SampleRatesEnum.Fs7K: return F2_5K; case SampleRatesEnum.Fs15K: return F5K; case SampleRatesEnum.Fs30K: return F10K; case SampleRatesEnum.Fs60K: return F20K; case SampleRatesEnum.Fs90K: return F30K; case SampleRatesEnum.Fs120K: return F40K; case SampleRatesEnum.Fs150K: return F50K; case SampleRatesEnum.Fs180K: return F60K; case SampleRatesEnum.Fs210K: return F70K; case SampleRatesEnum.Fs240K: return F80K; case SampleRatesEnum.Fs270K: return F90K; case SampleRatesEnum.Fs300K: return F100K; case SampleRatesEnum.Fs330K: return F110K; case SampleRatesEnum.Fs360K: return F120K; case SampleRatesEnum.Fs390K: return F130K; case SampleRatesEnum.Fs420K: return F140K; case SampleRatesEnum.Fs450K: return F150K; default: throw new ArgumentException(); } }
public DiscretizationParameters(SampleRatesEnum sampleRate, FrequencyResolutionsEnum resolution) { _sampleRate = SampleRates.GetSampleRate(sampleRate); _frequencyResolution = FrequencyResolutions.GetFrequencyResolution(resolution); _cutoffFrequency = CutoffFrequencies.GetCutoffFrequency(sampleRate); _pointsNumber = (int)(_sampleRate / _frequencyResolution); }