/** * Updates the filter bank. * * (Re)creates new filter bank when sample frequency or spectrum size * changed. If requested, enables only some filters. * * @param frequency sample frequency * @param N spectrum size */ protected virtual void UpdateFilters(uint frequency, int N) { if (filters == null) { filters = new MelFiltersBank(frequency, 200, N); } else { if (filters.GetSampleFrequency() != frequency || filters.GetSpectrumLength() != N) { if (filters != null) { filters.Dispose(); } filters = new MelFiltersBank(frequency, 200, N); } } if (enabledFilters.Length != 0) { filters.SetEnabledFilters(enabledFilters); } }
/** * Updates the filter bank. * * (Re)creates new filter bank when sample frequency or spectrum size * changed. If requested, enables only some filters. * * @param frequency sample frequency * @param N spectrum size */ protected new void UpdateFilters(uint frequency, int N) { if (hfccFilters == null) { hfccFilters = new MelFiltersBank(frequency, N, true); } else { if (hfccFilters.GetSampleFrequency() != frequency || hfccFilters.GetSpectrumLength() != N) { if (hfccFilters != null) { hfccFilters.Dispose(); } hfccFilters = new MelFiltersBank(frequency, N, true); } } if (enabledFilters.Length != 0) { hfccFilters.SetEnabledFilters(enabledFilters); } }
/** * Updates the filter bank. * * (Re)creates new filter bank when sample frequency or spectrum size * changed. If requested, enables only some filters. * * @param frequency sample frequency * @param N spectrum size */ protected virtual void UpdateFilters(uint frequency, int N) { if (filters == null) { filters = new MelFiltersBank(frequency, 200, N); } else { if (filters.GetSampleFrequency() != frequency || filters.GetSpectrumLength() != N) { if (filters != null) filters.Dispose(); filters = new MelFiltersBank(frequency, 200, N); } } if (enabledFilters.Length != 0) filters.SetEnabledFilters(enabledFilters); }
/** * Updates the filter bank. * * (Re)creates new filter bank when sample frequency or spectrum size * changed. If requested, enables only some filters. * * @param frequency sample frequency * @param N spectrum size */ protected new void UpdateFilters(uint frequency, int N) { if (hfccFilters == null) { hfccFilters = new MelFiltersBank(frequency, N, true); } else { if (hfccFilters.GetSampleFrequency() != frequency || hfccFilters.GetSpectrumLength() != N) { if (hfccFilters != null) hfccFilters.Dispose(); hfccFilters = new MelFiltersBank(frequency, N, true); } } if (enabledFilters.Length != 0) hfccFilters.SetEnabledFilters(enabledFilters); }