public TransformAPIModel(int size) { signals = new SignalsModel(size); transform = new TransformModel(new WindowsSetModel()); filter = new RectangleFilter(); ManageModel = new SignalsManageModel(); SignalsChanged = new StateNotification(() => Transform()); TransformChanged = new StateNotification(() => { }); }
public void DeInit() { WindowManager.WindowActived -= WindowManager_WindowActived; WindowManager.TopMostChanged -= WindowManager_TopMostChanged; FormManager.Activated -= FormManager_Activated; FormManager.Deactivated -= FormManager_Deactivated; windowFilter = null; sortingFormDatas = null; formDic = null; }
public void Init() { formDic = new Dictionary <IntPtr, FormData>(50); sortingFormDatas = new List <FormData>(50); windowFilter = new WindowsFilter(); WindowManager.WindowActived += WindowManager_WindowActived; WindowManager.TopMostChanged += WindowManager_TopMostChanged; FormManager.Showed += FormManager_Showed; FormManager.Closed += FormManager_Closed; }
public Spectrum Transform(WindowedTransformStuff stuff, ISignal signal, IWindowFilter filter) { var times = signal.GetLength() / stuff.WinStep - 1; var spec = new Spectrum(stuff.CountFreq, times, signal.GetActualLength()); //var log = new Logger("windowed_transform.log"); //log.WriteLog(String.Format("Times: {0}", times)); //log.Flush(); var c = 128; for (var i = 0; i < times; i++) { var tr = Transform(stuff, filter.GetFiltered(signal, c, stuff.WinSize)).GetFreqsAtTime(0); spec.SetAtTime(i, tr); c += stuff.WinStep; } return(spec); }