Skip to content

将paddle.signal.stft中的onesided参数默认值从True改为None #7329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/api/paddle/signal/stft_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ stft
-------------------------------


.. py:function:: paddle.signal.stft(x, n_fft, hop_length=None, win_length=None, window=None, center=True, pad_mode='reflect', normalized=False, onesided=True, name=None)
.. py:function:: paddle.signal.stft(x, n_fft, hop_length=None, win_length=None, window=None, center=True, pad_mode='reflect', normalized=False, onesided=None, name=None)

短时傅里叶变换。

Expand Down Expand Up @@ -47,7 +47,7 @@ stft
数;
- **onesided** (bool,可选) - 当输入为实信号时,选择是否只返回傅里叶变换结果的一半的频点
值(输入信号和窗函数均为实数时,傅里叶变换结果具有共轭对称性)。如果输入的信号或者窗函数的
数据类型是复数,则此时不能设置为 ``True``。默认为 ``True``;
数据类型是复数,则此时不能设置为 ``True``。默认为 ``None``;
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ paddle.signal.stft(x,
center=True,
pad_mode='reflect',
normalized=False,
onesided=True,
onesided=None,
name=None)
```

Expand All @@ -44,7 +44,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
| center | center | 选择是否将输入信号进行补长。默认为 True。 |
| pad_mode | pad_mode | 当 center 为 True 时,确定 padding 的模式。 |
| normalized | normalized | 是否将傅里叶变换的结果乘以值为 1/sqrt(n) 的缩放系数。 |
| onesided | onesided | 当输入为实信号时,选择是否只返回傅里叶变换结果的一半的频点值,如果输入的信号或者窗函数的 数据类型是复数,则此时不能设置为 True。默认为 True。 |
| onesided | onesided | 当输入为实信号时,选择是否只返回傅里叶变换结果的一半的频点值,如果输入的信号或者窗函数的 数据类型是复数,则此时不能设置为 True。默认为 None。 |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

前面这句话也要一起改,把这整句话理顺一些

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,收到,已修改

| return_complex| - | 表示当输入为复数时,是否以复数形式返回,还是将实部与虚部分开以实数形式返回。Paddle 目前只支持返回复数,分开返回实部与虚部的情况,需要使用 as_real 进行转写。 |


Expand Down