forked from FT_DSP/FT_DSP.gitlink.net
207 lines
13 KiB
HTML
207 lines
13 KiB
HTML
|
||
|
||
<!DOCTYPE html>
|
||
<html class="writer-html5" lang="zh-CN" data-content_root="../">
|
||
<head>
|
||
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<title>FFTWithSize — MindSpore Signal+ 使用手册 alpha 文档</title>
|
||
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
|
||
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />
|
||
<link rel="stylesheet" type="text/css" href="../_static/table.css?v=72b86d3e" />
|
||
|
||
|
||
<script src="../_static/jquery.js?v=5d32c60e"></script>
|
||
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
||
<script src="../_static/documentation_options.js?v=406e4f49"></script>
|
||
<script src="../_static/doctools.js?v=9bcbadda"></script>
|
||
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
|
||
<script src="../_static/translations.js?v=beaddf03"></script>
|
||
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
||
<script src="../_static/table.js?v=99ed15ba"></script>
|
||
<script src="../_static/js/theme.js"></script>
|
||
<link rel="index" title="索引" href="../genindex.html" />
|
||
<link rel="search" title="搜索" href="../search.html" />
|
||
<link rel="next" title="Log10" href="log10.html" />
|
||
<link rel="prev" title="Equal" href="equal.html" />
|
||
</head>
|
||
|
||
<body class="wy-body-for-nav">
|
||
<div class="wy-grid-for-nav">
|
||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||
<div class="wy-side-scroll">
|
||
<div class="wy-side-nav-search" >
|
||
|
||
|
||
|
||
<a href="../index.html" class="icon icon-home">
|
||
MindSpore Signal+ 使用手册
|
||
</a>
|
||
<div role="search">
|
||
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
|
||
<input type="text" name="q" placeholder="搜索文档" aria-label="搜索文档" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
</div>
|
||
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="导航菜单">
|
||
<ul class="current">
|
||
<li class="toctree-l1"><a class="reference internal" href="../quickstart/index.html">快速入门</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../appdevelop/index.html">应用开发</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../operatorlib/index.html">算子库支持</a></li>
|
||
<li class="toctree-l1 current"><a class="reference internal" href="index.html">DSP Library C API Reference</a><ul class="current">
|
||
<li class="toctree-l2"><a class="reference internal" href="add.html">Add</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="equal.html">Equal</a></li>
|
||
<li class="toctree-l2 current"><a class="current reference internal" href="#">FFTWithSize</a><ul>
|
||
<li class="toctree-l3"><a class="reference internal" href="#mindspore.ops.FFTWithSize"><code class="docutils literal notranslate"><span class="pre">mindspore.ops.FFTWithSize</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l2"><a class="reference internal" href="log10.html">Log10</a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../refdoc/index.html">参考资料</a></li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="移动版导航菜单" >
|
||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||
<a href="../index.html">MindSpore Signal+ 使用手册</a>
|
||
</nav>
|
||
|
||
<div class="wy-nav-content">
|
||
<div class="rst-content">
|
||
<div role="navigation" aria-label="页面导航">
|
||
<ul class="wy-breadcrumbs">
|
||
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
|
||
<li class="breadcrumb-item"><a href="index.html">DSP Library C API Reference</a></li>
|
||
<li class="breadcrumb-item active">FFTWithSize</li>
|
||
<li class="wy-breadcrumbs-aside">
|
||
<a href="../_sources/functionlib/fft_with_size.rst.txt" rel="nofollow"> 查看页面源码</a>
|
||
</li>
|
||
</ul>
|
||
<hr/>
|
||
</div>
|
||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||
<div itemprop="articleBody">
|
||
|
||
<section id="fftwithsize">
|
||
<h1>FFTWithSize<a class="headerlink" href="#fftwithsize" title="Link to this heading"></a></h1>
|
||
<dl class="py class">
|
||
<dt class="sig sig-object py" id="mindspore.ops.FFTWithSize">
|
||
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">mindspore.ops.</span></span><span class="sig-name descname"><span class="pre">FFTWithSize</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">signal_ndim</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">inverse</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">real</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">norm</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'backward'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">onesided</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">signal_sizes</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">()</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.ops.FFTWithSize" title="Link to this definition"></a></dt>
|
||
<dd><p>傅里叶变换,可以对参数进行调整,以实现FFT/IFFT/RFFT/IRFFT。</p>
|
||
<p>对于FFT,它计算以下表达式:</p>
|
||
<div class="math notranslate nohighlight">
|
||
\[X[\omega_1, \dots, \omega_d] =
|
||
\sum_{n_1=0}^{N_1-1} \dots \sum_{n_d=0}^{N_d-1} x[n_1, \dots, n_d]
|
||
e^{-j\ 2 \pi \sum_{i=0}^d \frac{\omega_i n_i}{N_i}},\]</div>
|
||
<p>其中, <span class="math notranslate nohighlight">\(d\)</span> = <cite>signal_ndim</cite> 是信号的维度,<span class="math notranslate nohighlight">\(N_i\)</span> 则是信号第 <span class="math notranslate nohighlight">\(i\)</span> 个维度的大小。</p>
|
||
<p>对于IFFT,它计算以下表达式:</p>
|
||
<div class="math notranslate nohighlight">
|
||
\[X[\omega_1, \dots, \omega_d] =
|
||
\frac{1}{\prod_{i=1}^d N_i} \sum_{n_1=0}^{N_1-1} \dots \sum_{n_d=0}^{N_d-1} x[n_1, \dots, n_d]
|
||
e^{\ j\ 2 \pi \sum_{i=0}^d \frac{\omega_i n_i}{N_i}},\]</div>
|
||
<p>其中, <span class="math notranslate nohighlight">\(d\)</span> = <cite>signal_ndim</cite> 是信号的维度,<span class="math notranslate nohighlight">\(N_i\)</span> 则是信号第 <span class="math notranslate nohighlight">\(i\)</span> 维的大小。</p>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">备注</p>
|
||
<ul class="simple">
|
||
<li><p>FFT/IFFT要求complex64或complex128类型的输入,返回complex64或complex128类型的输出。</p></li>
|
||
<li><p>RFFT要求bool, uint8, int8, int16, int32, int64, float32或float64类型的输入,
|
||
返回complex64或complex128类型的输出。</p></li>
|
||
<li><p>IRFFT要求complex64或complex128类型的输入,返回float32或float64类型的输出。</p></li>
|
||
</ul>
|
||
</div>
|
||
<div class="admonition warning">
|
||
<p class="admonition-title">警告</p>
|
||
<p>这是一个实验性API,后续可能修改或删除。</p>
|
||
</div>
|
||
<dl class="simple">
|
||
<dt>参数:</dt><dd><ul class="simple">
|
||
<li><p><strong>signal_ndim</strong> (int) - 表示每个信号中的维数,控制着傅里叶变换的维数,其值只能为1、2或3。</p></li>
|
||
<li><p><strong>inverse</strong> (bool) - 表示该操作是否为逆变换,用以选择FFT 和 RFFT 或 IFFT 和 IRFFT。</p>
|
||
<ul>
|
||
<li><p>如果为 <code class="docutils literal notranslate"><span class="pre">True</span></code> ,则为IFFT 和 IRFFT。</p></li>
|
||
<li><p>如果为 <code class="docutils literal notranslate"><span class="pre">False</span></code> ,FFT 和 RFFT。</p></li>
|
||
</ul>
|
||
</li>
|
||
<li><p><strong>real</strong> (bool) - 表示该操作是否为实变换,与 <cite>inverse</cite> 共同决定具体的变换模式:</p>
|
||
<ul>
|
||
<li><p><cite>inverse</cite> 为 <code class="docutils literal notranslate"><span class="pre">False</span></code> , <cite>real</cite> 为 <code class="docutils literal notranslate"><span class="pre">False</span></code> :对应FFT模式。</p></li>
|
||
<li><p><cite>inverse</cite> 为 <code class="docutils literal notranslate"><span class="pre">True</span></code> , <cite>real</cite> 为 <code class="docutils literal notranslate"><span class="pre">False</span></code> :对应IFFT模式。</p></li>
|
||
<li><p><cite>inverse</cite> 为 <code class="docutils literal notranslate"><span class="pre">False</span></code> , <cite>real</cite> 为 <code class="docutils literal notranslate"><span class="pre">True</span></code> :对应RFFT模式。</p></li>
|
||
<li><p><cite>inverse</cite> 为 <code class="docutils literal notranslate"><span class="pre">True</span></code> , <cite>real</cite> 为 <code class="docutils literal notranslate"><span class="pre">True</span></code> :对应IRFFT模式。</p></li>
|
||
</ul>
|
||
</li>
|
||
<li><p><strong>norm</strong> (str,可选) - 表示该操作的规范化方式,可选值:[ <code class="docutils literal notranslate"><span class="pre">"backward"</span></code> , <code class="docutils literal notranslate"><span class="pre">"forward"</span></code> , <code class="docutils literal notranslate"><span class="pre">"ortho"</span></code> ]。默认值: <code class="docutils literal notranslate"><span class="pre">"backward"</span></code> 。</p>
|
||
<ul>
|
||
<li><p>"backward",正向变换不缩放,逆变换按 <span class="math notranslate nohighlight">\(1/n\)</span> 缩放,其中 <cite>n</cite> 表示输入 <cite>x</cite> 的元素数量。。</p></li>
|
||
<li><p>"ortho",正向变换与逆变换均按 <span class="math notranslate nohighlight">\(1/\sqrt n\)</span> 缩放。</p></li>
|
||
<li><p>"forward",正向变换按 <span class="math notranslate nohighlight">\(1/n\)</span> 缩放,逆变换不缩放。</p></li>
|
||
</ul>
|
||
</li>
|
||
<li><p><strong>onesided</strong> (bool,可选) - 控制输入是否减半以避免冗余。默认值: <code class="docutils literal notranslate"><span class="pre">True</span></code> 。</p></li>
|
||
<li><p><strong>signal_sizes</strong> (tuple,可选) - 原始信号的大小(RFFT变换之前的信号,不包含batch这一维),只有在IRFFT模式下和设置 <cite>onesided</cite> 为True时需要该参数,需要满足
|
||
以下条件。默认值: <code class="docutils literal notranslate"><span class="pre">()</span></code> 。</p>
|
||
<ul>
|
||
<li><p><cite>signal_sizes</cite> 的长度等于IRFFT的 <cite>signal_ndim</cite> : <span class="math notranslate nohighlight">\(len(signal\_sizes)=signal\_ndim\)</span> 。</p></li>
|
||
<li><p><cite>signal_sizes</cite> 的最后一个维度除以2等于IRFFT输入的最后一个维度: <span class="math notranslate nohighlight">\(signal\_size[-1]/2+1=x.shape[-1]\)</span> 。</p></li>
|
||
<li><p>除了最后一个维度外, <cite>signal_sizes</cite> 的维度与输入shape完全相同: <span class="math notranslate nohighlight">\(signal\_sizes[:-1]=x.shape[:-1]\)</span> 。</p></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
<dt>输入:</dt><dd><ul class="simple">
|
||
<li><p><strong>x</strong> (Tensor) - 输入Tensor的维数必须大于或等于 <cite>signal_ndim</cite> 。</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt>输出:</dt><dd><p>Tensor,表示复数到复数、实数到复数或复数到实数傅里叶变换的结果。</p>
|
||
</dd>
|
||
<dt>异常:</dt><dd><ul class="simple">
|
||
<li><p><strong>TypeError</strong> - 如果FFT/IFFT/IRFF的输入类型不是以下类型之一:complex64、complex128。</p></li>
|
||
<li><p><strong>TypeError</strong> - 如果输入的类型不是Tensor。</p></li>
|
||
<li><p><strong>ValueError</strong> - 如果输入 <cite>x</cite> 的维度小于 <cite>signal_ndim</cite> 。</p></li>
|
||
<li><p><strong>ValueError</strong> - 如果 <cite>signal_ndim</cite> 大于3或小于1。</p></li>
|
||
<li><p><strong>ValueError</strong> - 如果 <cite>norm</cite> 取值不是"backward"、"forward"或"ortho"。</p></li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
</section>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<footer><div class="rst-footer-buttons" role="navigation" aria-label="页脚">
|
||
<a href="equal.html" class="btn btn-neutral float-left" title="Equal" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> 上一页</a>
|
||
<a href="log10.html" class="btn btn-neutral float-right" title="Log10" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||
</div>
|
||
|
||
<hr/>
|
||
|
||
<div role="contentinfo">
|
||
<p>© 版权所有 2025 - 2025, NUDT-674。</p>
|
||
</div>
|
||
|
||
利用 <a href="https://www.sphinx-doc.org/">Sphinx</a> 构建,使用的
|
||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">主题</a>
|
||
由 <a href="https://readthedocs.org">Read the Docs</a> 开发.
|
||
|
||
|
||
</footer>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
<script>
|
||
jQuery(function () {
|
||
SphinxRtdTheme.Navigation.enable(true);
|
||
});
|
||
</script>
|
||
|
||
</body>
|
||
</html> |