DaZuiZui commented on issue #17939:
URL: https://github.com/apache/iotdb/issues/17939#issuecomment-4716209010

   # English
   It is reasonable to retain N and NORM in the function signature of v1 
because they are standard FFT parameters and their semantics are already 
well-established in the existing FFT API.
   
   I will update the v1 design accordingly.
   
   N will be an optional integer transform length. If N is not provided, the 
transform length defaults to the input length of each partition. If N is 
smaller than the input length, the input sequence will be truncated. If N is 
larger than the input length, the input sequence will be zero-padded. The 
number of output frequency bins will be N.
   
   NORM will be an optional string parameter. The supported values will be 
backward, forward, and ortho. The default value will be backward, aligned with 
numpy.fft.fft.
   
   The frequency axis will be calculated based on the transform length N and 
SAMPLE_INTERVAL. If SAMPLE_INTERVAL is provided, it is used directly. 
Otherwise, it is inferred from the time column within each partition as:
   
   (last_time - first_time) / (row_count - 1)
   
   The frequency unit will be Hz, i.e., cycles per second.
   
   The rest of the v1 design remains unchanged:
   
   1. expose FFT only, not DFT;
   2. no VALUE parameter;
   3. transform all numeric columns except the time column and PARTITION BY 
columns;
   4. require time to be strictly ascending within each partition;
   5. assume uniformly sampled input in v1 without checking every adjacent 
interval;
   6. output full spectrum only;
   7. keep the minimal output schema with frequency_index, frequency, and 
real/imag columns;
   8. leave amplitude, phase, and one-sided spectrum for possible future 
extensions.
   
   I will also make one detail explicit in the design doc: when N is provided, 
the number of output rows per partition is N, and frequency_index ranges from 0 
to N - 1. When N is not provided, N defaults to the input length of that 
partition.
   
   # Chinese
   在 v1 的函数签名中保留 N 和 NORM 是合理的,因为它们是标准的 FFT 参数,并且它们的语义在现有 FFT API 中已经比较成熟。
   
   我会相应更新 v1 设计。
   
   N 将作为一个可选的整数参数,表示变换长度。如果用户没有提供 N,则变换长度默认等于每个 partition 的输入长度。如果 N 
小于输入长度,则截断输入序列。如果 N 大于输入长度,则对输入序列进行 zero-padding。输出的 frequency bin 数量将等于 N。
   
   NORM 将作为一个可选的字符串参数。支持的取值包括 backward、forward 和 ortho。默认值为 backward,与 
numpy.fft.fft 保持一致。
   
   frequency axis 将基于变换长度 N 和 SAMPLE_INTERVAL 计算。如果用户提供了 
SAMPLE_INTERVAL,则直接使用该值。否则,在每个 partition 内根据时间列推断:
   
   (last_time - first_time) / (row_count - 1)
   
   frequency 的单位将是 Hz,也就是 cycles per second。
   
   v1 设计中的其他部分保持不变:
   
   1. 只暴露 FFT,不暴露 DFT;
   2. 不提供 VALUE 参数;
   3. 转换除时间列和 PARTITION BY 列以外的所有数值列;
   4. 要求每个 partition 内的时间严格升序;
   5. v1 假设输入是均匀采样的,但不检查每一对相邻时间戳的间隔;
   6. 只输出 full spectrum;
   7. 保持最小输出 schema,即 frequency_index、frequency 以及 real/imag 列;
   8. amplitude、phase 和 one-sided spectrum 留作后续可能的扩展。
   
   我也会在设计文档中明确一个细节:当用户提供 N 时,每个 partition 的输出行数为 N,frequency_index 的范围是 0 到 N - 
1。当用户没有提供 N 时,N 默认等于该 partition 的输入长度。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to