difference in transfer function calculation in matlab and python

3 ビュー (過去 30 日間)
siva prasad
siva prasad 2025 年 4 月 11 日
コメント済み: Mathieu NOE 2025 年 4 月 14 日
i have developed below code in matlab and trying implement samething in python
but getting different outputs from matlab and python.
can you help here to convert this code to python
Matlab code
[Y, freq] = tfestimate(in, out, hanning(NFFT), round(overlap*NFFT), [], sample_rate);
example output
freq:freq= [0;0.0101800266860033]
Python code
f, Pxy = csd(out_signal,in_signal, fs=sample_rate, window=windows.hann(NFFT, sym=True), average='median', nperseg=NFFT, noverlap=int(overlap * NFFT), scaling='spectrum')
example output
freq: [0; 0.0132058240]
  3 件のコメント
siva prasad
siva prasad 2025 年 4 月 14 日
Thank you for the suggestion.
This is the code received from client and asked to convert it into python code.
I have used above python code along with welch for pxx. but when i compare results of
matlab code - freq
and python code - freq, i am getting some differences. so Please help me on converting to python.
Mathieu NOE
Mathieu NOE 2025 年 4 月 14 日

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by