nmr-processing 9.5.0 → 9.5.1-pre.1685396168
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/apodization/apodization.d.ts +6 -5
- package/lib/apodization/apodization.js +4 -1
- package/lib/apodization/apodization.js.map +1 -1
- package/lib/apodization/applyWindow.js.map +1 -1
- package/lib/apodization/compose.js.map +1 -1
- package/lib/apodization/getFunction.js +3 -0
- package/lib/apodization/getFunction.js.map +1 -1
- package/lib/apodization/shapes/WindowFunctions.d.ts +6 -1
- package/lib/apodization/shapes/sineBell.d.ts +27 -0
- package/lib/apodization/shapes/sineBell.js +17 -0
- package/lib/apodization/shapes/sineBell.js.map +1 -0
- package/lib/apodization/utils/getData.js.map +1 -1
- package/lib/constants/SignalsKinds.d.ts +9 -0
- package/lib/constants/SignalsKinds.js +40 -0
- package/lib/constants/SignalsKinds.js.map +1 -0
- package/lib/datum/Entry1D.d.ts +10 -0
- package/lib/datum/Entry1D.js +3 -0
- package/lib/datum/Entry1D.js.map +1 -0
- package/lib/datum/ExclusionZone.d.ts +5 -0
- package/lib/datum/ExclusionZone.js +3 -0
- package/lib/datum/ExclusionZone.js.map +1 -0
- package/lib/datum/Filters.d.ts +13 -0
- package/lib/datum/Filters.js +49 -0
- package/lib/datum/Filters.js.map +1 -0
- package/lib/datum/FiltersManager.d.ts +30 -0
- package/lib/datum/FiltersManager.js +184 -0
- package/lib/datum/FiltersManager.js.map +1 -0
- package/lib/datum/MatrixFilter.d.ts +39 -0
- package/lib/datum/MatrixFilter.js +3 -0
- package/lib/datum/MatrixFilter.js.map +1 -0
- package/lib/datum/MatrixOptions.d.ts +28 -0
- package/lib/datum/MatrixOptions.js +3 -0
- package/lib/datum/MatrixOptions.js.map +1 -0
- package/lib/datum/data1d/filter1d/apodization.d.ts +26 -0
- package/lib/datum/data1d/filter1d/apodization.js +75 -0
- package/lib/datum/data1d/filter1d/apodization.js.map +1 -0
- package/lib/datum/data1d/filter1d/baselineCorrection.d.ts +32 -0
- package/lib/datum/data1d/filter1d/baselineCorrection.js +61 -0
- package/lib/datum/data1d/filter1d/baselineCorrection.js.map +1 -0
- package/lib/datum/data1d/filter1d/digitalFilter.d.ts +18 -0
- package/lib/datum/data1d/filter1d/digitalFilter.js +47 -0
- package/lib/datum/data1d/filter1d/digitalFilter.js.map +1 -0
- package/lib/datum/data1d/filter1d/equallySpaced.d.ts +29 -0
- package/lib/datum/data1d/filter1d/equallySpaced.js +55 -0
- package/lib/datum/data1d/filter1d/equallySpaced.js.map +1 -0
- package/lib/datum/data1d/filter1d/exclusionZones.d.ts +11 -0
- package/lib/datum/data1d/filter1d/exclusionZones.js +35 -0
- package/lib/datum/data1d/filter1d/exclusionZones.js.map +1 -0
- package/lib/datum/data1d/filter1d/fft.d.ts +14 -0
- package/lib/datum/data1d/filter1d/fft.js +94 -0
- package/lib/datum/data1d/filter1d/fft.js.map +1 -0
- package/lib/datum/data1d/filter1d/phaseCorrection.d.ts +33 -0
- package/lib/datum/data1d/filter1d/phaseCorrection.js +84 -0
- package/lib/datum/data1d/filter1d/phaseCorrection.js.map +1 -0
- package/lib/datum/data1d/filter1d/shiftX.d.ts +16 -0
- package/lib/datum/data1d/filter1d/shiftX.js +30 -0
- package/lib/datum/data1d/filter1d/shiftX.js.map +1 -0
- package/lib/datum/data1d/filter1d/signalProcessing.d.ts +17 -0
- package/lib/datum/data1d/filter1d/signalProcessing.js +88 -0
- package/lib/datum/data1d/filter1d/signalProcessing.js.map +1 -0
- package/lib/datum/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +5 -0
- package/lib/datum/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +41 -0
- package/lib/datum/data1d/filter1d/utils/padDataToNextPowerOfTwo.js.map +1 -0
- package/lib/datum/data1d/filter1d/zeroFilling.d.ts +18 -0
- package/lib/datum/data1d/filter1d/zeroFilling.js +68 -0
- package/lib/datum/data1d/filter1d/zeroFilling.js.map +1 -0
- package/lib/datum/data1d/updateRelatives.d.ts +4 -0
- package/lib/datum/data1d/updateRelatives.js +36 -0
- package/lib/datum/data1d/updateRelatives.js.map +1 -0
- package/lib/datum/data1d/utils/RangeUtilities.d.ts +22 -0
- package/lib/datum/data1d/utils/RangeUtilities.js +83 -0
- package/lib/datum/data1d/utils/RangeUtilities.js.map +1 -0
- package/lib/datum/data1d/utils/checkIntegralKind.d.ts +7 -0
- package/lib/datum/data1d/utils/checkIntegralKind.js +14 -0
- package/lib/datum/data1d/utils/checkIntegralKind.js.map +1 -0
- package/lib/datum/data1d/utils/checkRangeKind.d.ts +2 -0
- package/lib/datum/data1d/utils/checkRangeKind.js +10 -0
- package/lib/datum/data1d/utils/checkRangeKind.js.map +1 -0
- package/lib/datum/data1d/utils/getShiftX.d.ts +2 -0
- package/lib/datum/data1d/utils/getShiftX.js +11 -0
- package/lib/datum/data1d/utils/getShiftX.js.map +1 -0
- package/lib/datum/data1d/utils/getSpectrumErrorValue.d.ts +2 -0
- package/lib/datum/data1d/utils/getSpectrumErrorValue.js +9 -0
- package/lib/datum/data1d/utils/getSpectrumErrorValue.js.map +1 -0
- package/lib/datum/data1d/utils/mapIntegrals.d.ts +13 -0
- package/lib/datum/data1d/utils/mapIntegrals.js +41 -0
- package/lib/datum/data1d/utils/mapIntegrals.js.map +1 -0
- package/lib/datum/data1d/utils/mapPeaks.d.ts +4 -0
- package/lib/datum/data1d/utils/mapPeaks.js +51 -0
- package/lib/datum/data1d/utils/mapPeaks.js.map +1 -0
- package/lib/datum/data1d/utils/mapRanges.d.ts +38 -0
- package/lib/datum/data1d/utils/mapRanges.js +84 -0
- package/lib/datum/data1d/utils/mapRanges.js.map +1 -0
- package/lib/datum/data1d/utils/updateIntegrals.d.ts +2 -0
- package/lib/datum/data1d/utils/updateIntegrals.js +11 -0
- package/lib/datum/data1d/utils/updateIntegrals.js.map +1 -0
- package/lib/datum/data1d/utils/updateIntegralsRelativeValues.d.ts +2 -0
- package/lib/datum/data1d/utils/updateIntegralsRelativeValues.js +10 -0
- package/lib/datum/data1d/utils/updateIntegralsRelativeValues.js.map +1 -0
- package/lib/datum/data1d/utils/updatePeaks.d.ts +2 -0
- package/lib/datum/data1d/utils/updatePeaks.js +12 -0
- package/lib/datum/data1d/utils/updatePeaks.js.map +1 -0
- package/lib/datum/data1d/utils/updateRanges.d.ts +2 -0
- package/lib/datum/data1d/utils/updateRanges.js +14 -0
- package/lib/datum/data1d/utils/updateRanges.js.map +1 -0
- package/lib/datum/data1d/utils/updateRangesRelativeValues.d.ts +2 -0
- package/lib/datum/data1d/utils/updateRangesRelativeValues.js +10 -0
- package/lib/datum/data1d/utils/updateRangesRelativeValues.js.map +1 -0
- package/lib/datum/data2d/filter2d/shiftX.d.ts +16 -0
- package/lib/datum/data2d/filter2d/shiftX.js +34 -0
- package/lib/datum/data2d/filter2d/shiftX.js.map +1 -0
- package/lib/datum/data2d/filter2d/shiftY.d.ts +16 -0
- package/lib/datum/data2d/filter2d/shiftY.js +34 -0
- package/lib/datum/data2d/filter2d/shiftY.js.map +1 -0
- package/lib/datum/data2d/utils/get2DSpectrumErrorValue.d.ts +6 -0
- package/lib/datum/data2d/utils/get2DSpectrumErrorValue.js +14 -0
- package/lib/datum/data2d/utils/get2DSpectrumErrorValue.js.map +1 -0
- package/lib/datum/data2d/utils/getShift.d.ts +6 -0
- package/lib/datum/data2d/utils/getShift.js +20 -0
- package/lib/datum/data2d/utils/getShift.js.map +1 -0
- package/lib/datum/data2d/utils/isZoneExists.d.ts +4 -0
- package/lib/datum/data2d/utils/isZoneExists.js +21 -0
- package/lib/datum/data2d/utils/isZoneExists.js.map +1 -0
- package/lib/datum/data2d/utils/mapZones.d.ts +34 -0
- package/lib/datum/data2d/utils/mapZones.js +68 -0
- package/lib/datum/data2d/utils/mapZones.js.map +1 -0
- package/lib/datum/data2d/utils/updateZones.d.ts +2 -0
- package/lib/datum/data2d/utils/updateZones.js +12 -0
- package/lib/datum/data2d/utils/updateZones.js.map +1 -0
- package/lib/index.d.ts +35 -0
- package/lib/index.js +27 -0
- package/lib/index.js.map +1 -1
- package/lib/signals/signalsToRanges.js.map +1 -1
- package/lib/signals/simulation/simulateXYPeaks.js.map +1 -1
- package/lib/signals/utils/jAnalyzer.d.ts +11 -8
- package/lib/signals/utils/jAnalyzer.js.map +1 -1
- package/lib/types/ContourOptions.d.ts +10 -0
- package/lib/types/ContourOptions.js +3 -0
- package/lib/types/ContourOptions.js.map +1 -0
- package/lib/types/Data1D.d.ts +5 -0
- package/lib/types/Data1D.js +3 -0
- package/lib/types/Data1D.js.map +1 -0
- package/lib/types/Data2D.d.ts +5 -0
- package/{lib-esm/xyz → lib/types}/Data2D.js.map +1 -1
- package/lib/types/Display.d.ts +3 -0
- package/lib/types/Display.js +3 -0
- package/lib/types/Display.js.map +1 -0
- package/lib/types/Display1D.d.ts +7 -0
- package/lib/types/Display1D.js +3 -0
- package/lib/types/Display1D.js.map +1 -0
- package/lib/types/Display2D.d.ts +11 -0
- package/lib/types/Display2D.js +3 -0
- package/lib/types/Display2D.js.map +1 -0
- package/lib/types/Filter.d.ts +11 -0
- package/lib/types/Filter.js +3 -0
- package/lib/types/Filter.js.map +1 -0
- package/lib/types/Info/Info.d.ts +15 -0
- package/lib/types/Info/Info.js +3 -0
- package/lib/types/Info/Info.js.map +1 -0
- package/lib/types/Info/Info1D.d.ts +13 -0
- package/lib/types/Info/Info1D.js +3 -0
- package/lib/types/Info/Info1D.js.map +1 -0
- package/lib/types/Info/Info2D.d.ts +10 -0
- package/lib/types/Info/Info2D.js +3 -0
- package/lib/types/Info/Info2D.js.map +1 -0
- package/lib/types/Integral.d.ts +10 -0
- package/lib/types/Integral.js +3 -0
- package/lib/types/Integral.js.map +1 -0
- package/lib/types/Integrals.d.ts +6 -0
- package/lib/types/Integrals.js +3 -0
- package/lib/types/Integrals.js.map +1 -0
- package/lib/types/Jcoupling.d.ts +5 -0
- package/lib/types/Jcoupling.js +3 -0
- package/lib/types/Jcoupling.js.map +1 -0
- package/lib/types/ObjectXY.d.ts +4 -0
- package/lib/types/ObjectXY.js +3 -0
- package/lib/types/ObjectXY.js.map +1 -0
- package/lib/types/Options/DataSelectionOption.d.ts +1 -0
- package/lib/types/Options/DataSelectionOption.js +3 -0
- package/lib/types/Options/DataSelectionOption.js.map +1 -0
- package/lib/types/Options/JcampParsingOptions.d.ts +30 -0
- package/lib/types/Options/JcampParsingOptions.js +3 -0
- package/lib/types/Options/JcampParsingOptions.js.map +1 -0
- package/lib/types/Options/NmredataParsingOptions.d.ts +14 -0
- package/lib/types/Options/NmredataParsingOptions.js +3 -0
- package/lib/types/Options/NmredataParsingOptions.js.map +1 -0
- package/lib/types/Options/ParsingOptions.d.ts +74 -0
- package/lib/types/Options/ParsingOptions.js +3 -0
- package/lib/types/Options/ParsingOptions.js.map +1 -0
- package/lib/types/Options/SumOptions.d.ts +24 -0
- package/lib/types/Options/SumOptions.js +3 -0
- package/lib/types/Options/SumOptions.js.map +1 -0
- package/lib/types/Peaks/BasePeak.d.ts +3 -0
- package/lib/types/Peaks/BasePeak.js +3 -0
- package/lib/types/Peaks/BasePeak.js.map +1 -0
- package/lib/types/Peaks/Peak1D.d.ts +5 -0
- package/lib/types/Peaks/Peak1D.js +3 -0
- package/lib/types/Peaks/Peak1D.js.map +1 -0
- package/lib/types/Peaks/Peak2D.d.ts +13 -0
- package/lib/types/Peaks/Peak2D.js +3 -0
- package/lib/types/Peaks/Peak2D.js.map +1 -0
- package/lib/types/Peaks/Peaks.d.ts +5 -0
- package/lib/types/Peaks/Peaks.js +3 -0
- package/lib/types/Peaks/Peaks.js.map +1 -0
- package/lib/types/Ranges/Ranges.d.ts +16 -0
- package/lib/types/Ranges/Ranges.js +3 -0
- package/lib/types/Ranges/Ranges.js.map +1 -0
- package/lib/types/Signals/Signal.d.ts +4 -0
- package/lib/types/Signals/Signal.js +3 -0
- package/lib/types/Signals/Signal.js.map +1 -0
- package/lib/types/Signals/Signal1D.d.ts +6 -0
- package/lib/types/Signals/Signal1D.js +3 -0
- package/lib/types/Signals/Signal1D.js.map +1 -0
- package/lib/types/Signals/Signal2D.d.ts +18 -0
- package/lib/types/Signals/Signal2D.js +3 -0
- package/lib/types/Signals/Signal2D.js.map +1 -0
- package/lib/types/Spectrum/BaseSpectrum.d.ts +7 -0
- package/lib/types/Spectrum/BaseSpectrum.js +3 -0
- package/lib/types/Spectrum/BaseSpectrum.js.map +1 -0
- package/lib/types/Spectrum/Spectrum.d.ts +3 -0
- package/lib/types/Spectrum/Spectrum.js +3 -0
- package/lib/types/Spectrum/Spectrum.js.map +1 -0
- package/lib/types/Spectrum/Spectrum1D.d.ts +20 -0
- package/lib/types/Spectrum/Spectrum1D.js +3 -0
- package/lib/types/Spectrum/Spectrum1D.js.map +1 -0
- package/lib/types/Spectrum/Spectrum2D.d.ts +16 -0
- package/lib/types/Spectrum/Spectrum2D.js +3 -0
- package/lib/types/Spectrum/Spectrum2D.js.map +1 -0
- package/lib/types/Zones/Zone.d.ts +13 -0
- package/lib/types/Zones/Zone.js +3 -0
- package/lib/types/Zones/Zone.js.map +1 -0
- package/lib/types/Zones/Zones.d.ts +5 -0
- package/lib/types/Zones/Zones.js +3 -0
- package/lib/types/Zones/Zones.js.map +1 -0
- package/lib/types/common/MapOptions.d.ts +5 -0
- package/lib/types/common/MapOptions.js +3 -0
- package/lib/types/common/MapOptions.js.map +1 -0
- package/lib/utilities/checkData2DFid.d.ts +3 -0
- package/lib/utilities/checkData2DFid.js +10 -0
- package/lib/utilities/checkData2DFid.js.map +1 -0
- package/lib/utilities/cloneData1D.d.ts +6 -0
- package/lib/utilities/cloneData1D.js +9 -0
- package/lib/utilities/cloneData1D.js.map +1 -0
- package/lib/utilities/cloneData2D.d.ts +2 -0
- package/lib/utilities/cloneData2D.js +28 -0
- package/lib/utilities/cloneData2D.js.map +1 -0
- package/lib/utilities/getSum.d.ts +8 -0
- package/lib/utilities/getSum.js +25 -0
- package/lib/utilities/getSum.js.map +1 -0
- package/lib/xyz/Entry2D.d.ts +10 -0
- package/lib/xyz/Entry2D.js +3 -0
- package/lib/xyz/Entry2D.js.map +1 -0
- package/lib/xyz/quadrature.d.ts +7 -0
- package/lib/xyz/quadrature.js +54 -0
- package/lib/xyz/quadrature.js.map +1 -0
- package/lib/xyz/util/fft2d/digitalFilter.d.ts +7 -0
- package/lib/xyz/util/fft2d/digitalFilter.js +20 -0
- package/lib/xyz/util/fft2d/digitalFilter.js.map +1 -0
- package/lib/xyz/util/fft2d/fftDirectDimension.d.ts +24 -0
- package/lib/xyz/util/fft2d/fftDirectDimension.js +57 -0
- package/lib/xyz/util/fft2d/fftDirectDimension.js.map +1 -0
- package/lib/xyz/util/fft2d/fftIndirectDimension.d.ts +23 -0
- package/lib/xyz/util/fft2d/fftIndirectDimension.js +72 -0
- package/lib/xyz/util/fft2d/fftIndirectDimension.js.map +1 -0
- package/lib/xyz/util/fft2d/removeDCOffset.d.ts +5 -0
- package/lib/xyz/util/fft2d/removeDCOffset.js +19 -0
- package/lib/xyz/util/fft2d/removeDCOffset.js.map +1 -0
- package/lib/xyz/util/fft2d/zeroFilling.d.ts +10 -0
- package/lib/xyz/util/fft2d/zeroFilling.js +29 -0
- package/lib/xyz/util/fft2d/zeroFilling.js.map +1 -0
- package/lib/xyz/util/padData.d.ts +5 -3
- package/lib/xyz/util/padData.js +7 -7
- package/lib/xyz/util/padData.js.map +1 -1
- package/lib/xyz/xyzAutoSignalsPicking.d.ts +2 -2
- package/lib/xyz/xyzAutoSignalsPicking.js.map +1 -1
- package/lib/xyz/xyzAutoZonesPicking.d.ts +2 -8
- package/lib/xyz/xyzAutoZonesPicking.js.map +1 -1
- package/lib/xyz/xyzBidimensionalFFT.d.ts +40 -0
- package/lib/xyz/xyzBidimensionalFFT.js +79 -0
- package/lib/xyz/xyzBidimensionalFFT.js.map +1 -0
- package/lib/xyz/xyzJResAnalyzer.d.ts +1 -4
- package/lib/xyz/xyzJResAnalyzer.js +35 -26
- package/lib/xyz/xyzJResAnalyzer.js.map +1 -1
- package/lib-esm/apodization/apodization.js +4 -1
- package/lib-esm/apodization/apodization.js.map +1 -1
- package/lib-esm/apodization/applyWindow.js.map +1 -1
- package/lib-esm/apodization/compose.js.map +1 -1
- package/lib-esm/apodization/getFunction.js +3 -0
- package/lib-esm/apodization/getFunction.js.map +1 -1
- package/lib-esm/apodization/shapes/sineBell.js +13 -0
- package/lib-esm/apodization/shapes/sineBell.js.map +1 -0
- package/lib-esm/apodization/utils/getData.js.map +1 -1
- package/lib-esm/constants/SignalsKinds.js +37 -0
- package/lib-esm/constants/SignalsKinds.js.map +1 -0
- package/lib-esm/datum/Entry1D.js +2 -0
- package/lib-esm/datum/Entry1D.js.map +1 -0
- package/lib-esm/datum/ExclusionZone.js +2 -0
- package/lib-esm/datum/ExclusionZone.js.map +1 -0
- package/lib-esm/datum/Filters.js +23 -0
- package/lib-esm/datum/Filters.js.map +1 -0
- package/lib-esm/datum/FiltersManager.js +175 -0
- package/lib-esm/datum/FiltersManager.js.map +1 -0
- package/lib-esm/datum/MatrixFilter.js +2 -0
- package/lib-esm/datum/MatrixFilter.js.map +1 -0
- package/lib-esm/datum/MatrixOptions.js +2 -0
- package/lib-esm/datum/MatrixOptions.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/apodization.js +68 -0
- package/lib-esm/datum/data1d/filter1d/apodization.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/baselineCorrection.js +52 -0
- package/lib-esm/datum/data1d/filter1d/baselineCorrection.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/digitalFilter.js +41 -0
- package/lib-esm/datum/data1d/filter1d/digitalFilter.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/equallySpaced.js +49 -0
- package/lib-esm/datum/data1d/filter1d/equallySpaced.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/exclusionZones.js +29 -0
- package/lib-esm/datum/data1d/filter1d/exclusionZones.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/fft.js +88 -0
- package/lib-esm/datum/data1d/filter1d/fft.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/phaseCorrection.js +78 -0
- package/lib-esm/datum/data1d/filter1d/phaseCorrection.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/shiftX.js +24 -0
- package/lib-esm/datum/data1d/filter1d/shiftX.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/signalProcessing.js +58 -0
- package/lib-esm/datum/data1d/filter1d/signalProcessing.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +37 -0
- package/lib-esm/datum/data1d/filter1d/utils/padDataToNextPowerOfTwo.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/zeroFilling.js +62 -0
- package/lib-esm/datum/data1d/filter1d/zeroFilling.js.map +1 -0
- package/lib-esm/datum/data1d/updateRelatives.js +32 -0
- package/lib-esm/datum/data1d/updateRelatives.js.map +1 -0
- package/lib-esm/datum/data1d/utils/RangeUtilities.js +69 -0
- package/lib-esm/datum/data1d/utils/RangeUtilities.js.map +1 -0
- package/lib-esm/datum/data1d/utils/checkIntegralKind.js +10 -0
- package/lib-esm/datum/data1d/utils/checkIntegralKind.js.map +1 -0
- package/lib-esm/datum/data1d/utils/checkRangeKind.js +6 -0
- package/lib-esm/datum/data1d/utils/checkRangeKind.js.map +1 -0
- package/lib-esm/datum/data1d/utils/getShiftX.js +7 -0
- package/lib-esm/datum/data1d/utils/getShiftX.js.map +1 -0
- package/lib-esm/datum/data1d/utils/getSpectrumErrorValue.js +5 -0
- package/lib-esm/datum/data1d/utils/getSpectrumErrorValue.js.map +1 -0
- package/lib-esm/datum/data1d/utils/mapIntegrals.js +37 -0
- package/lib-esm/datum/data1d/utils/mapIntegrals.js.map +1 -0
- package/lib-esm/datum/data1d/utils/mapPeaks.js +47 -0
- package/lib-esm/datum/data1d/utils/mapPeaks.js.map +1 -0
- package/lib-esm/datum/data1d/utils/mapRanges.js +80 -0
- package/lib-esm/datum/data1d/utils/mapRanges.js.map +1 -0
- package/lib-esm/datum/data1d/utils/updateIntegrals.js +7 -0
- package/lib-esm/datum/data1d/utils/updateIntegrals.js.map +1 -0
- package/lib-esm/datum/data1d/utils/updateIntegralsRelativeValues.js +6 -0
- package/lib-esm/datum/data1d/utils/updateIntegralsRelativeValues.js.map +1 -0
- package/lib-esm/datum/data1d/utils/updatePeaks.js +8 -0
- package/lib-esm/datum/data1d/utils/updatePeaks.js.map +1 -0
- package/lib-esm/datum/data1d/utils/updateRanges.js +10 -0
- package/lib-esm/datum/data1d/utils/updateRanges.js.map +1 -0
- package/lib-esm/datum/data1d/utils/updateRangesRelativeValues.js +6 -0
- package/lib-esm/datum/data1d/utils/updateRangesRelativeValues.js.map +1 -0
- package/lib-esm/datum/data2d/filter2d/shiftX.js +28 -0
- package/lib-esm/datum/data2d/filter2d/shiftX.js.map +1 -0
- package/lib-esm/datum/data2d/filter2d/shiftY.js +28 -0
- package/lib-esm/datum/data2d/filter2d/shiftY.js.map +1 -0
- package/lib-esm/datum/data2d/utils/get2DSpectrumErrorValue.js +10 -0
- package/lib-esm/datum/data2d/utils/get2DSpectrumErrorValue.js.map +1 -0
- package/lib-esm/datum/data2d/utils/getShift.js +16 -0
- package/lib-esm/datum/data2d/utils/getShift.js.map +1 -0
- package/lib-esm/datum/data2d/utils/isZoneExists.js +17 -0
- package/lib-esm/datum/data2d/utils/isZoneExists.js.map +1 -0
- package/lib-esm/datum/data2d/utils/mapZones.js +64 -0
- package/lib-esm/datum/data2d/utils/mapZones.js.map +1 -0
- package/lib-esm/datum/data2d/utils/updateZones.js +8 -0
- package/lib-esm/datum/data2d/utils/updateZones.js.map +1 -0
- package/lib-esm/index.js +14 -0
- package/lib-esm/index.js.map +1 -1
- package/lib-esm/signals/signalsToRanges.js.map +1 -1
- package/lib-esm/signals/simulation/simulateXYPeaks.js.map +1 -1
- package/lib-esm/signals/utils/jAnalyzer.js.map +1 -1
- package/lib-esm/types/ContourOptions.js +2 -0
- package/lib-esm/types/ContourOptions.js.map +1 -0
- package/lib-esm/types/Data1D.js +2 -0
- package/lib-esm/types/Data1D.js.map +1 -0
- package/{lib/xyz → lib-esm/types}/Data2D.js.map +1 -1
- package/lib-esm/types/Display.js +2 -0
- package/lib-esm/types/Display.js.map +1 -0
- package/lib-esm/types/Display1D.js +2 -0
- package/lib-esm/types/Display1D.js.map +1 -0
- package/lib-esm/types/Display2D.js +2 -0
- package/lib-esm/types/Display2D.js.map +1 -0
- package/lib-esm/types/Filter.js +2 -0
- package/lib-esm/types/Filter.js.map +1 -0
- package/lib-esm/types/Info/Info.js +2 -0
- package/lib-esm/types/Info/Info.js.map +1 -0
- package/lib-esm/types/Info/Info1D.js +2 -0
- package/lib-esm/types/Info/Info1D.js.map +1 -0
- package/lib-esm/types/Info/Info2D.js +2 -0
- package/lib-esm/types/Info/Info2D.js.map +1 -0
- package/lib-esm/types/Integral.js +2 -0
- package/lib-esm/types/Integral.js.map +1 -0
- package/lib-esm/types/Integrals.js +2 -0
- package/lib-esm/types/Integrals.js.map +1 -0
- package/lib-esm/types/Jcoupling.js +2 -0
- package/lib-esm/types/Jcoupling.js.map +1 -0
- package/lib-esm/types/ObjectXY.js +2 -0
- package/lib-esm/types/ObjectXY.js.map +1 -0
- package/lib-esm/types/Options/DataSelectionOption.js +2 -0
- package/lib-esm/types/Options/DataSelectionOption.js.map +1 -0
- package/lib-esm/types/Options/JcampParsingOptions.js +2 -0
- package/lib-esm/types/Options/JcampParsingOptions.js.map +1 -0
- package/lib-esm/types/Options/NmredataParsingOptions.js +2 -0
- package/lib-esm/types/Options/NmredataParsingOptions.js.map +1 -0
- package/lib-esm/types/Options/ParsingOptions.js +2 -0
- package/lib-esm/types/Options/ParsingOptions.js.map +1 -0
- package/lib-esm/types/Options/SumOptions.js +2 -0
- package/lib-esm/types/Options/SumOptions.js.map +1 -0
- package/lib-esm/types/Peaks/BasePeak.js +2 -0
- package/lib-esm/types/Peaks/BasePeak.js.map +1 -0
- package/lib-esm/types/Peaks/Peak1D.js +2 -0
- package/lib-esm/types/Peaks/Peak1D.js.map +1 -0
- package/lib-esm/types/Peaks/Peak2D.js +2 -0
- package/lib-esm/types/Peaks/Peak2D.js.map +1 -0
- package/lib-esm/types/Peaks/Peaks.js +2 -0
- package/lib-esm/types/Peaks/Peaks.js.map +1 -0
- package/lib-esm/types/Ranges/Ranges.js +2 -0
- package/lib-esm/types/Ranges/Ranges.js.map +1 -0
- package/lib-esm/types/Signals/Signal.js +2 -0
- package/lib-esm/types/Signals/Signal.js.map +1 -0
- package/lib-esm/types/Signals/Signal1D.js +2 -0
- package/lib-esm/types/Signals/Signal1D.js.map +1 -0
- package/lib-esm/types/Signals/Signal2D.js +2 -0
- package/lib-esm/types/Signals/Signal2D.js.map +1 -0
- package/lib-esm/types/Spectrum/BaseSpectrum.js +2 -0
- package/lib-esm/types/Spectrum/BaseSpectrum.js.map +1 -0
- package/lib-esm/types/Spectrum/Spectrum.js +2 -0
- package/lib-esm/types/Spectrum/Spectrum.js.map +1 -0
- package/lib-esm/types/Spectrum/Spectrum1D.js +2 -0
- package/lib-esm/types/Spectrum/Spectrum1D.js.map +1 -0
- package/lib-esm/types/Spectrum/Spectrum2D.js +2 -0
- package/lib-esm/types/Spectrum/Spectrum2D.js.map +1 -0
- package/lib-esm/types/Zones/Zone.js +2 -0
- package/lib-esm/types/Zones/Zone.js.map +1 -0
- package/lib-esm/types/Zones/Zones.js +2 -0
- package/lib-esm/types/Zones/Zones.js.map +1 -0
- package/lib-esm/types/common/MapOptions.js +2 -0
- package/lib-esm/types/common/MapOptions.js.map +1 -0
- package/lib-esm/utilities/checkData2DFid.js +6 -0
- package/lib-esm/utilities/checkData2DFid.js.map +1 -0
- package/lib-esm/utilities/cloneData1D.js +5 -0
- package/lib-esm/utilities/cloneData1D.js.map +1 -0
- package/lib-esm/utilities/cloneData2D.js +24 -0
- package/lib-esm/utilities/cloneData2D.js.map +1 -0
- package/lib-esm/utilities/getSum.js +21 -0
- package/lib-esm/utilities/getSum.js.map +1 -0
- package/lib-esm/xyz/Entry2D.js +2 -0
- package/lib-esm/xyz/Entry2D.js.map +1 -0
- package/lib-esm/xyz/quadrature.js +50 -0
- package/lib-esm/xyz/quadrature.js.map +1 -0
- package/lib-esm/xyz/util/fft2d/digitalFilter.js +16 -0
- package/lib-esm/xyz/util/fft2d/digitalFilter.js.map +1 -0
- package/lib-esm/xyz/util/fft2d/fftDirectDimension.js +50 -0
- package/lib-esm/xyz/util/fft2d/fftDirectDimension.js.map +1 -0
- package/lib-esm/xyz/util/fft2d/fftIndirectDimension.js +65 -0
- package/lib-esm/xyz/util/fft2d/fftIndirectDimension.js.map +1 -0
- package/lib-esm/xyz/util/fft2d/removeDCOffset.js +15 -0
- package/lib-esm/xyz/util/fft2d/removeDCOffset.js.map +1 -0
- package/lib-esm/xyz/util/fft2d/zeroFilling.js +25 -0
- package/lib-esm/xyz/util/fft2d/zeroFilling.js.map +1 -0
- package/lib-esm/xyz/util/padData.js +7 -4
- package/lib-esm/xyz/util/padData.js.map +1 -1
- package/lib-esm/xyz/xyzAutoSignalsPicking.js.map +1 -1
- package/lib-esm/xyz/xyzAutoZonesPicking.js.map +1 -1
- package/lib-esm/xyz/xyzBidimensionalFFT.js +75 -0
- package/lib-esm/xyz/xyzBidimensionalFFT.js.map +1 -0
- package/lib-esm/xyz/xyzJResAnalyzer.js +35 -26
- package/lib-esm/xyz/xyzJResAnalyzer.js.map +1 -1
- package/package.json +10 -2
- package/src/apodization/apodization.ts +8 -4
- package/src/apodization/applyWindow.ts +0 -1
- package/src/apodization/compose.ts +1 -0
- package/src/apodization/getFunction.ts +3 -0
- package/src/apodization/shapes/WindowFunctions.ts +7 -1
- package/src/apodization/shapes/sineBell.ts +41 -0
- package/src/apodization/utils/getData.ts +0 -1
- package/src/constants/SignalsKinds.ts +37 -0
- package/src/datum/Entry1D.ts +11 -0
- package/src/datum/ExclusionZone.ts +5 -0
- package/src/datum/Filters.ts +44 -0
- package/src/datum/FiltersManager.ts +238 -0
- package/src/datum/MatrixFilter.ts +58 -0
- package/src/datum/MatrixOptions.ts +25 -0
- package/src/datum/data1d/filter1d/apodization.ts +90 -0
- package/src/datum/data1d/filter1d/baselineCorrection.ts +83 -0
- package/src/datum/data1d/filter1d/digitalFilter.ts +54 -0
- package/src/datum/data1d/filter1d/equallySpaced.ts +61 -0
- package/src/datum/data1d/filter1d/exclusionZones.ts +34 -0
- package/src/datum/data1d/filter1d/fft.ts +138 -0
- package/src/datum/data1d/filter1d/phaseCorrection.ts +127 -0
- package/src/datum/data1d/filter1d/shiftX.ts +31 -0
- package/src/datum/data1d/filter1d/signalProcessing.ts +79 -0
- package/src/datum/data1d/filter1d/utils/padDataToNextPowerOfTwo.ts +49 -0
- package/src/datum/data1d/filter1d/zeroFilling.ts +90 -0
- package/src/datum/data1d/updateRelatives.ts +50 -0
- package/src/datum/data1d/utils/RangeUtilities.ts +102 -0
- package/src/datum/data1d/utils/checkIntegralKind.ts +11 -0
- package/src/datum/data1d/utils/checkRangeKind.ts +8 -0
- package/src/datum/data1d/utils/getShiftX.ts +10 -0
- package/src/datum/data1d/utils/getSpectrumErrorValue.ts +6 -0
- package/src/datum/data1d/utils/mapIntegrals.ts +52 -0
- package/src/datum/data1d/utils/mapPeaks.ts +62 -0
- package/src/datum/data1d/utils/mapRanges.ts +107 -0
- package/src/datum/data1d/utils/updateIntegrals.ts +13 -0
- package/src/datum/data1d/utils/updateIntegralsRelativeValues.ts +17 -0
- package/src/datum/data1d/utils/updatePeaks.ts +10 -0
- package/src/datum/data1d/utils/updateRanges.ts +12 -0
- package/src/datum/data1d/utils/updateRangesRelativeValues.ts +16 -0
- package/src/datum/data2d/filter2d/shiftX.ts +37 -0
- package/src/datum/data2d/filter2d/shiftY.ts +36 -0
- package/src/datum/data2d/utils/get2DSpectrumErrorValue.ts +18 -0
- package/src/datum/data2d/utils/getShift.ts +23 -0
- package/src/datum/data2d/utils/isZoneExists.ts +27 -0
- package/src/datum/data2d/utils/mapZones.ts +80 -0
- package/src/datum/data2d/utils/updateZones.ts +10 -0
- package/src/index.ts +38 -0
- package/src/signals/signalsToRanges.ts +1 -1
- package/src/signals/simulation/simulateXYPeaks.ts +1 -1
- package/src/signals/utils/jAnalyzer.ts +20 -10
- package/src/types/ContourOptions.ts +10 -0
- package/src/types/Data1D.ts +5 -0
- package/src/types/Data2D.ts +7 -0
- package/src/types/Display.ts +3 -0
- package/src/types/Display1D.ts +8 -0
- package/src/types/Display2D.ts +12 -0
- package/src/types/Filter.ts +12 -0
- package/src/types/Info/Info.ts +15 -0
- package/src/types/Info/Info1D.ts +14 -0
- package/src/types/Info/Info2D.ts +11 -0
- package/src/types/Integral.ts +10 -0
- package/src/types/Integrals.ts +7 -0
- package/src/types/Jcoupling.ts +5 -0
- package/src/types/ObjectXY.ts +4 -0
- package/src/types/Options/DataSelectionOption.ts +6 -0
- package/src/types/Options/JcampParsingOptions.ts +35 -0
- package/src/types/Options/NmredataParsingOptions.ts +20 -0
- package/src/types/Options/ParsingOptions.ts +80 -0
- package/src/types/Options/SumOptions.ts +24 -0
- package/src/types/Peaks/BasePeak.ts +3 -0
- package/src/types/Peaks/Peak1D.ts +7 -0
- package/src/types/Peaks/Peak2D.ts +11 -0
- package/src/types/Peaks/Peaks.ts +6 -0
- package/src/types/Ranges/Ranges.ts +19 -0
- package/src/types/Signals/Signal.ts +4 -0
- package/src/types/Signals/Signal1D.ts +8 -0
- package/src/types/Signals/Signal2D.ts +21 -0
- package/src/types/Spectrum/BaseSpectrum.ts +8 -0
- package/src/types/Spectrum/Spectrum.ts +4 -0
- package/src/types/Spectrum/Spectrum1D.ts +23 -0
- package/src/types/Spectrum/Spectrum2D.ts +19 -0
- package/src/types/Zones/Zone.ts +15 -0
- package/src/types/Zones/Zones.ts +6 -0
- package/src/types/common/MapOptions.ts +6 -0
- package/src/utilities/checkData2DFid.ts +10 -0
- package/src/utilities/cloneData1D.ts +6 -0
- package/src/utilities/cloneData2D.ts +27 -0
- package/src/utilities/getSum.ts +24 -0
- package/src/xyz/Entry2D.ts +12 -0
- package/src/xyz/quadrature.ts +68 -0
- package/src/xyz/util/fft2d/digitalFilter.ts +24 -0
- package/src/xyz/util/fft2d/fftDirectDimension.ts +111 -0
- package/src/xyz/util/fft2d/fftIndirectDimension.ts +123 -0
- package/src/xyz/util/fft2d/removeDCOffset.ts +19 -0
- package/src/xyz/util/fft2d/zeroFilling.ts +39 -0
- package/src/xyz/util/padData.ts +13 -7
- package/src/xyz/xyzAutoSignalsPicking.ts +2 -2
- package/src/xyz/xyzAutoZonesPicking.ts +3 -9
- package/src/xyz/xyzBidimensionalFFT.ts +122 -0
- package/src/xyz/xyzJResAnalyzer.ts +51 -42
- package/lib/xyz/Data2D.d.ts +0 -7
- package/src/xyz/Data2D.ts +0 -7
- /package/lib/{xyz → types}/Data2D.js +0 -0
- /package/lib-esm/{xyz → types}/Data2D.js +0 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import airPLS from 'ml-airpls';
|
|
2
|
+
import baselineRegression from 'ml-baseline-correction-regression';
|
|
3
|
+
import { xyEquallySpaced } from 'ml-spectra-processing';
|
|
4
|
+
|
|
5
|
+
import { Entry1D } from '../../Entry1D';
|
|
6
|
+
import { FilterDomainUpdateRules } from '../../FiltersManager';
|
|
7
|
+
|
|
8
|
+
export const id = 'baselineCorrection';
|
|
9
|
+
export const name = 'Baseline correction';
|
|
10
|
+
export const DOMAIN_UPDATE_RULES: Readonly<FilterDomainUpdateRules> = {
|
|
11
|
+
updateXDomain: false,
|
|
12
|
+
updateYDomain: true,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type BaselineAlgorithms = 'airpls' | 'polynomial';
|
|
16
|
+
|
|
17
|
+
export interface PolynomialOptions {
|
|
18
|
+
zones: Array<{ from: number; to: number; id: string }>;
|
|
19
|
+
algorithm: 'polynomial';
|
|
20
|
+
degree: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface AirplsOptions {
|
|
24
|
+
zones: Array<{ from: number; to: number; id: string }>;
|
|
25
|
+
algorithm: 'airpls';
|
|
26
|
+
maxIterations: number;
|
|
27
|
+
tolerance: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type BaselineCorrectionOptions = PolynomialOptions | AirplsOptions;
|
|
31
|
+
|
|
32
|
+
export function apply(datum1D: Entry1D, options: BaselineCorrectionOptions) {
|
|
33
|
+
if (!isApplicable(datum1D)) {
|
|
34
|
+
throw new Error('baselineCorrection not applicable on this data');
|
|
35
|
+
}
|
|
36
|
+
const { algorithm } = options;
|
|
37
|
+
let { x, re } = datum1D.data;
|
|
38
|
+
|
|
39
|
+
let corrected;
|
|
40
|
+
switch (algorithm) {
|
|
41
|
+
case 'airpls':
|
|
42
|
+
corrected = airPLS(x, re, options).corrected;
|
|
43
|
+
break;
|
|
44
|
+
case 'polynomial':
|
|
45
|
+
{
|
|
46
|
+
const { degree, zones } = options;
|
|
47
|
+
let reduced = xyEquallySpaced(
|
|
48
|
+
{ x, y: re },
|
|
49
|
+
{ numberOfPoints: 4096, zones },
|
|
50
|
+
);
|
|
51
|
+
let result = baselineRegression(reduced.x, reduced.y, {
|
|
52
|
+
regressionOptions: degree,
|
|
53
|
+
});
|
|
54
|
+
let { regression } = result;
|
|
55
|
+
corrected = new Float64Array(x.length);
|
|
56
|
+
for (let i = 0; i < re.length; i++) {
|
|
57
|
+
corrected[i] = re[i] - regression.predict(x[i]);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
64
|
+
throw new Error(`baselineCorrection: algorithm unknown: ${algorithm}`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
Object.assign(datum1D.data, { re: corrected });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function isApplicable(datum1D: Entry1D) {
|
|
71
|
+
if (!datum1D.info.isFid) return true;
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function reduce(
|
|
76
|
+
previousValue: BaselineCorrectionOptions,
|
|
77
|
+
newValue: BaselineCorrectionOptions,
|
|
78
|
+
) {
|
|
79
|
+
return {
|
|
80
|
+
once: true,
|
|
81
|
+
reduce: newValue,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Data1D } from '../../../types/Data1D';
|
|
2
|
+
import { Entry1D } from '../../Entry1D';
|
|
3
|
+
import { FilterDomainUpdateRules } from '../../FiltersManager';
|
|
4
|
+
|
|
5
|
+
export const id = 'digitalFilter';
|
|
6
|
+
export const name = 'Digital Filter';
|
|
7
|
+
export const DOMAIN_UPDATE_RULES: Readonly<FilterDomainUpdateRules> = {
|
|
8
|
+
updateXDomain: true,
|
|
9
|
+
updateYDomain: true,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Move points from the beginning to the end of FID and performs a first order phase correction
|
|
14
|
+
* @param {Datum1d} datum1d
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export function apply(datum1D: Entry1D, options: any = {}) {
|
|
18
|
+
if (!isApplicable(datum1D)) {
|
|
19
|
+
throw new Error('Digital Filter is not applicable on this data');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let { digitalFilterValue = 0 } = options;
|
|
23
|
+
let re = new Float64Array(datum1D.data.re);
|
|
24
|
+
let im = new Float64Array(datum1D.data.im || []);
|
|
25
|
+
|
|
26
|
+
let pointsToShift = Math.floor(digitalFilterValue);
|
|
27
|
+
|
|
28
|
+
const skip = 0;
|
|
29
|
+
pointsToShift += 0;
|
|
30
|
+
|
|
31
|
+
const newRe = new Float64Array(re.length);
|
|
32
|
+
const newIm = new Float64Array(im.length);
|
|
33
|
+
newRe.set(re.slice(pointsToShift));
|
|
34
|
+
newRe.set(re.slice(skip, pointsToShift), re.length - pointsToShift);
|
|
35
|
+
newIm.set(im.slice(pointsToShift));
|
|
36
|
+
newIm.set(im.slice(skip, pointsToShift), im.length - pointsToShift);
|
|
37
|
+
|
|
38
|
+
datum1D.data.re = newRe;
|
|
39
|
+
datum1D.data.im = newIm;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function isApplicable(
|
|
43
|
+
datum1D: Entry1D,
|
|
44
|
+
): datum1D is Entry1D & { data: Required<Data1D> } {
|
|
45
|
+
if (datum1D.info.isComplex && datum1D.info.isFid) return true;
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function reduce() {
|
|
50
|
+
return {
|
|
51
|
+
once: true,
|
|
52
|
+
reduce: undefined,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { xEnsureFloat64, xyEquallySpaced } from 'ml-spectra-processing';
|
|
2
|
+
|
|
3
|
+
import { Entry1D } from '../../Entry1D';
|
|
4
|
+
|
|
5
|
+
export const id = 'equallySpaced';
|
|
6
|
+
export const name = 'Equally spaced';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Equally Spaced
|
|
10
|
+
* **
|
|
11
|
+
* Function that returns a Number array of equally spaced numberOfPoints
|
|
12
|
+
* containing a representation of intensities of the spectra arguments x
|
|
13
|
+
* and y.
|
|
14
|
+
*
|
|
15
|
+
* The options parameter contains an object in the following form:
|
|
16
|
+
* from: starting point
|
|
17
|
+
* to: last point
|
|
18
|
+
* numberOfPoints: number of points between from and to
|
|
19
|
+
* variant: "slot" or "smooth" - smooth is the default option
|
|
20
|
+
*
|
|
21
|
+
* The slot variant consist that each point in the new array is calculated
|
|
22
|
+
* averaging the existing points between the slot that belongs to the current
|
|
23
|
+
* value. The smooth variant is the same but takes the integral of the range
|
|
24
|
+
* of the slot and divide by the step size between two points in the new array.
|
|
25
|
+
*
|
|
26
|
+
* @param {Array<{from:number;to:number}>} options.exclusions
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
export function apply(spectrum: Entry1D, options: any = {}) {
|
|
30
|
+
if (!isApplicable(spectrum)) {
|
|
31
|
+
throw new Error('Equally Spaced is not applicable on this data');
|
|
32
|
+
}
|
|
33
|
+
const { from, to, numberOfPoints, exclusions } = options;
|
|
34
|
+
const { x, re, im } = spectrum.data;
|
|
35
|
+
const XREdata = xyEquallySpaced(
|
|
36
|
+
{ x, y: re },
|
|
37
|
+
{ from, to, numberOfPoints, exclusions },
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
spectrum.data.x = xEnsureFloat64(XREdata.x);
|
|
41
|
+
spectrum.data.re = xEnsureFloat64(XREdata.y);
|
|
42
|
+
if (im) {
|
|
43
|
+
const XIMdata = xyEquallySpaced(
|
|
44
|
+
{ x, y: re },
|
|
45
|
+
{ from, to, numberOfPoints, exclusions },
|
|
46
|
+
);
|
|
47
|
+
spectrum.data.im = xEnsureFloat64(XIMdata.y);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function isApplicable(spectrum: Entry1D) {
|
|
52
|
+
if (spectrum.info.isComplex && !spectrum.info.isFid) return true;
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function reduce() {
|
|
57
|
+
return {
|
|
58
|
+
once: false,
|
|
59
|
+
reduce: null,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { xySetYValue, zonesNormalize } from 'ml-spectra-processing';
|
|
2
|
+
|
|
3
|
+
import { Entry1D } from '../../Entry1D';
|
|
4
|
+
import { FilterDomainUpdateRules } from '../../FiltersManager';
|
|
5
|
+
|
|
6
|
+
export const id = 'exclusionZones';
|
|
7
|
+
export const name = 'Exclusion zones';
|
|
8
|
+
export const DOMAIN_UPDATE_RULES: Readonly<FilterDomainUpdateRules> = {
|
|
9
|
+
updateXDomain: false,
|
|
10
|
+
updateYDomain: false,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function apply(spectrum: Entry1D, zones = []) {
|
|
14
|
+
if (!isApplicable(spectrum)) {
|
|
15
|
+
throw new Error('Exclusion Zones filter not applicable on this data');
|
|
16
|
+
}
|
|
17
|
+
const { x, re, im } = spectrum.data;
|
|
18
|
+
spectrum.data.re = Float64Array.from(xySetYValue({ x, y: re }, { zones }).y);
|
|
19
|
+
spectrum.data.im = im
|
|
20
|
+
? Float64Array.from(xySetYValue({ x, y: re }, { zones }).y)
|
|
21
|
+
: im;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function isApplicable(spectrum: Entry1D) {
|
|
25
|
+
if (spectrum.info.isFt) return true;
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function reduce(previousValue: any, newValue: any) {
|
|
30
|
+
return {
|
|
31
|
+
once: true,
|
|
32
|
+
reduce: zonesNormalize(previousValue.concat(newValue)),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DataReIm,
|
|
3
|
+
reimFFT,
|
|
4
|
+
reimPhaseCorrection,
|
|
5
|
+
xMean,
|
|
6
|
+
} from 'ml-spectra-processing';
|
|
7
|
+
|
|
8
|
+
import { Data1D } from '../../../types/Data1D';
|
|
9
|
+
import { Entry1D } from '../../Entry1D';
|
|
10
|
+
import { FilterDomainUpdateRules } from '../../FiltersManager';
|
|
11
|
+
|
|
12
|
+
import { padDataToNextPowerOfTwo } from './utils/padDataToNextPowerOfTwo';
|
|
13
|
+
|
|
14
|
+
export const id = 'fft';
|
|
15
|
+
export const name = 'FFT';
|
|
16
|
+
export const DOMAIN_UPDATE_RULES: Readonly<FilterDomainUpdateRules> = {
|
|
17
|
+
updateXDomain: true,
|
|
18
|
+
updateYDomain: true,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export function apply(datum1D: Entry1D) {
|
|
22
|
+
if (!isApplicable(datum1D)) {
|
|
23
|
+
throw new Error('fft not applicable on this data');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
checkSameLength(datum1D);
|
|
27
|
+
|
|
28
|
+
let digitalFilterApplied = datum1D.filters.some(
|
|
29
|
+
(e) => e.name === 'digitalFilter' && e.flag,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const {
|
|
33
|
+
info: { aqMod },
|
|
34
|
+
} = datum1D;
|
|
35
|
+
|
|
36
|
+
if (aqMod === 1) {
|
|
37
|
+
removeDCOffset(datum1D, digitalFilterApplied);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (!isPowerOfTwo(datum1D.data.x.length)) {
|
|
41
|
+
padDataToNextPowerOfTwo(datum1D, digitalFilterApplied);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const { data, info } = datum1D;
|
|
45
|
+
Object.assign(
|
|
46
|
+
data,
|
|
47
|
+
reimFFT(
|
|
48
|
+
{
|
|
49
|
+
re: data.re,
|
|
50
|
+
im: data.im,
|
|
51
|
+
},
|
|
52
|
+
{ applyZeroShift: true },
|
|
53
|
+
),
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
if (digitalFilterApplied) {
|
|
57
|
+
let { digitalFilter = 0 } = info;
|
|
58
|
+
let ph1 = (digitalFilter - Math.floor(digitalFilter)) * Math.PI * 2;
|
|
59
|
+
Object.assign(
|
|
60
|
+
data,
|
|
61
|
+
reimPhaseCorrection(data as DataReIm, 0, -ph1, { reverse: true }),
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
datum1D.data.x = generateXAxis(datum1D);
|
|
66
|
+
datum1D.info = { ...datum1D.info, isFid: false, isFt: true };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function isApplicable(
|
|
70
|
+
datum1D: Entry1D,
|
|
71
|
+
): datum1D is Entry1D & { data: Required<Data1D> } {
|
|
72
|
+
if (datum1D.info.isComplex && datum1D.info.isFid) return true;
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function reduce() {
|
|
77
|
+
return {
|
|
78
|
+
once: true,
|
|
79
|
+
reduce: undefined,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function generateXAxis(datum1D: Entry1D) {
|
|
84
|
+
const info = datum1D.info;
|
|
85
|
+
const baseFrequency = Number.parseFloat(info.baseFrequency);
|
|
86
|
+
const frequencyOffset = Number.parseFloat(info.frequencyOffset);
|
|
87
|
+
const spectralWidth = Number.parseFloat(info.spectralWidth);
|
|
88
|
+
const offset = frequencyOffset / baseFrequency;
|
|
89
|
+
let spectralHalfWidth = 0.5 * spectralWidth;
|
|
90
|
+
let nbPoints = datum1D.data.x.length;
|
|
91
|
+
let firstPoint = offset - spectralHalfWidth;
|
|
92
|
+
let dx = spectralWidth / (nbPoints - 1);
|
|
93
|
+
const xAxis = new Float64Array(nbPoints);
|
|
94
|
+
for (let i = 0; i < nbPoints; i++) {
|
|
95
|
+
xAxis[i] = firstPoint;
|
|
96
|
+
firstPoint += dx;
|
|
97
|
+
}
|
|
98
|
+
return xAxis;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function isPowerOfTwo(n: number) {
|
|
102
|
+
return n !== 0 && (n & (n - 1)) === 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function removeDCOffset(
|
|
106
|
+
spectrum: Entry1D & { data: Required<Data1D> },
|
|
107
|
+
digitalFilterApplied: boolean,
|
|
108
|
+
) {
|
|
109
|
+
let { digitalFilter = 0 } = digitalFilterApplied ? spectrum.info : {};
|
|
110
|
+
const data = spectrum.data;
|
|
111
|
+
const nbPoints = data.re.length;
|
|
112
|
+
const newRe = new Float64Array(data.re);
|
|
113
|
+
const newIm = new Float64Array(data.im);
|
|
114
|
+
const averageRe = xMean(
|
|
115
|
+
data.re.slice((nbPoints * 0.75) >> 0, nbPoints - digitalFilter),
|
|
116
|
+
);
|
|
117
|
+
const averageIm = xMean(
|
|
118
|
+
data.im.slice((nbPoints * 0.75) >> 0, nbPoints - digitalFilter),
|
|
119
|
+
);
|
|
120
|
+
for (
|
|
121
|
+
let i = digitalFilterApplied ? 0 : digitalFilter;
|
|
122
|
+
i < nbPoints - digitalFilter;
|
|
123
|
+
i++
|
|
124
|
+
) {
|
|
125
|
+
newRe[i] -= averageRe;
|
|
126
|
+
newIm[i] -= averageIm;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
Object.assign(spectrum.data, { re: newRe, im: newIm });
|
|
130
|
+
return spectrum;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function checkSameLength(spectrum: Entry1D) {
|
|
134
|
+
const { data } = spectrum;
|
|
135
|
+
if (data.x.length !== data.re.length || data.x.length !== data.im?.length) {
|
|
136
|
+
throw new Error('The length of data should be equal');
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {
|
|
2
|
+
reimAbsolute,
|
|
3
|
+
reimAutoPhaseCorrection,
|
|
4
|
+
reimPhaseCorrection,
|
|
5
|
+
xEnsureFloat64,
|
|
6
|
+
} from 'ml-spectra-processing';
|
|
7
|
+
|
|
8
|
+
import { Data1D } from '../../../types/Data1D';
|
|
9
|
+
import { Entry1D } from '../../Entry1D';
|
|
10
|
+
import { FilterDomainUpdateRules } from '../../FiltersManager';
|
|
11
|
+
|
|
12
|
+
export const id = 'phaseCorrection';
|
|
13
|
+
export const name = 'Phase correction';
|
|
14
|
+
export const DOMAIN_UPDATE_RULES: Readonly<FilterDomainUpdateRules> = {
|
|
15
|
+
updateXDomain: false,
|
|
16
|
+
updateYDomain: false,
|
|
17
|
+
};
|
|
18
|
+
export interface PhaseCorrectionParameters {
|
|
19
|
+
ph0: number;
|
|
20
|
+
ph1: number;
|
|
21
|
+
absolute: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param {Datum1d} datum1d
|
|
27
|
+
* @param {Object} [options={}]
|
|
28
|
+
* @param {number} [options.ph0=0]
|
|
29
|
+
* @param {number} [options.ph1=0]
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
export function apply(datum1D: Entry1D, options: any = {}) {
|
|
33
|
+
if (!isApplicable(datum1D)) {
|
|
34
|
+
throw new Error('phaseCorrection not applicable on this data');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const { absolute = false } = options;
|
|
38
|
+
const filter = datum1D.filters?.find((filter) => filter.name === id);
|
|
39
|
+
|
|
40
|
+
if (absolute) {
|
|
41
|
+
const { re, im } = datum1D.data;
|
|
42
|
+
datum1D.data.re = reimAbsolute({ re, im });
|
|
43
|
+
datum1D.data.im = new Float64Array(0);
|
|
44
|
+
if (filter) {
|
|
45
|
+
filter.value = { ...filter.value, ph0: 0, ph1: 0, absolute };
|
|
46
|
+
}
|
|
47
|
+
} else if ('ph0' in options && 'ph1' in options) {
|
|
48
|
+
let { ph0, ph1 } = options;
|
|
49
|
+
phaseCorrection(datum1D, { ph0, ph1 });
|
|
50
|
+
if (filter) {
|
|
51
|
+
filter.value = { ...filter.value, absolute };
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
let { ph0, ph1 } = autoPhaseCorrection(datum1D);
|
|
55
|
+
phaseCorrection(datum1D, { ph0, ph1 });
|
|
56
|
+
if (filter) {
|
|
57
|
+
filter.value = { ...filter.value, absolute, ph0, ph1 };
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function phaseCorrection(
|
|
63
|
+
spectrum: Entry1D & { data: Required<Data1D> },
|
|
64
|
+
phaseValues: { ph0: number; ph1: number },
|
|
65
|
+
) {
|
|
66
|
+
let { ph0, ph1 } = phaseValues;
|
|
67
|
+
const { re, im } = spectrum.data;
|
|
68
|
+
const phased = reimPhaseCorrection(
|
|
69
|
+
{ re, im },
|
|
70
|
+
(ph0 * Math.PI) / 180,
|
|
71
|
+
(ph1 * Math.PI) / 180,
|
|
72
|
+
{ reverse: true },
|
|
73
|
+
);
|
|
74
|
+
spectrum.data = {
|
|
75
|
+
...spectrum.data,
|
|
76
|
+
...{
|
|
77
|
+
re: xEnsureFloat64(phased.re),
|
|
78
|
+
im: xEnsureFloat64(phased.im),
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface AutoPhaseCorrectionOptions {
|
|
84
|
+
minRegSize?: number;
|
|
85
|
+
maxDistanceToJoin?: number;
|
|
86
|
+
magnitudeMode?: boolean;
|
|
87
|
+
factorNoise?: number;
|
|
88
|
+
reverse?: boolean;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function autoPhaseCorrection(
|
|
92
|
+
spectrum: Entry1D,
|
|
93
|
+
options: AutoPhaseCorrectionOptions = {},
|
|
94
|
+
) {
|
|
95
|
+
const {
|
|
96
|
+
minRegSize = 5,
|
|
97
|
+
maxDistanceToJoin = 128,
|
|
98
|
+
magnitudeMode = true,
|
|
99
|
+
factorNoise = 5,
|
|
100
|
+
reverse = true,
|
|
101
|
+
} = options;
|
|
102
|
+
|
|
103
|
+
return reimAutoPhaseCorrection(spectrum.data as any, {
|
|
104
|
+
minRegSize,
|
|
105
|
+
maxDistanceToJoin,
|
|
106
|
+
magnitudeMode,
|
|
107
|
+
factorNoise,
|
|
108
|
+
reverse,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function isApplicable(
|
|
113
|
+
spectrum: Entry1D,
|
|
114
|
+
): spectrum is Entry1D & { data: Required<Data1D> } {
|
|
115
|
+
if (spectrum.info.isComplex && !spectrum.info.isFid) return true;
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function reduce(
|
|
120
|
+
previousValue: PhaseCorrectionParameters,
|
|
121
|
+
newValue: PhaseCorrectionParameters,
|
|
122
|
+
) {
|
|
123
|
+
return {
|
|
124
|
+
once: true,
|
|
125
|
+
reduce: newValue,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Entry1D } from '../../Entry1D';
|
|
2
|
+
import { FilterDomainUpdateRules } from '../../FiltersManager';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param {Object} datum1d
|
|
7
|
+
* @param {number} [shiftValue=0]
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export const id = 'shiftX';
|
|
11
|
+
export const name = 'Shift X';
|
|
12
|
+
|
|
13
|
+
export const DOMAIN_UPDATE_RULES: Readonly<FilterDomainUpdateRules> = {
|
|
14
|
+
updateXDomain: true,
|
|
15
|
+
updateYDomain: false,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export function apply(datum1D: Entry1D, shiftValue = 0) {
|
|
19
|
+
datum1D.data.x = datum1D.data.x.map((val) => val + shiftValue);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function isApplicable() {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function reduce(previousValue: number, newValue: number) {
|
|
27
|
+
return {
|
|
28
|
+
once: true,
|
|
29
|
+
reduce: previousValue + newValue,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as Filters from 'ml-signal-processing';
|
|
2
|
+
|
|
3
|
+
import { Entry1D } from '../../Entry1D';
|
|
4
|
+
import { FilterDomainUpdateRules } from '../../FiltersManager';
|
|
5
|
+
import { MatrixOptions } from '../../MatrixOptions';
|
|
6
|
+
|
|
7
|
+
export const id = 'signalProcessing';
|
|
8
|
+
export const name = 'Signal processing';
|
|
9
|
+
|
|
10
|
+
export const DOMAIN_UPDATE_RULES: Readonly<FilterDomainUpdateRules> = {
|
|
11
|
+
updateXDomain: true,
|
|
12
|
+
updateYDomain: true,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function apply(spectrum: Entry1D, options: MatrixOptions) {
|
|
16
|
+
if (!isApplicable(spectrum)) {
|
|
17
|
+
throw new Error('Signal Processing is not applicable on this data');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
spectrum.data = filterXY(spectrum, options);
|
|
21
|
+
}
|
|
22
|
+
export function isApplicable(spectrum: Entry1D) {
|
|
23
|
+
if (spectrum.info.isFt) return true;
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function reduce(previousValue: any, newValue: any) {
|
|
28
|
+
return {
|
|
29
|
+
once: true,
|
|
30
|
+
reduce: newValue,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function filterXY(spectrum: Entry1D, options: MatrixOptions) {
|
|
35
|
+
let x = spectrum.data.x.slice(0);
|
|
36
|
+
let cloneX = spectrum.data.x.slice(0);
|
|
37
|
+
let re = spectrum.data.re.slice(0);
|
|
38
|
+
let im = spectrum.data.im?.slice(0);
|
|
39
|
+
|
|
40
|
+
const filters = options.filters.slice();
|
|
41
|
+
|
|
42
|
+
const {
|
|
43
|
+
range: { from, to },
|
|
44
|
+
numberOfPoints,
|
|
45
|
+
exclusionsZones: exclusions,
|
|
46
|
+
} = options;
|
|
47
|
+
|
|
48
|
+
filters.push({
|
|
49
|
+
name: 'equallySpaced',
|
|
50
|
+
options: { from, to, numberOfPoints, exclusions },
|
|
51
|
+
properties: {},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
for (const filter of filters) {
|
|
55
|
+
// eslint-disable-next-line import/namespace
|
|
56
|
+
const filterFunction = Filters[filter.name];
|
|
57
|
+
if (!filterFunction) {
|
|
58
|
+
throw new Error(`Unknown filter: ${filter.name}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const filterOptions = filter?.options || {};
|
|
62
|
+
|
|
63
|
+
// @ts-expect-error some method have options and some other ones don't have any options
|
|
64
|
+
const realResult = filterFunction({ x, y: re }, filterOptions);
|
|
65
|
+
x = realResult.data.x as Float64Array;
|
|
66
|
+
re = realResult.data.y as Float64Array;
|
|
67
|
+
|
|
68
|
+
if (im) {
|
|
69
|
+
const imaginaryResult = filterFunction(
|
|
70
|
+
{ x: cloneX, y: im },
|
|
71
|
+
// @ts-expect-error some method have options and some other ones don't have any options
|
|
72
|
+
filterOptions,
|
|
73
|
+
);
|
|
74
|
+
im = imaginaryResult.data.y as Float64Array;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return { x, re, im };
|
|
79
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { xSequentialFill } from 'ml-spectra-processing';
|
|
2
|
+
|
|
3
|
+
import { Data1D } from '../../../../types/Data1D';
|
|
4
|
+
import { Entry1D } from '../../../Entry1D';
|
|
5
|
+
|
|
6
|
+
export function padDataToNextPowerOfTwo(
|
|
7
|
+
datum1D: Entry1D & { data: Required<Data1D> },
|
|
8
|
+
digitalFilterApplied: boolean,
|
|
9
|
+
) {
|
|
10
|
+
const { x, re, im } = datum1D.data;
|
|
11
|
+
const size = nextPowerOfTwo(x.length);
|
|
12
|
+
|
|
13
|
+
let newRE = new Float64Array(size);
|
|
14
|
+
let newIM = new Float64Array(size);
|
|
15
|
+
|
|
16
|
+
const pointsToShift = getPointsToShift(datum1D);
|
|
17
|
+
|
|
18
|
+
newRE.set(re.slice(0, size - pointsToShift));
|
|
19
|
+
newIM.set(im.slice(0, size - pointsToShift));
|
|
20
|
+
|
|
21
|
+
if (pointsToShift > 0 && digitalFilterApplied) {
|
|
22
|
+
newRE.set(re.slice(re.length - pointsToShift), size - pointsToShift);
|
|
23
|
+
newIM.set(im.slice(re.length - pointsToShift), size - pointsToShift);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const newX = xSequentialFill({
|
|
27
|
+
from: x[0],
|
|
28
|
+
size,
|
|
29
|
+
step: x[1] - x[0],
|
|
30
|
+
}) as Float64Array;
|
|
31
|
+
|
|
32
|
+
datum1D.data = { ...datum1D.data, re: newRE, im: newIM, x: newX };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function getPointsToShift(datum1D: Entry1D) {
|
|
36
|
+
let grpdly = datum1D.info?.digitalFilter || 0;
|
|
37
|
+
return grpdly > 0 ? Math.floor(grpdly) : 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function nextPowerOfTwo(n: number) {
|
|
41
|
+
if (n === 0) return 1;
|
|
42
|
+
n--;
|
|
43
|
+
n |= n >> 1;
|
|
44
|
+
n |= n >> 2;
|
|
45
|
+
n |= n >> 4;
|
|
46
|
+
n |= n >> 8;
|
|
47
|
+
n |= n >> 16;
|
|
48
|
+
return n + 1;
|
|
49
|
+
}
|