HiNC-2025-win-desktop-Deploy/App/wwwroot/HiAPI-docsite/api/Hi.Physics.TimeSeriesUtil.html
2025-07-18 15:38:28 +08:00

912 lines
40 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Class TimeSeriesUtil | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Class TimeSeriesUtil | HiAPI-C# 2025 ">
<meta name="description" content="Utility class for time series data operations.">
<link rel="icon" href="../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
<meta name="docfx:navrel" content="../toc.html">
<meta name="docfx:tocrel" content="toc.html">
<meta name="docfx:rel" content="../">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../img/HiAPI.logo.png" alt="">
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>
<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>
<nav id="breadcrumb"></nav>
</div>
<article data-uid="Hi.Physics.TimeSeriesUtil">
<h1 id="Hi_Physics_TimeSeriesUtil" data-uid="Hi.Physics.TimeSeriesUtil" class="text-break">
Class TimeSeriesUtil
</h1>
<div class="facts text-secondary">
<dl><dt>Namespace</dt><dd><a class="xref" href="Hi.html">Hi</a>.<a class="xref" href="Hi.Physics.html">Physics</a></dd></dl>
<dl><dt>Assembly</dt><dd>HiGeom.dll</dd></dl>
</div>
<div class="markdown summary"><p>Utility class for time series data operations.</p>
</div>
<div class="markdown conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static class TimeSeriesUtil</code></pre>
</div>
<dl class="typelist inheritance">
<dt>Inheritance</dt>
<dd>
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
<div><span class="xref">TimeSeriesUtil</span></div>
</dd>
</dl>
<dl class="typelist inheritedMembers">
<dt>Inherited Members</dt>
<dd>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
</div>
</dd></dl>
<h2 class="section" id="methods">Methods
</h2>
<a id="Hi_Physics_TimeSeriesUtil_FourierTransformApSeries_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformApSeries*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_FourierTransformApSeries_System_Collections_Generic_List_Hi_Physics_TimeValue__System_TimeSpan_System_TimeSpan_System_Int32_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformApSeries(System.Collections.Generic.List{Hi.Physics.TimeValue},System.TimeSpan,System.TimeSpan,System.Int32)">
FourierTransformApSeries(List&lt;TimeValue&gt;, TimeSpan, TimeSpan, int)
</h3>
<div class="markdown level1 summary"><p>Performs a Fourier transform series on a list of time values and converts the results to amplitude-phase format.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static List&lt;AmpPhase&gt; FourierTransformApSeries(this List&lt;TimeValue&gt; timeValueList, TimeSpan basePeriod, TimeSpan resolutionPeriod, int threadNum = 1)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>timeValueList</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Physics.TimeValue.html">TimeValue</a>&gt;</dt>
<dd><p>timeToValueList which the time length is closed to integral multiple of <code class="paramref">basePeriod</code>.
The offset part cause bias.</p>
</dd>
<dt><code>basePeriod</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>period of 1st fourier transform parameter.</p>
</dd>
<dt><code>resolutionPeriod</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>peroid of last fourier transform parameter.</p>
</dd>
<dt><code>threadNum</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>thread number. Set 0 to apply processor count.
Set 1 for not creating additional thread during the function.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Physics.AmpPhase.html">AmpPhase</a>&gt;</dt>
<dd><p>A list of amplitude-phase pairs for each frequency</p>
</dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_FourierTransformApSeries_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformApSeries*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_FourierTransformApSeries__1_System_Collections_Generic_List___0__System_TimeSpan_System_TimeSpan_System_Func___0_System_Double____System_Int32_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformApSeries``1(System.Collections.Generic.List{``0},System.TimeSpan,System.TimeSpan,System.Func{``0,System.Double}[],System.Int32)">
FourierTransformApSeries&lt;TimeItem&gt;(List&lt;TimeItem&gt;, TimeSpan, TimeSpan, Func&lt;TimeItem, double&gt;[], int)
</h3>
<div class="markdown level1 summary"><p>Performs a Fourier transform series on a list of time-based items and converts the results to amplitude-phase format.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static List&lt;AmpPhase[]&gt; FourierTransformApSeries&lt;TimeItem&gt;(this List&lt;TimeItem&gt; timeValueList, TimeSpan basePeriod, TimeSpan resolutionPeriod, Func&lt;TimeItem, double&gt;[] getValueFuncs, int threadNum = 1) where TimeItem : ITimeGetter</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>timeValueList</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;TimeItem&gt;</dt>
<dd><p>timeToValueList which the time length is closed to integral multiple of <code class="paramref">basePeriod</code>.
The offset part cause bias.</p>
</dd>
<dt><code>basePeriod</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>period of 1st fourier transform parameter.</p>
</dd>
<dt><code>resolutionPeriod</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>peroid of last fourier transform parameter.</p>
</dd>
<dt><code>getValueFuncs</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;TimeItem, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>&gt;[]</dt>
<dd><p>Array of functions to extract values from each time-based item</p>
</dd>
<dt><code>threadNum</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>thread number. Set 0 to apply processor count.
Set 1 for not creating additional thread during the function.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Physics.AmpPhase.html">AmpPhase</a>[]&gt;</dt>
<dd><p>A list of arrays of amplitude-phase pairs for each frequency and value function</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>TimeItem</code></dt>
<dd><p>The type of items that implement ITimeGetter</p>
</dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_FourierTransformSeries_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformSeries*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_FourierTransformSeries_System_Collections_Generic_List_Hi_Physics_TimeValue__System_TimeSpan_System_TimeSpan_System_Int32_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformSeries(System.Collections.Generic.List{Hi.Physics.TimeValue},System.TimeSpan,System.TimeSpan,System.Int32)">
FourierTransformSeries(List&lt;TimeValue&gt;, TimeSpan, TimeSpan, int)
</h3>
<div class="markdown level1 summary"><p>Performs a Fourier transform series on a list of time values, generating frequency domain data.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static List&lt;Vec2d&gt; FourierTransformSeries(this List&lt;TimeValue&gt; fittedTimeValueList, TimeSpan basePeriod, TimeSpan resolutionPeriod, int threadNum = 1)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>fittedTimeValueList</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Physics.TimeValue.html">TimeValue</a>&gt;</dt>
<dd><p>timeToValueList which the time length is closed to integral multiple of <code class="paramref">basePeriod</code>.
The offset part cause bias.</p>
</dd>
<dt><code>basePeriod</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>period of 1st fourier transform parameter.</p>
</dd>
<dt><code>resolutionPeriod</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>peroid of last fourier transform parameter.</p>
</dd>
<dt><code>threadNum</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>thread number. Set 0 to apply processor count.
Set 1 for not creating additional thread during the function.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Geom.Vec2d.html">Vec2d</a>&gt;</dt>
<dd><p>A list of 2D vectors containing the cosine and sine components for each frequency</p>
</dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_FourierTransformSeries_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformSeries*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_FourierTransformSeries__1_System_Collections_Generic_List___0__System_TimeSpan_System_TimeSpan_System_Func___0_System_Double____System_Int32_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformSeries``1(System.Collections.Generic.List{``0},System.TimeSpan,System.TimeSpan,System.Func{``0,System.Double}[],System.Int32)">
FourierTransformSeries&lt;TimeItem&gt;(List&lt;TimeItem&gt;, TimeSpan, TimeSpan, Func&lt;TimeItem, double&gt;[], int)
</h3>
<div class="markdown level1 summary"><p>Performs a Fourier transform series on a list of time-based items, generating frequency domain data for multiple value functions.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static List&lt;Vec2d[]&gt; FourierTransformSeries&lt;TimeItem&gt;(this List&lt;TimeItem&gt; fittedTimeValueList, TimeSpan basePeriod, TimeSpan resolutionPeriod, Func&lt;TimeItem, double&gt;[] getValueFuncs, int threadNum = 1) where TimeItem : ITimeGetter</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>fittedTimeValueList</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;TimeItem&gt;</dt>
<dd><p>timeToValueList which the time length is closed to integral multiple of <code class="paramref">basePeriod</code>.
The offset part cause bias.</p>
</dd>
<dt><code>basePeriod</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>Base period. Effective period.
Period of 1st fourier transform parameter.
The period should be close and smaller than the full period.</p>
</dd>
<dt><code>resolutionPeriod</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>peroid of last fourier transform parameter.</p>
</dd>
<dt><code>getValueFuncs</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;TimeItem, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>&gt;[]</dt>
<dd><p>Array of functions to extract values from each time-based item</p>
</dd>
<dt><code>threadNum</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>thread number. Set 0 to apply processor count.
Set 1 for not creating additional thread during the function.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Geom.Vec2d.html">Vec2d</a>[]&gt;</dt>
<dd><p>A list of arrays of 2D vectors containing the cosine and sine components for each frequency and value function</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>TimeItem</code></dt>
<dd><p>The type of items that implement ITimeGetter</p>
</dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_FourierTransformSingleton_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformSingleton*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_FourierTransformSingleton_System_Collections_Generic_List_Hi_Physics_TimeValue__System_Double_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformSingleton(System.Collections.Generic.List{Hi.Physics.TimeValue},System.Double)">
FourierTransformSingleton(List&lt;TimeValue&gt;, double)
</h3>
<div class="markdown level1 summary"><p>Performs a Fourier transform at a specific angular frequency for a list of time values.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Vec2d FourierTransformSingleton(this List&lt;TimeValue&gt; fittedTimeValueList, double kw)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>fittedTimeValueList</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Physics.TimeValue.html">TimeValue</a>&gt;</dt>
<dd><p>The list of time-value pairs to transform</p>
</dd>
<dt><code>kw</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>The angular frequency to transform at</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Geom.Vec2d.html">Vec2d</a></dt>
<dd><p>A 2D vector containing the cosine and sine components of the transform</p>
</dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_FourierTransformSingleton_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformSingleton*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_FourierTransformSingleton_System_Collections_Generic_List_Hi_Physics_TimeValue__System_Double_System_TimeSpan_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformSingleton(System.Collections.Generic.List{Hi.Physics.TimeValue},System.Double,System.TimeSpan)">
FourierTransformSingleton(List&lt;TimeValue&gt;, double, TimeSpan)
</h3>
<div class="markdown level1 summary"><p>Get fourier transform parameter of indicated angular frequency <code class="paramref">kw</code>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Vec2d FourierTransformSingleton(this List&lt;TimeValue&gt; fittedTimeValueList, double kw, TimeSpan fullPeriod)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>fittedTimeValueList</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Physics.TimeValue.html">TimeValue</a>&gt;</dt>
<dd><p>timeToValueList which the time length is closed to integral multiple of period.
The offset part cause bias.</p>
</dd>
<dt><code>kw</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>multiplication of K (number of angular frequency) and W (base angular frequency f<em>2</em>pi)</p>
</dd>
<dt><code>fullPeriod</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>The full period of the time series.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Geom.Vec2d.html">Vec2d</a></dt>
<dd><p>(parameter cos,parameter sin)</p>
</dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_FourierTransformSingleton_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformSingleton*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_FourierTransformSingleton__1_System_Collections_Generic_List___0__System_Double_System_Func___0_System_Double____" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformSingleton``1(System.Collections.Generic.List{``0},System.Double,System.Func{``0,System.Double}[])">
FourierTransformSingleton&lt;TimeItem&gt;(List&lt;TimeItem&gt;, double, Func&lt;TimeItem, double&gt;[])
</h3>
<div class="markdown level1 summary"><p>Performs a Fourier transform at a specific angular frequency for a list of time-based items.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Vec2d[] FourierTransformSingleton&lt;TimeItem&gt;(this List&lt;TimeItem&gt; fittedTimeValueList, double kw, Func&lt;TimeItem, double&gt;[] getValueFuncs) where TimeItem : ITimeGetter</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>fittedTimeValueList</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;TimeItem&gt;</dt>
<dd><p>The list of time-based items to transform</p>
</dd>
<dt><code>kw</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>The angular frequency to transform at</p>
</dd>
<dt><code>getValueFuncs</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;TimeItem, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>&gt;[]</dt>
<dd><p>Array of functions to extract values from each TimeItem</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Geom.Vec2d.html">Vec2d</a>[]</dt>
<dd><p>An array of 2D vectors containing the cosine and sine components of the transform for each value function</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>TimeItem</code></dt>
<dd><p>The type of items that implement ITimeGetter</p>
</dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_FourierTransformSingleton_" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformSingleton*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_FourierTransformSingleton__1_System_Collections_Generic_List___0__System_Double_System_TimeSpan_System_Func___0_System_Double____" data-uid="Hi.Physics.TimeSeriesUtil.FourierTransformSingleton``1(System.Collections.Generic.List{``0},System.Double,System.TimeSpan,System.Func{``0,System.Double}[])">
FourierTransformSingleton&lt;TimeItem&gt;(List&lt;TimeItem&gt;, double, TimeSpan, Func&lt;TimeItem, double&gt;[])
</h3>
<div class="markdown level1 summary"><p>Get fourier transform parameter of indicated frequency <code class="paramref">kw</code>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Vec2d[] FourierTransformSingleton&lt;TimeItem&gt;(this List&lt;TimeItem&gt; fittedTimeValueList, double kw, TimeSpan fullPeriod, Func&lt;TimeItem, double&gt;[] getValueFuncs) where TimeItem : ITimeGetter</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>fittedTimeValueList</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;TimeItem&gt;</dt>
<dd><p>timeToValueList which the time length is closed to integral multiple of period.
The offset part cause bias.</p>
</dd>
<dt><code>kw</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>multiplication of K and W</p>
</dd>
<dt><code>fullPeriod</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>period of 1st fourier transform parameter.</p>
</dd>
<dt><code>getValueFuncs</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;TimeItem, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>&gt;[]</dt>
<dd><p>Array of functions to extract values from each TimeItem.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Geom.Vec2d.html">Vec2d</a>[]</dt>
<dd><p>(parameter cos,parameter sin)</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>TimeItem</code></dt>
<dd></dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_GetAvgTimeInterval_" data-uid="Hi.Physics.TimeSeriesUtil.GetAvgTimeInterval*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_GetAvgTimeInterval_System_Collections_Generic_List_Hi_Physics_TimeValue__" data-uid="Hi.Physics.TimeSeriesUtil.GetAvgTimeInterval(System.Collections.Generic.List{Hi.Physics.TimeValue})">
GetAvgTimeInterval(List&lt;TimeValue&gt;)
</h3>
<div class="markdown level1 summary"><p>Calculates the average time interval between consecutive TimeValue items in a list.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static TimeSpan GetAvgTimeInterval(this List&lt;TimeValue&gt; timeValueList)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>timeValueList</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Physics.TimeValue.html">TimeValue</a>&gt;</dt>
<dd><p>The list of TimeValue objects</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>The average time interval as a TimeSpan</p>
</dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_GetFullPeriod_" data-uid="Hi.Physics.TimeSeriesUtil.GetFullPeriod*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_GetFullPeriod__1_System_Collections_Generic_IList___0__" data-uid="Hi.Physics.TimeSeriesUtil.GetFullPeriod``1(System.Collections.Generic.IList{``0})">
GetFullPeriod&lt;TimeItem&gt;(IList&lt;TimeItem&gt;)
</h3>
<div class="markdown level1 summary"><p>Gets the total time period covered by a collection of time-based items.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static TimeSpan GetFullPeriod&lt;TimeItem&gt;(this IList&lt;TimeItem&gt; src) where TimeItem : ITimeGetter</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1">IList</a>&lt;TimeItem&gt;</dt>
<dd><p>The collection of time-based items</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>The time span between the first and last items, or TimeSpan.Zero if the collection is empty</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>TimeItem</code></dt>
<dd><p>The type of items that implement ITimeGetter</p>
</dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_GetInterpolatedAvgValueByTime_" data-uid="Hi.Physics.TimeSeriesUtil.GetInterpolatedAvgValueByTime*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_GetInterpolatedAvgValueByTime_System_Collections_Generic_IEnumerable_System_Collections_Generic_KeyValuePair_System_Double_System_Double___System_Double_" data-uid="Hi.Physics.TimeSeriesUtil.GetInterpolatedAvgValueByTime(System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{System.Double,System.Double}},System.Double)">
GetInterpolatedAvgValueByTime(IEnumerable&lt;KeyValuePair&lt;double, double&gt;&gt;, double)
</h3>
<div class="markdown level1 summary"><p>Get interpolated average value by time.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IEnumerable&lt;KeyValuePair&lt;double, double&gt;&gt; GetInterpolatedAvgValueByTime(this IEnumerable&lt;KeyValuePair&lt;double, double&gt;&gt; sortedTimeToValue, double timeInterval)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>sortedTimeToValue</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>&gt;&gt;</dt>
<dd><p>sorted time to value. Key is time. Value is value.</p>
</dd>
<dt><code>timeInterval</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>time interval</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>&gt;&gt;</dt>
<dd><p>enumerable of (Key: time, Value: interpolated average value)</p>
</dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_GetInterpolatedAvgValueByTime_" data-uid="Hi.Physics.TimeSeriesUtil.GetInterpolatedAvgValueByTime*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_GetInterpolatedAvgValueByTime__1_System_Collections_Generic_IEnumerable_System_Collections_Generic_KeyValuePair_System_Double___0___System_Double_System_Func___0___0___0__System_Func___0_System_Double___0__" data-uid="Hi.Physics.TimeSeriesUtil.GetInterpolatedAvgValueByTime``1(System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{System.Double,``0}},System.Double,System.Func{``0,``0,``0},System.Func{``0,System.Double,``0})">
GetInterpolatedAvgValueByTime&lt;Data&gt;(IEnumerable&lt;KeyValuePair&lt;double, Data&gt;&gt;, double, Func&lt;Data, Data, Data&gt;, Func&lt;Data, double, Data&gt;)
</h3>
<div class="markdown level1 summary"><p>Get interpolated average value by time.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static IEnumerable&lt;KeyValuePair&lt;double, Data&gt;&gt; GetInterpolatedAvgValueByTime&lt;Data&gt;(this IEnumerable&lt;KeyValuePair&lt;double, Data&gt;&gt; sortedTimeToValue, double timeInterval, Func&lt;Data, Data, Data&gt; addingFunc, Func&lt;Data, double, Data&gt; scalingFunc)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>sortedTimeToValue</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, Data&gt;&gt;</dt>
<dd><p>sorted time to value. Key is time. Value is value.</p>
</dd>
<dt><code>timeInterval</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>time interval</p>
</dd>
<dt><code>addingFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a>&lt;Data, Data, Data&gt;</dt>
<dd><p>Function to add two values of type Data</p>
</dd>
<dt><code>scalingFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a>&lt;Data, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, Data&gt;</dt>
<dd><p>Function to scale a value of type Data by a factor</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, Data&gt;&gt;</dt>
<dd><p>enumerable of (Key: time, Value: interpolated average value)</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>Data</code></dt>
<dd><p>The type of data values</p>
</dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_GetInterpolatedValueByTime_" data-uid="Hi.Physics.TimeSeriesUtil.GetInterpolatedValueByTime*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_GetInterpolatedValueByTime_System_Collections_Generic_List_Hi_Physics_TimeValue__System_TimeSpan_" data-uid="Hi.Physics.TimeSeriesUtil.GetInterpolatedValueByTime(System.Collections.Generic.List{Hi.Physics.TimeValue},System.TimeSpan)">
GetInterpolatedValueByTime(List&lt;TimeValue&gt;, TimeSpan)
</h3>
<div class="markdown level1 summary"><p>Gets an interpolated value from a list of TimeValue objects at a specified time.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static double GetInterpolatedValueByTime(this List&lt;TimeValue&gt; timeVsValueContour, TimeSpan t)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>timeVsValueContour</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="Hi.Physics.TimeValue.html">TimeValue</a>&gt;</dt>
<dd><p>The list of TimeValue objects</p>
</dd>
<dt><code>t</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>The time at which to interpolate</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>The interpolated value at the specified time</p>
</dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_GetInterpolatedValueByTime_" data-uid="Hi.Physics.TimeSeriesUtil.GetInterpolatedValueByTime*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_GetInterpolatedValueByTime_System_Collections_Generic_SortedList_System_Double_System_Double__System_Double_" data-uid="Hi.Physics.TimeSeriesUtil.GetInterpolatedValueByTime(System.Collections.Generic.SortedList{System.Double,System.Double},System.Double)">
GetInterpolatedValueByTime(SortedList&lt;double, double&gt;, double)
</h3>
<div class="markdown level1 summary"><p>Gets an interpolated double value from a time-value contour at a specified time.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static double GetInterpolatedValueByTime(this SortedList&lt;double, double&gt; timeVsValueContour, double t)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>timeVsValueContour</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>&gt;</dt>
<dd><p>The sorted list of time-value pairs</p>
</dd>
<dt><code>t</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>The time at which to interpolate</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>The interpolated value at the specified time</p>
</dd>
</dl>
<a id="Hi_Physics_TimeSeriesUtil_GetInterpolatedValueByTime_" data-uid="Hi.Physics.TimeSeriesUtil.GetInterpolatedValueByTime*"></a>
<h3 id="Hi_Physics_TimeSeriesUtil_GetInterpolatedValueByTime__1_System_Collections_Generic_SortedList_System_Double___0__System_Double_System_Func___0___0___0__System_Func___0_System_Double___0__" data-uid="Hi.Physics.TimeSeriesUtil.GetInterpolatedValueByTime``1(System.Collections.Generic.SortedList{System.Double,``0},System.Double,System.Func{``0,``0,``0},System.Func{``0,System.Double,``0})">
GetInterpolatedValueByTime&lt;T&gt;(SortedList&lt;double, T&gt;, double, Func&lt;T, T, T&gt;, Func&lt;T, double, T&gt;)
</h3>
<div class="markdown level1 summary"><p>Gets an interpolated value from a time-value contour at a specified time.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static T GetInterpolatedValueByTime&lt;T&gt;(this SortedList&lt;double, T&gt; timeVsValueContour, double t, Func&lt;T, T, T&gt; addingFunc, Func&lt;T, double, T&gt; scalingFunc)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>timeVsValueContour</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, T&gt;</dt>
<dd><p>The sorted list of time-value pairs</p>
</dd>
<dt><code>t</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>The time at which to interpolate</p>
</dd>
<dt><code>addingFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a>&lt;T, T, T&gt;</dt>
<dd><p>Function to add two values of type T</p>
</dd>
<dt><code>scalingFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a>&lt;T, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, T&gt;</dt>
<dd><p>Function to scale a value of type T by a factor</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><span class="xref">T</span></dt>
<dd><p>The interpolated value at the specified time</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>The type of values in the contour</p>
</dd>
</dl>
</article>
<div class="contribution d-print-none">
</div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
</div>
</div>
</footer>
</body>
</html>